From 73f686b3bf83ac2f1570bca0754a3c80f60cdf65 Mon Sep 17 00:00:00 2001 From: Dario Date: Wed, 20 Mar 2024 12:25:54 +0100 Subject: [PATCH 1/2] Try to use TVDB ID for BTN search even if a different indexer is used --- medusa/providers/torrent/json/btn.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/medusa/providers/torrent/json/btn.py b/medusa/providers/torrent/json/btn.py index 2774f0848c..9a35490b31 100644 --- a/medusa/providers/torrent/json/btn.py +++ b/medusa/providers/torrent/json/btn.py @@ -236,16 +236,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: From 9cb3778be2ab353328f3a7b33dd013d691bb6f2d Mon Sep 17 00:00:00 2001 From: Dario Date: Wed, 20 Mar 2024 12:31:07 +0100 Subject: [PATCH 2/2] lint --- medusa/providers/torrent/json/btn.py | 1 - 1 file changed, 1 deletion(-) diff --git a/medusa/providers/torrent/json/btn.py b/medusa/providers/torrent/json/btn.py index 9a35490b31..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