fix: season pack torrents not recognized as cached on debrid services#600
Open
mainlink0435 wants to merge 1 commit into
Open
fix: season pack torrents not recognized as cached on debrid services#600mainlink0435 wants to merge 1 commit into
mainlink0435 wants to merge 1 commit into
Conversation
When searching for a season pack (episode=None), the debrid cache check filtered entries by episode_norm=-1, but season pack torrents' cached files have episode_norm=1,2,3... (individual episode files). This meant no cached entries were found for season packs, and with cachedOnly=true, no results appeared. Fixes: - debrid_cache: skip episode_norm filter in cache queries when episode=None, so individual-episode cached files match the season-level search - debrid: skip episode filter in live availability check when episode=None, so individual episode files within a season pack torrent pass through and the torrent is recognized as cached - debrid: guard metadata overwrites (fileIndex, title, size, parsed) behind 'if episode is not None' — prevents cached individual-episode file data from overwriting the season pack torrent's metadata, which confused downstream consumers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #599
When searching for a season pack (episode=None), the debrid cache check filtered entries by episode_norm=-1, but season pack torrents' cached files have episode_norm=1,2,3... (individual episode files). This meant no cached entries were found for season packs, and with cachedOnly=true, no results appeared.
Changes
debrid_cache.py
get_cached_availability: conditionally includeepisode_normin SQL and params only whenepisode is not None. For season pack searches (episode=None), the query no longer filters byepisode_norm, allowing individual-episode cached files to match the season-level scope.get_cached_availability_any_service: same fix applied for consistency.debrid.py
get_and_cache_availability: split the OR filter into two separate checks. The episode check now guards behindif episode is not None- when searching by season, individual episode files within a season pack torrent pass through and the torrent is marked as cached.get_and_cache_availability: wrap metadata overwrites (parsed, fileIndex, title, size) behindif episode is not None- prevents cached individual-episode data from contaminating the season pack's original metadata.check_existing_availability: same metadata guard applied to the cached-check path.