Fixed subtitles search happening for series/seasons when a SignalR event is received from Sonarr even if defer subtitles searching was enabled. #3023

This commit is contained in:
morpheus65535
2025-09-16 07:59:03 -04:00
parent e085574d12
commit a2121c1a0b
2 changed files with 4 additions and 3 deletions

View File

@@ -298,7 +298,8 @@ def dispatcher(data):
'sonarr.sync.series', 'sonarr.sync.series',
'update_one_series', 'update_one_series',
[], [],
{'series_id': media_id, 'action': action}) {'series_id': media_id, 'action': action,
'defer_search': settings.sonarr.defer_search_signalr})
if episodesChanged: if episodesChanged:
# this will happen if a season's monitored status is changed. # this will happen if a season's monitored status is changed.
jobs_queue.feed_jobs_pending_queue(f'Sync episodes for series {series_title} ({series_year})', jobs_queue.feed_jobs_pending_queue(f'Sync episodes for series {series_title} ({series_year})',

View File

@@ -189,7 +189,7 @@ def update_series(send_event=True):
logging.debug('BAZARR All series synced from Sonarr into database.') logging.debug('BAZARR All series synced from Sonarr into database.')
def update_one_series(series_id, action): def update_one_series(series_id, action, defer_search=False):
logging.debug(f'BAZARR syncing this specific series from Sonarr: {series_id}') logging.debug(f'BAZARR syncing this specific series from Sonarr: {series_id}')
# Check if there's a row in database for this series ID # Check if there's a row in database for this series ID
@@ -253,7 +253,7 @@ def update_one_series(series_id, action):
except IntegrityError as e: except IntegrityError as e:
logging.error(f"BAZARR cannot update series {series['path']} because of {e}") logging.error(f"BAZARR cannot update series {series['path']} because of {e}")
else: else:
sync_episodes(series_id=int(series_id), send_event=False) sync_episodes(series_id=int(series_id), send_event=False, defer_search=defer_search)
event_stream(type='series', action='update', payload=int(series_id)) event_stream(type='series', action='update', payload=int(series_id))
logging.debug(f'BAZARR updated this series into the database:{path_mappings.path_replace(series["path"])}') logging.debug(f'BAZARR updated this series into the database:{path_mappings.path_replace(series["path"])}')