Skip to content

fix: season pack torrents not recognized as cached on debrid services#600

Open
mainlink0435 wants to merge 1 commit into
g0ldyy:mainfrom
mainlink0435:fix/season-pack-cached-debrid-availability
Open

fix: season pack torrents not recognized as cached on debrid services#600
mainlink0435 wants to merge 1 commit into
g0ldyy:mainfrom
mainlink0435:fix/season-pack-cached-debrid-availability

Conversation

@mainlink0435

@mainlink0435 mainlink0435 commented Jul 1, 2026

Copy link
Copy Markdown

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 include episode_norm in SQL and params only when episode is not None. For season pack searches (episode=None), the query no longer filters by episode_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 behind if 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) behind if 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.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Season pack torrents not recognized as cached with cachedOnly=true

1 participant