From 99fc282b07f4be07ebf84255603385bd6899bcf8 Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Wed, 14 Apr 2021 10:24:58 -0400 Subject: [PATCH] Fixed subtitles upgrade process to properly deal with manual actions --- bazarr/get_subtitle.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bazarr/get_subtitle.py b/bazarr/get_subtitle.py index ac90d6568..0557a98ee 100644 --- a/bazarr/get_subtitle.py +++ b/bazarr/get_subtitle.py @@ -1224,7 +1224,7 @@ def upgrade_subtitles(): datetime(1970, 1, 1)).total_seconds() if settings.general.getboolean('upgrade_manual'): - query_actions = [1, 2, 3, 6] + query_actions = [1, 2, 3, 4, 6] else: query_actions = [1, 3] @@ -1232,7 +1232,7 @@ def upgrade_subtitles(): upgradable_episodes = database.execute("SELECT table_history.video_path, table_history.language, " "table_history.score, table_shows.tags, table_shows.profileId, " "table_episodes.audio_language, table_episodes.scene_name, " - "table_episodes.title, table_episodes.sonarrSeriesId, " + "table_episodes.title, table_episodes.sonarrSeriesId, table_history.action, " "table_history.subtitles_path, table_episodes.sonarrEpisodeId, " "MAX(table_history.timestamp) as timestamp, table_episodes.monitored, " "table_shows.seriesType FROM table_history INNER JOIN table_shows on " @@ -1251,7 +1251,8 @@ def upgrade_subtitles(): except ValueError: pass else: - if int(upgradable_episode['score']) < 360: + if int(upgradable_episode['score']) < 360 or (settings.general.getboolean('upgrade_manual') and + upgradable_episode['action'] in [2, 4, 6]): upgradable_episodes_not_perfect.append(upgradable_episode) episodes_to_upgrade = [] @@ -1263,7 +1264,7 @@ def upgrade_subtitles(): if settings.general.getboolean('use_radarr'): upgradable_movies = database.execute("SELECT table_history_movie.video_path, table_history_movie.language, " - "table_history_movie.score, table_movies.profileId, " + "table_history_movie.score, table_movies.profileId, table_history_movie.action, " "table_history_movie.subtitles_path, table_movies.audio_language, " "table_movies.sceneName, table_movies.title, table_movies.radarrId, " "MAX(table_history_movie.timestamp) as timestamp, table_movies.tags, " @@ -1281,7 +1282,8 @@ def upgrade_subtitles(): except ValueError: pass else: - if int(upgradable_movie['score']) < 120: + if int(upgradable_movie['score']) < 120 or (settings.general.getboolean('upgrade_manual') and + upgradable_movie['action'] in [2, 4, 6]): upgradable_movies_not_perfect.append(upgradable_movie) movies_to_upgrade = []