kieraneglin / pinchflat

Your next YouTube media manager
GNU Affero General Public License v3.0
908 stars 18 forks source link

[FR] Option for sequential episode numbering within a season #297

Closed DarkVirtue closed 2 months ago

DarkVirtue commented 3 months ago

Is your feature request related to a problem? Please describe. Many YT channels already have entries with metadata providers like TheTVDB where seasons are numbered by year, but episodes with each season are number sequentially. So the first episode of 2024 is episode 01, the second is 02, etc, regardless of their absolute upload dates.

The current output template options are not compatible with this scheme.

Describe the solution you'd like A template option for sequential episode numbering within a season.

Describe alternatives you've considered I've written a script for myself that counts the episodes in a season, renumbers them sequentially, and updates the .nfo files. This has to be done each time a new episode is downloaded.

Additional context Example of a channel with TheTVDB and sequentially-numbered episodes and season numbers based on year: https://thetvdb.com/series/mandaloregaming#seasons

kieraneglin commented 3 months ago

Hey there! Thanks for the report (:

Just letting you know I'm on vacation for a few weeks and I'll look at this once I'm back!

kieraneglin commented 2 months ago

Okay! I'm back and I've taken a look at this.

Unfortunately I don't think this will ever be possible with the way media is currently indexed. Pinchflat indexes videos "top-to-bottom" which is to say that the newest videos in a channel get indexed first. Given that, PF doesn't know how many episodes it'll ultimately find in a season which would be required to accurately count their position when reading in reverse. Even then, I don't believe that yt-dlp provides a way to group videos in such a way which would be needed since output template variables need to be interpolated at time of yt-dlp request and cannot be updated retroactively.

I'm closing this issue as "not planned" but feel free to reopen if you think I've missed something!