Fixed subtitles upgrade process to properly deal with manual actions

pull/1383/head
morpheus65535 4 years ago
parent daaea61ea3
commit 99fc282b07

@ -1224,7 +1224,7 @@ def upgrade_subtitles():
datetime(1970, 1, 1)).total_seconds() datetime(1970, 1, 1)).total_seconds()
if settings.general.getboolean('upgrade_manual'): if settings.general.getboolean('upgrade_manual'):
query_actions = [1, 2, 3, 6] query_actions = [1, 2, 3, 4, 6]
else: else:
query_actions = [1, 3] query_actions = [1, 3]
@ -1232,7 +1232,7 @@ def upgrade_subtitles():
upgradable_episodes = database.execute("SELECT table_history.video_path, table_history.language, " upgradable_episodes = database.execute("SELECT table_history.video_path, table_history.language, "
"table_history.score, table_shows.tags, table_shows.profileId, " "table_history.score, table_shows.tags, table_shows.profileId, "
"table_episodes.audio_language, table_episodes.scene_name, " "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, " "table_history.subtitles_path, table_episodes.sonarrEpisodeId, "
"MAX(table_history.timestamp) as timestamp, table_episodes.monitored, " "MAX(table_history.timestamp) as timestamp, table_episodes.monitored, "
"table_shows.seriesType FROM table_history INNER JOIN table_shows on " "table_shows.seriesType FROM table_history INNER JOIN table_shows on "
@ -1251,7 +1251,8 @@ def upgrade_subtitles():
except ValueError: except ValueError:
pass pass
else: 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) upgradable_episodes_not_perfect.append(upgradable_episode)
episodes_to_upgrade = [] episodes_to_upgrade = []
@ -1263,7 +1264,7 @@ def upgrade_subtitles():
if settings.general.getboolean('use_radarr'): if settings.general.getboolean('use_radarr'):
upgradable_movies = database.execute("SELECT table_history_movie.video_path, table_history_movie.language, " 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_history_movie.subtitles_path, table_movies.audio_language, "
"table_movies.sceneName, table_movies.title, table_movies.radarrId, " "table_movies.sceneName, table_movies.title, table_movies.radarrId, "
"MAX(table_history_movie.timestamp) as timestamp, table_movies.tags, " "MAX(table_history_movie.timestamp) as timestamp, table_movies.tags, "
@ -1281,7 +1282,8 @@ def upgrade_subtitles():
except ValueError: except ValueError:
pass pass
else: 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) upgradable_movies_not_perfect.append(upgradable_movie)
movies_to_upgrade = [] movies_to_upgrade = []

Loading…
Cancel
Save