Commit Graph

124 Commits (chrusher-thumbnail-frontend)

Author SHA1 Message Date
Christopher Usher d376103dfa Logging for thumbnail template management 1 month ago
Christopher Usher e0fc1eaf08 Refactor get_thumbnail and other fixes and improvments 1 month ago
Christopher Usher 70c8afe779 Switching thrimshim over to store thumbnail templates in the database 1 month ago
Christopher Usher 33f75efc19 Updatea thrimshim authentication to use roles table 1 month ago
ZeldaZach c378a1e4ab Add Audit Logging for several endpoints
- Use transactions for DB commits to avoid audit-less logs

Endpoints Supported:
- Manual Link
- Reset Row
- Update Row
2 months ago
Mike Lang 23ad78d592 Record in database when end time is "--"
We need this so that reverse sync reproduces these values correctly.

To handle this in the database, we have a composite type (dashed: boolean, value: timestamp).
Value is always valid and is equivalent to the old timestamp column,
but must be equal to start_time if dashed is true.

The only place we directly reference this column outside sheetsync is thrimshim, where we
always consider the value only.
3 months ago
Mike Lang 12150a4005 thrimshim: Return list of available transitions
For use in thrimbletrimmer for a drop-down.
3 months ago
Mike Lang a3aaa37bb0 Restructure playlists table
to have all tags, not just playlists.
Notably, this means playlist ids may be null.
3 months ago
Mike Lang 8dd6741ee9 schema: Playlist tags may be null, indicating "match nothing"
This is intended for partially-entered playlist data where tags have not been specified yet.
3 months ago
Mike Lang be111ccb2a Change database primary key from UUID to TEXT
We still store uuids, but in text form.
This allows us to store non-UUID ids for systems that have other ids.
3 months ago
Mike Lang 3606fadaa8 Pin gevent version to work around build issues
Seeing the following error on latest versions of gevent:

 Traceback (most recent call last):
   File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
     return _run_code(code, main_globals, None,
   File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
     exec(code, run_globals)
   File "/usr/lib/python3.9/site-packages/zulip_bots/schedulebot.py", line 2, in <module>
     import gevent.monkey
   File "/usr/lib/python3.9/site-packages/gevent/__init__.py", line 72, in <module>
     from gevent._hub_local import get_hub
   File "/usr/lib/python3.9/site-packages/gevent/_hub_local.py", line 150, in <module>
     import_c_accel(globals(), 'gevent.__hub_local')
   File "/usr/lib/python3.9/site-packages/gevent/_util.py", line 148, in import_c_accel
     mod = importlib.import_module(cname)
   File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
     return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named 'gevent._gevent_c_hub_local'
1 year ago
Mike Lang 86951d5916 thrimshim: Fix bug in extrapolate code when time is a float 1 year ago
Mike Lang 7a27938244 thrimshim: Expose time of day and 24h time 1 year ago
Mike Lang 78c053000e Upgrade pip in order to make wheels work 1 year ago
Mike Lang c436871ba6 Fix bug in thrimshim for archive cuts 1 year ago
Mike Lang 3b1af8c5e5 thrimshim: Expose clock readings 1 year ago
Mike Lang 720f1c4b41 thrimshim: Sanity checks for odometer 1 year ago
Mike Lang 06cd5d48ee More extrapolation fixes 1 year ago
Mike Lang 834dc55b41 thrimshim: Fix typo in odo extrapolation 1 year ago
Mike Lang f0e2aae519 thrimshim: Fix odometer endpoint 1 year ago
Mike Lang a83dbb58f7 thrimshim: Fix default templates 1 year ago
Mike Lang 734a7371f3 Add bus_data DB table and have thrimshim able to query it for latest odo reading 1 year ago
Mike Lang 8d984110ab thrimshim: Special handling for "archive" events 1 year ago
Mike Lang cbf3269001 thrimshim: Update default template names 1 year ago
Mike Lang 044dfb8084 Pin argh to avoid stupid breaking changes 1 year ago
Mike Lang 30d5ccc483 Fix all old references to github.com/ekimekim/wubloader 1 year ago
Mike Lang c36976dcca Default to rdp template for RDP thumbnails 2 years ago
ElementalAlchemist fafa2fa125 Add missing bracket to playlist strip regex 2 years ago
Mike Lang 6a713993af fix another typo 2 years ago
Mike Lang 8fbbb3f0a1 thrimshim: Fix description footer formatting
Needs newlines before playlists section, and a line between playlist section and footer.
2 years ago
Mike Lang 85c4319f2a thrimshim: Fix bug where description playlists header was added with zero playlists
We only want it to show at all if there's at least one playlist.
2 years ago
Mike Lang a298087137 playlists in description: round trip the description correctly 2 years ago
Mike Lang 17c5e86250 wip: 2 years ago
Mike Lang 34a33fdeb6 partially implement playlist links in video descriptions
We make them conceptually "part of the footer" so they're updated only when the video
is otherwise updated (which would generally mean MODIFIED).
2 years ago
Mike Lang 46ad45bdb9 thrimshim: Don't 500 if MODIFIED video doesn't contain some fields
Missing fields _should_ be interpreted as "don't update these" but we weren't doing that.
2 years ago
Mike Lang 57d89b9b39 Fix missing imports 2 years ago
Mike Lang 05816ac51d fix a bug where shift is calculated wrong
we need to use the hour in PST, which we just hard-code as 8 hours.
If we ever hit DST before the run, we'll go back and do it properly.
2 years ago
Mike Lang bd519369bd thumbnail fixes 2 years ago
Mike Lang 24c066e3e8 Add thumbnail support to thrimshim
All thumbnail columns are modifiable, so you can eg. switch from
a templated thumbnail to a custom one, or change the time and template.
2 years ago
Mike Lang bd948235fb thrimbletrimmer: Add advanced submission option for "public" videos
Note that the default is true, so we only expand the advanced pane if it's false.
False corresponds to uploading a video as "unlisted".

Also mark it as modifyable.
2 years ago
Mike Lang f06be1f391 thrimshim changes for modified
would be ideal to check all args to see if any don't match (and refuse to modify in that case)
but eh too much work to properly normalise.
2 years ago
Mike Lang 7649a4e840 Improve WSGIServer graceful shutdown handling
Previously both restreamer and thrimshim had some complex logic for dealing with
graceful shutdown, in different ways, that was still prone to race conditions.

We replace this with a common method that does it properly.

Fixes #226
3 years ago
Mike Lang a47c29fff4 Link images to github repo by adding a LABEL
When pushed, this tells github to associate the ghcr.io repo that was pushed to
with the github repo specified (the owner needs to match).

This does a few things.
Most importantly, this automatically gives github actions credentials to push to these
repositories when run in the context of the wubloader repo.
3 years ago
Mike Lang 192a0869f7 thrimshim: Fix bug in serializing columns
Converting all datetime values to string no longer works because video_range
isn't a datetime but a list of datetimes. We switch to a more robust approach
of using the json "default" arg to specify how to serialize.
3 years ago
Mike Lang aab8cf2f0f Set up plumbing for multi-range videos and implement no-transition fast cut videos only
This is the simplest case as we can just cut each range like we already do,
then concat the results.

We still allow for the full design in the database and cutter, but error out if transitions
is ever anything but hard cuts or if it's a full cut.

We also update the restreamer to allow accepting ranges, however for usability we still allow
the old "just one start and end" args.

Note this changes the thrimshim API to give and take the new "video_ranges" and "video_transitions" columns.
3 years ago
Mike Lang 2865088692 thrimshim: Further validation of titles/descriptions
Youtube doesn't allow < or > characters, or extremely long descriptions.

Fixes #215, #219
3 years ago
Mike Lang 62bd6539ea Unpin gevent as that was a workaround for a py2 issue 3 years ago
Mike Lang f2a8007bf7 Fix build dependency issues 3 years ago
Mike Lang d42d850153 thrimshim: misc cleanup 3 years ago
HubbeKing 6d790a1b36 Do a first naive pass for py3 compatibility
Check that open() calls for reading and writing use binary modes
Use alpine version with py3-pip package
Use python3 in Dockerfile CMD
Remove sys.setdefaultencoding() "hack"
Simplify ensure_directory() in common.common package
3 years ago