pymedusa / Medusa

Automatic Video Library Manager for TV Shows. It watches for new episodes of your favorite shows, and when they are posted it does its magic.
https://pymedusa.com
GNU General Public License v3.0
1.8k stars 277 forks source link

airdate_offset setting is not respected if indexer airdate yields status as UNAIRED #11602

Closed borntohonk closed 9 months ago

borntohonk commented 10 months ago

Describe the bug https://github.com/pymedusa/Medusa/blob/master/medusa/tv/episode.py#L2169-L2193 https://github.com/pymedusa/Medusa/blob/master/medusa/server/api/v1/core.py#L906-L919

*Episode Updater does sometimes set episode status to wanted if airdate_offset is set, so it does partially work.

airdate_offset override setting does not actually snatch for episodes ahead of time, as pymedusa will declare that the episode is UNAIRED, even if finding objects in a provider search, as it does make the search, find matching results, if any, and then ignore the results because the logic behind ignores anything marked as UNAIRED.

it is my understanding airdate_offset instead sets Episodeupdater to mark things as wanted, which is fine, but forced search and daily search where results are found should be respected despite UNAIRED status is found.

To Reproduce

  1. Add a show (such as anime) that has early released episodes that are ahead of indexer provided date, ex. as time of writing: ( https://thetvdb.com/series/isekai-de-mofumofu-nadenade-suru-tameni-ganbattemasu )
  2. hit edit
  3. go to the advanced tab
  4. change the offset in the negative, by -168(hours) if using the example in 1. 5A. fail to automatically snatch anything because it's hardcoded to ignore episodes marked as UNAIRED, despite searching and finding a result. (i.e. indexer date says episode releases 7th of january, but episodes actually release to distribution 1st of january 5B. hit the Forced Search button, see it get a green checkmark, indicating search was made, result was found.

forced_search

  1. go to logs and review results (provided one has enabled at least nyaa as provider)
2024-01-05 14:33:17 INFO    FORCEDSEARCHQUEUE-BACKLOG-422186 :: [c5a1e37] No needed episodes found during backlog search for: Fluffy Paradise
2024-01-05 14:33:17 INFO    FORCEDSEARCHQUEUE-BACKLOG-422186 :: Nyaa :: [c5a1e37] Quality of [SubsPlease].Isekai.de.Mofumofu.Nadenade.suru.Tame.ni.Ganbattemasu.-.01.(480p).[77F406F9].mkv is SDTV
2024-01-05 14:33:17 INFO    FORCEDSEARCHQUEUE-BACKLOG-422186 :: Nyaa :: [c5a1e37] Quality of [SubsPlease].Isekai.de.Mofumofu.Nadenade.suru.Tame.ni.Ganbattemasu.-.01.(480p).[77F406F9].mkv is SDTV
2024-01-05 14:33:17 INFO    FORCEDSEARCHQUEUE-BACKLOG-422186 :: Nyaa :: [c5a1e37] Quality of [SubsPlease].Isekai.de.Mofumofu.Nadenade.suru.Tame.ni.Ganbattemasu.-.01.(720p).[FC5A71B6].mkv is 720p HDTV
2024-01-05 14:33:17 INFO    FORCEDSEARCHQUEUE-BACKLOG-422186 :: Nyaa :: [c5a1e37] Quality of [SubsPlease].Isekai.de.Mofumofu.Nadenade.suru.Tame.ni.Ganbattemasu.-.01.(720p).[FC5A71B6].mkv is 720p HDTV
2024-01-05 14:33:17 INFO    FORCEDSEARCHQUEUE-BACKLOG-422186 :: Nyaa :: [c5a1e37] Quality of [SubsPlease].Isekai.de.Mofumofu.Nadenade.suru.Tame.ni.Ganbattemasu.-.01.(1080p).[21CF569D].mkv is 1080p HDTV
2024-01-05 14:33:17 INFO    FORCEDSEARCHQUEUE-BACKLOG-422186 :: Nyaa :: [c5a1e37] Quality of [SubsPlease].Isekai.de.Mofumofu.Nadenade.suru.Tame.ni.Ganbattemasu.-.01.(1080p).[21CF569D].mkv is 1080p HDTV
2024-01-05 14:33:17 INFO    FORCEDSEARCHQUEUE-BACKLOG-422186 :: Nyaa :: [c5a1e37] Quality of [SubsPlease].Isekai.de.Mofumofu.Nadenade.suru.Tame.ni.Ganbattemasu.-.01.(480p).[77F406F9].mkv is SDTV
2024-01-05 14:33:17 INFO    FORCEDSEARCHQUEUE-BACKLOG-422186 :: Nyaa :: [c5a1e37] Quality of [SubsPlease].Isekai.de.Mofumofu.Nadenade.suru.Tame.ni.Ganbattemasu.-.01.(720p).[FC5A71B6].mkv is 720p HDTV
2024-01-05 14:33:17 INFO    FORCEDSEARCHQUEUE-BACKLOG-422186 :: Nyaa :: [c5a1e37] Quality of [SubsPlease].Isekai.de.Mofumofu.Nadenade.suru.Tame.ni.Ganbattemasu.-.01.(1080p).[21CF569D].mkv is 1080p HDTV
2024-01-05 14:33:17 INFO    FORCEDSEARCHQUEUE-BACKLOG-422186 :: Nyaa :: [c5a1e37] Performing episode search for Fluffy Paradise
2024-01-05 14:33:17 INFO    FORCEDSEARCHQUEUE-BACKLOG-422186 :: [c5a1e37] Using backlog search providers
2024-01-05 14:33:17 INFO    FORCEDSEARCHQUEUE-BACKLOG-422186 :: [c5a1e37] Building internal name cache for Fluffy Paradise
2024-01-05 14:33:17 INFO    FORCEDSEARCHQUEUE-BACKLOG-422186 :: [c5a1e37] Finished processing 4419 scene exceptions.
2024-01-05 14:33:17 INFO    FORCEDSEARCHQUEUE-BACKLOG-422186 :: [c5a1e37] Updating exception_cache and exception_season_cache
2024-01-05 14:33:17 INFO    FORCEDSEARCHQUEUE-BACKLOG-422186 :: [c5a1e37] Beginning backlog search for: Fluffy Paradise
2024-01-05 14:33:15 WARNING APIv2-Thread :: [c5a1e37] Refusing to change status of Fluffy Paradise s01e01 because it is UNAIRED
2024-01-05 14:31:41 INFO    FORCEDSEARCHQUEUE-BACKLOG-422186 :: [c5a1e37] No needed episodes found during backlog search for: Fluffy Paradise
  1. (optional) go to indexer website and change dates to not need to use airdate_offset
  2. (optional) have site admins revert your change (TVDB/TMDB/TVMAZE), as they don't consider streaming services airing things early to be part of scope of their platform. (see image below for context)

image

Expected behavior for it to snatch episodes, despite being labelled as UNAIRED, because airdate_offset override has been set.

Medusa (please complete the following information):

Additional context a conditional to check for if airdate_offset might be needed to make airdate_offset function as desired, appended to the UNAIRED checks.

it should be noted that it sometimes solves itself if the EPISODEUPDATER thread has been ran.

2024-01-05 15:15:32 INFO EPISODEUPDATER :: [c5a1e37] Setting status (Wanted) for show airing today: Fluffy Paradise - 001 - Nobody Told Me This Would Happen!

borntohonk commented 9 months ago

Should be a feature request instead