1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-24 08:43:01 +00:00

Add more progress notifications

This commit is contained in:
Halali 2019-04-10 22:05:33 +02:00
parent d49a04ce15
commit 2c97d0ba72
2 changed files with 11 additions and 5 deletions

View file

@ -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)

View file

@ -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()