From f53efa0f1f8aa504f18d86fbd847bed59be92ae2 Mon Sep 17 00:00:00 2001 From: Dario Date: Wed, 20 Mar 2024 12:35:30 +0100 Subject: [PATCH] Try to use TVDB ID for BTN search even if a different indexer is used (#11664) * Try to use TVDB ID for BTN search even if a different indexer is used * lint --- medusa/providers/torrent/json/btn.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/medusa/providers/torrent/json/btn.py b/medusa/providers/torrent/json/btn.py index 2774f0848c..8dc9921b39 100644 --- a/medusa/providers/torrent/json/btn.py +++ b/medusa/providers/torrent/json/btn.py @@ -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 @@ -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: