Improved events sent to browser.

This commit is contained in:
morpheus65535 2021-06-16 19:14:21 -04:00
parent ee41b78f4e
commit b9c27d53ad
4 changed files with 17 additions and 15 deletions

View File

@ -959,7 +959,7 @@ class Movies(Resource):
.where(TableMovies.radarrId == radarrId)\
.execute()
list_missing_subtitles_movies(no=radarrId)
list_missing_subtitles_movies(no=radarrId, send_event=False)
event_stream(type='movies', payload=radarrId)
event_stream(type='badges')

View File

@ -193,7 +193,7 @@ def update_one_series(series_id, action):
# Update existing series in DB
if action == 'updated' and existing_series:
TableShows.update(series).where(TableShows.sonarrSeriesId == series['sonarrSeriesId']).execute()
sync_episodes(series_id=int(series_id), send_event=False)
sync_episodes(series_id=int(series_id), send_event=True)
event_stream(type='series', action='update', payload=int(series_id))
logging.debug('BAZARR updated this series into the database:{}'.format(path_mappings.path_replace(
series['path'])))

View File

@ -796,11 +796,12 @@ def series_download_subtitles(no):
logging.info("BAZARR All providers are throttled")
break
show_progress(id='series_search_progress_{}'.format(no),
header='Searching missing subtitles...',
name='Completed successfully',
value=count_episodes_details,
count=count_episodes_details)
if count_episodes_details:
show_progress(id='series_search_progress_{}'.format(no),
header='Searching missing subtitles...',
name='Completed successfully',
value=count_episodes_details,
count=count_episodes_details)
hide_progress(id='series_search_progress_{}'.format(no))
@ -960,11 +961,12 @@ def movies_download_subtitles(no):
logging.info("BAZARR All providers are throttled")
break
show_progress(id='movie_search_progress_{}'.format(no),
header='Searching missing subtitles...',
name='Completed successfully',
value=count_movie,
count=count_movie)
if count_movie:
show_progress(id='movie_search_progress_{}'.format(no),
header='Searching missing subtitles...',
name='Completed successfully',
value=count_movie,
count=count_movie)
hide_progress(id='movie_search_progress_{}'.format(no))

View File

@ -51,8 +51,8 @@ class SonarrSignalrClient:
self.stop()
logging.info('BAZARR SignalR client for Sonarr is connected and waiting for events.')
if not args.dev:
scheduler.add_job(update_series, kwargs={'send_event': False}, max_instances=1)
scheduler.add_job(sync_episodes, kwargs={'send_event': False}, max_instances=1)
scheduler.add_job(update_series, kwargs={'send_event': True}, max_instances=1)
scheduler.add_job(sync_episodes, kwargs={'send_event': True}, max_instances=1)
def stop(self, log=True):
try:
@ -123,7 +123,7 @@ class RadarrSignalrClient:
def on_connect_handler():
logging.info('BAZARR SignalR client for Radarr is connected and waiting for events.')
if not args.dev:
scheduler.add_job(update_movies, kwargs={'send_event': False}, max_instances=1)
scheduler.add_job(update_movies, kwargs={'send_event': True}, max_instances=1)
def configure(self):
self.apikey_radarr = settings.radarr.apikey