Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to use TVDB ID for BTN search even if a different indexer is used #11664

Merged
merged 3 commits into from
Mar 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions medusa/providers/torrent/json/btn.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
)
from medusa.common import cpu_presets
from medusa.helper.common import convert_size, episode_num
from medusa.indexers.config import INDEXER_TVDBV2
from medusa.logger.adapters.style import BraceAdapter
from medusa.providers.torrent.torrent_provider import TorrentProvider

Expand Down Expand Up @@ -236,16 +235,19 @@ def _search_params(self, ep_obj, mode, season_numbering=None):
}

# Search
if ep_obj.series.indexer == INDEXER_TVDBV2:
params['tvdb'] = self._get_tvdb_id()
tvdb_id = self._get_tvdb_id()
if tvdb_id is not None:
params['tvdb'] = tvdb_id
searches.append(params)
else:
# Search by name if we don't have tvdb id
params['series'] = ep_obj.series.name
searches.append(params.copy())
# Add scene name exceptions
name_exceptions = scene_exceptions.get_scene_exceptions(ep_obj.series)
name_exceptions.add(ep_obj.series.name)
for name in name_exceptions:
# Search by name if we don't have tvdb id
params['series'] = name
searches.append(params)
for exception in name_exceptions:
params['series'] = exception.title
searches.append(params.copy())

# extend air by date searches to include season numbering
if air_by_date and not season_numbering:
Expand Down
Loading