From 2c97d0ba72a34da34be89deb215e774172df97f4 Mon Sep 17 00:00:00 2001 From: Halali Date: Wed, 10 Apr 2019 22:05:33 +0200 Subject: [PATCH] Add more progress notifications --- bazarr/get_subtitle.py | 2 +- bazarr/list_subtitles.py | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/bazarr/get_subtitle.py b/bazarr/get_subtitle.py index 315810702..e478905db 100644 --- a/bazarr/get_subtitle.py +++ b/bazarr/get_subtitle.py @@ -793,7 +793,7 @@ def upgrade_subtitles(): for i, movie in enumerate(movies_to_upgrade, 1): if movie[1] in ast.literal_eval(str(movie[8])): notifications.write(msg='Upgrading movie subtitles : ' + str(i) + '/' + str(count_movie_to_upgrade), - queue='get_subtitle', duration='long', item=i, length=count_movie_to_upgrad) + queue='get_subtitle', duration='long', item=i, length=count_movie_to_upgrade) result = download_subtitle(path_replace_movie(movie[0]), str(alpha3_from_alpha2(movie[1])), movie[3], providers_list, providers_auth, str(movie[4]), movie[5], 'movie', forced_minimum_score=int(movie[2]), is_upgrade=True) diff --git a/bazarr/list_subtitles.py b/bazarr/list_subtitles.py index a70607069..919c7f7a5 100644 --- a/bazarr/list_subtitles.py +++ b/bazarr/list_subtitles.py @@ -30,7 +30,7 @@ def store_subtitles(file): logging.debug('BAZARR started subtitles indexing for this file: ' + file) actual_subtitles = [] if os.path.exists(file): - notifications.write(msg='Analyzing this file for subtitles: ' + file, queue='list_subtitles') + # notifications.write(msg='Analyzing this file for subtitles: ' + file, queue='list_subtitles') if settings.general.getboolean('use_embedded_subs'): if os.path.splitext(file)[1] == '.mkv': logging.debug("BAZARR is trying to index embedded subtitles.") @@ -116,7 +116,7 @@ def store_subtitles_movie(file): logging.debug('BAZARR started subtitles indexing for this file: ' + file) actual_subtitles = [] if os.path.exists(file): - notifications.write(msg='Analyzing this file for subtitles: ' + file, queue='list_subtitles') + # notifications.write(msg='Analyzing this file for subtitles: ' + file, queue='list_subtitles') if settings.general.getboolean('use_embedded_subs'): if os.path.splitext(file)[1] == '.mkv': logging.debug("BAZARR is trying to index embedded subtitles.") @@ -298,8 +298,11 @@ def series_full_scan_subtitles(): c_db = conn_db.cursor() episodes = c_db.execute("SELECT path FROM table_episodes").fetchall() c_db.close() + count_episodes = len(episodes) - for episode in episodes: + for i, episode in enumerate(episodes, 1): + notifications.write(msg='Updating all episodes subtitles from disk : ' + str(i) + '/' + str(count_episodes), + queue='list_subtitles_episodes', duration='long', item=i, length=count_episodes) store_subtitles(path_replace(episode[0])) gc.collect() @@ -310,8 +313,11 @@ def movies_full_scan_subtitles(): c_db = conn_db.cursor() movies = c_db.execute("SELECT path FROM table_movies").fetchall() c_db.close() + count_movies = len(movies) - for movie in movies: + for i, movie in enumerate(movies, 1): + notifications.write(msg='Updating all movies subtitles from disk : ' + str(i) + '/' + str(count_movies), + queue='list_subtitles_movies', duration='long', item=i, length=count_movies) store_subtitles_movie(path_replace_movie(movie[0])) gc.collect()