ZeroQI / Absolute-Series-Scanner

Seasons, absolute mode, Subfolders...
999 stars 155 forks source link

tvdb2 scanner does not seem to map specials correctly #491

Closed Rikiki87 closed 3 months ago

Rikiki87 commented 4 months ago

Platform

Operating system and version: Archlinux Plex version: 1.40.2.8395

Expected Behavior

In TVDB2 mode, specials that have an absolute number should be mapped accordingly by the scanner.

Current Behavior

Episode is mapped to the incorrect season and ends up pushing back episodes.

$ cat "Mob Psycho 100 (2016) [tvdb2-307375].scanner.log"
$ cat "Mob Psycho 100 (2016) [tvdb2-307375].scanner.log"
=============================================================================================================================================================
Call: "Plex", path: "Mob Psycho 100 (2016) [tvdb2-307375]", folder_show: "Mob Psycho 100 (2016) [tvdb2-307375]", dirs (0), files (38)
=============================================================================================================================================================
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Removed file: 'Mob Psycho 100 (2016) [tvdb2-307375]/.plexmatch' has an unsupported extension
=============================================================================================================================================================
Forced ID (series folder) - source: "tvdb2", id: "307375"
TVDB season mode (tvdb2) enabled
Using cached file - Filename: '/config/Library/Application Support/Plex Media Server/Plug-in Support/Data/com.plexapp.agents.hama/DataItems/TheTVDB/json/307375/episodes_page1_en.json', Age: '0.16 days', Limit: '6 days', url: 'https://api.thetvdb.com/series/307375/episodes?page=1'
unknown_series_length: False, tvdb_mapping: {13: (2, 1), 14: (2, 2), 15: (2, 3), 16: (2, 4), 17: (2, 5), 18: (2, 6), 19: (2, 7), 20: (2, 8), 21: (2, 9), 22: (2, 10), 23: (2, 11), 24: (2, 12), 25: (2, 13), 26: (3, 1), 27: (3, 2), 28: (3, 3), 29: (3, 4), 30: (3, 5), 31: (3, 6), 32: (3, 7), 33: (3, 8), 34: (3, 9), 35: (3, 10), 36: (3, 11), 37: (3, 12)} (showing changing seasons/episodes only)
-------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
"Mob Psycho 100 (2016) [tvdb2-307375]" s03e         1     (Orig: s01e026    ) "ANIDB_RX-5" "Bluray- .x265-Judas" "Mob Psycho 100.E026.Bluray-1080p.x265-Judas.mkv"
[...]
"Mob Psycho 100 (2016) [tvdb2-307375]" s04e        38     (Orig: s01e038    ) "ANIDB_RX-5" "Bluray- .x265-Xspitfire911" "Mob Psycho 100.E038.Bluray-1080p.x265-Xspitfire911.mkv"
=============================================================================================================================================================

image The result from the tvdb api shows that episode with absolute number 26 should map to S00E08 but as show in the above logs, the scanner is trying to map E026 to S03E01. This is incorrect and the very last episode (Absolute number 38) ends up pushed back incorrectly in a nonexistent "Season 4"

Steps to Reproduce

  1. Add a show with specials that also have absolute numbers (Mob psycho 100 E026, Hibike Euphonium E014, K-ON E019)
  2. Rescan library
  3. The show will most likely have season with a single episode at the end, this is the episode that was pushed back by the special: image image image

Additional information

Note: I think fixing this would also fix an issue where specials that have absolute numbers setting them after the show are shown as a new season instead of a special (ex: Clannad OAVs) image

ZeroQI commented 3 months ago

Code did show it voluntarily discarded season 0 and arranged eps sequentially re-numbering them by design, probably due to recap episodes ? I have no time to reproduce but please test the following code update, it should solve this issue

Rikiki87 commented 3 months ago

That did it! Specials are showing in their proper season for both Mob Psycho, Clannad and Hibike, it does require me to do a plex dance for each of the affected show but I can handle that.

Thanks a lot!

ZeroQI commented 3 months ago

Thanks for the documented answer. Initially when coding did a failsafe and this scenario didn't make sense but your exemples speaks volume and motivated me to fix it.