Closed ekimekim closed 3 months ago
Preliminary review, it seems fine. If it's functional, good to merge
Still need to test. Unfortunately since it involves the youtube API it's a bit annoying to do.
Looks good to me.
Will test properly as part of our all-up testing.
Co-authored by @ZeldaZach Fixes https://github.com/dbvideostriketeam/wubloader/issues/386
This adds two configurable properties to a playlist, specifying a "first" and "last" event id. Both are optional.
When present, they cause the video associated with that event to always be placed first or last in playlist order, overriding the normal "by start time" ordering and working retroactively (ie. they'll be moved to the front/back if not there already). The primary use case for this is supercuts, which we generally want to put at the end of a playlist even if the associated event row coincides with the first instance of the thing being supercut. It may also prove useful eg. if we get a clean version of a repeating intro, which would best go at the front of a playlist.
While conceptually simple, this change required some signifigant refactoring of
playlist_manager
to plumb more data to where it was needed, for example needing to cache the playlist entry ids instead of just video ids. Along the way we do some refactoring for clarity, most notably splitting the use of ambiguous variables namedplaylist
into either:playlist
(A list of entries)playlist_id
(A string identifier)playlist_config
(A named tuple containing playlist tags and first/last event ids)This change does not incorporate any way to set these first/last event ids, which would likely be in sheetsync - however I don't really want to make further changes there until https://github.com/dbvideostriketeam/wubloader/issues/345 is complete.