diff options
author | morpheus65535 <[email protected]> | 2024-12-06 21:35:31 -0500 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2024-12-06 21:35:31 -0500 |
commit | 2f79c9cd26e4b9aded0320c0a66657a9f7139e43 (patch) | |
tree | db6d39509b3860c92d268aac1731ea108aa429cb | |
parent | 1358480bd307d40a8add72c45790fa3aa1b740b0 (diff) | |
download | bazarr-2f79c9cd26e4b9aded0320c0a66657a9f7139e43.tar.gz bazarr-2f79c9cd26e4b9aded0320c0a66657a9f7139e43.zip |
Fixed hide_progress improper usagessubsync_notifications
-rw-r--r-- | bazarr/radarr/sync/movies.py | 6 | ||||
-rw-r--r-- | bazarr/sonarr/sync/series.py | 6 | ||||
-rw-r--r-- | bazarr/subtitles/indexer/movies.py | 6 | ||||
-rw-r--r-- | bazarr/subtitles/indexer/series.py | 6 | ||||
-rw-r--r-- | bazarr/subtitles/mass_download/movies.py | 6 | ||||
-rw-r--r-- | bazarr/subtitles/mass_download/series.py | 12 | ||||
-rw-r--r-- | bazarr/subtitles/sync.py | 14 | ||||
-rw-r--r-- | bazarr/subtitles/tools/translate.py | 6 | ||||
-rw-r--r-- | bazarr/subtitles/upgrade.py | 12 | ||||
-rw-r--r-- | bazarr/subtitles/wanted/movies.py | 6 | ||||
-rw-r--r-- | bazarr/subtitles/wanted/series.py | 6 |
11 files changed, 68 insertions, 18 deletions
diff --git a/bazarr/radarr/sync/movies.py b/bazarr/radarr/sync/movies.py index 4114ba2c9..c4cb5ab96 100644 --- a/bazarr/radarr/sync/movies.py +++ b/bazarr/radarr/sync/movies.py @@ -206,7 +206,11 @@ def update_movies(send_event=True): files_missing += 1 if send_event: - hide_progress(id='movies_progress') + show_progress(id='movies_progress', + header='Syncing movies...', + name='', + value=movies_count, + count=movies_count) trace(f"Skipped {files_missing} file missing movies out of {movies_count}") if sync_monitored: diff --git a/bazarr/sonarr/sync/series.py b/bazarr/sonarr/sync/series.py index e6eec6c22..065fdaa21 100644 --- a/bazarr/sonarr/sync/series.py +++ b/bazarr/sonarr/sync/series.py @@ -178,7 +178,11 @@ def update_series(send_event=True): event_stream(type='series', action='delete', payload=series) if send_event: - hide_progress(id='series_progress') + show_progress(id='series_progress', + header='Syncing series...', + name='', + value=series_count, + count=series_count) if sync_monitored: trace(f"skipped {skipped_count} unmonitored series out of {i}") diff --git a/bazarr/subtitles/indexer/movies.py b/bazarr/subtitles/indexer/movies.py index 563a68cff..6502a4354 100644 --- a/bazarr/subtitles/indexer/movies.py +++ b/bazarr/subtitles/indexer/movies.py @@ -292,7 +292,11 @@ def movies_full_scan_subtitles(use_cache=None): count=count_movies) store_subtitles_movie(movie.path, path_mappings.path_replace_movie(movie.path), use_cache=use_cache) - hide_progress(id='movies_disk_scan') + show_progress(id='movies_disk_scan', + header='Full disk scan...', + name='Movies subtitles', + value=count_movies, + count=count_movies) gc.collect() diff --git a/bazarr/subtitles/indexer/series.py b/bazarr/subtitles/indexer/series.py index 64af2e4c3..1d1d98ef8 100644 --- a/bazarr/subtitles/indexer/series.py +++ b/bazarr/subtitles/indexer/series.py @@ -294,7 +294,11 @@ def series_full_scan_subtitles(use_cache=None): count=count_episodes) store_subtitles(episode.path, path_mappings.path_replace(episode.path), use_cache=use_cache) - hide_progress(id='episodes_disk_scan') + show_progress(id='episodes_disk_scan', + header='Full disk scan...', + name='Episodes subtitles', + value=count_episodes, + count=count_episodes) gc.collect() diff --git a/bazarr/subtitles/mass_download/movies.py b/bazarr/subtitles/mass_download/movies.py index 5ca94a81f..da3d7538d 100644 --- a/bazarr/subtitles/mass_download/movies.py +++ b/bazarr/subtitles/mass_download/movies.py @@ -99,4 +99,8 @@ def movies_download_subtitles(no): history_log_movie(1, no, result) send_notifications_movie(no, result.message) - hide_progress(id=f'movie_search_progress_{no}') + show_progress(id=f'movie_search_progress_{no}', + header='Searching missing subtitles...', + name=movie.title, + value=count_movie, + count=count_movie) diff --git a/bazarr/subtitles/mass_download/series.py b/bazarr/subtitles/mass_download/series.py index 54f651620..64672cd8f 100644 --- a/bazarr/subtitles/mass_download/series.py +++ b/bazarr/subtitles/mass_download/series.py @@ -64,7 +64,11 @@ def series_download_subtitles(no): logging.info("BAZARR All providers are throttled") break - hide_progress(id=f'series_search_progress_{no}') + show_progress(id=f'series_search_progress_{no}', + header='Searching missing subtitles...', + name='', + value=count_episodes_details, + count=count_episodes_details) def episode_download_subtitles(no, send_progress=False, providers_list=None): @@ -145,6 +149,10 @@ def episode_download_subtitles(no, send_progress=False, providers_list=None): send_notifications(episode.sonarrSeriesId, episode.sonarrEpisodeId, result.message) if send_progress: - hide_progress(id=f'episode_search_progress_{no}') + show_progress(id=f'episode_search_progress_{no}', + header='Searching missing subtitles...', + name=f'{episode.title} - S{episode.season:02d}E{episode.episode:02d} - {episode.episodeTitle}', + value=1, + count=1) else: logging.info("BAZARR All providers are throttled") diff --git a/bazarr/subtitles/sync.py b/bazarr/subtitles/sync.py index 6df633dd0..d2ac761f5 100644 --- a/bazarr/subtitles/sync.py +++ b/bazarr/subtitles/sync.py @@ -43,14 +43,16 @@ def sync_subtitles(video_path, srt_path, srt_lang, forced, hi, percent_score, so 'radarr_id': radarr_id, } subtitles_filename = os.path.basename(srt_path) + show_progress(id=f'subsync_{subtitles_filename}', + header='Syncing Subtitle', + name=srt_path, + value=0, + count=1) try: - show_progress(id=f'subsync_{subtitles_filename}', - header='Syncing Subtitle', - name=srt_path, - value=0, - count=1) subsync.sync(**sync_kwargs) - finally: + except Exception: + hide_progress(id=f'subsync_{subtitles_filename}') + else: show_progress(id=f'subsync_{subtitles_filename}', header='Syncing Subtitle', name=srt_path, diff --git a/bazarr/subtitles/tools/translate.py b/bazarr/subtitles/tools/translate.py index 1998cb504..0bb4c2830 100644 --- a/bazarr/subtitles/tools/translate.py +++ b/bazarr/subtitles/tools/translate.py @@ -94,7 +94,11 @@ def translate_subtitles_file(video_path, source_srt_file, from_lang, to_lang, fo for i, line in enumerate(translated_lines): lines_list[line['id']] = line['line'] - hide_progress(id=f'translate_progress_{dest_srt_file}') + show_progress(id=f'translate_progress_{dest_srt_file}', + header=f'Translating subtitles lines to {language_from_alpha3(to_lang)}...', + name='', + value=lines_list_len, + count=lines_list_len) logging.debug(f'BAZARR saving translated subtitles to {dest_srt_file}') for i, line in enumerate(subs): diff --git a/bazarr/subtitles/upgrade.py b/bazarr/subtitles/upgrade.py index 97196239a..46f00fb57 100644 --- a/bazarr/subtitles/upgrade.py +++ b/bazarr/subtitles/upgrade.py @@ -133,7 +133,11 @@ def upgrade_subtitles(): upgraded_from_id=episode['original_id']) send_notifications(episode['sonarrSeriesId'], episode['sonarrEpisodeId'], result.message) - hide_progress(id='upgrade_episodes_progress') + show_progress(id='upgrade_episodes_progress', + header='Upgrading episodes subtitles...', + name='', + value=count_episode_to_upgrade, + count=count_episode_to_upgrade) if use_radarr: movies_to_upgrade = get_upgradable_movies_subtitles() @@ -231,7 +235,11 @@ def upgrade_subtitles(): history_log_movie(3, movie['radarrId'], result, upgraded_from_id=movie['original_id']) send_notifications_movie(movie['radarrId'], result.message) - hide_progress(id='upgrade_movies_progress') + show_progress(id='upgrade_movies_progress', + header='Upgrading movies subtitles...', + name='', + value=count_movie_to_upgrade, + count=count_movie_to_upgrade) logging.info('BAZARR Finished searching for Subtitles to upgrade. Check History for more information.') diff --git a/bazarr/subtitles/wanted/movies.py b/bazarr/subtitles/wanted/movies.py index b47fe8afb..a6892b79a 100644 --- a/bazarr/subtitles/wanted/movies.py +++ b/bazarr/subtitles/wanted/movies.py @@ -122,6 +122,10 @@ def wanted_search_missing_subtitles_movies(): logging.info("BAZARR All providers are throttled") break - hide_progress(id='wanted_movies_progress') + show_progress(id='wanted_movies_progress', + header='Searching subtitles...', + name="", + value=count_movies, + count=count_movies) logging.info('BAZARR Finished searching for missing Movies Subtitles. Check History for more information.') diff --git a/bazarr/subtitles/wanted/series.py b/bazarr/subtitles/wanted/series.py index 5a1e9f55b..7b57cbea9 100644 --- a/bazarr/subtitles/wanted/series.py +++ b/bazarr/subtitles/wanted/series.py @@ -134,6 +134,10 @@ def wanted_search_missing_subtitles_series(): logging.info("BAZARR All providers are throttled") break - hide_progress(id='wanted_episodes_progress') + show_progress(id='wanted_episodes_progress', + header='Searching subtitles...', + name='', + value=count_episodes, + count=count_episodes) logging.info('BAZARR Finished searching for missing Series Subtitles. Check History for more information.') |