From 6000a8889d96364eddda87035e83e6c79c65a035 Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Fri, 4 Aug 2023 10:18:48 -0400 Subject: [PATCH] Fixed history views when upgrade subtitles is disabled. #2210 --- bazarr/subtitles/upgrade.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bazarr/subtitles/upgrade.py b/bazarr/subtitles/upgrade.py index 7f6fe9caa..859d0ce36 100644 --- a/bazarr/subtitles/upgrade.py +++ b/bazarr/subtitles/upgrade.py @@ -239,7 +239,10 @@ def parse_language_string(language_string): def get_upgradable_episode_subtitles(): if not settings.general.getboolean('upgrade_subs'): - return [] + # return an empty set of rows + return select(TableHistory.id) \ + .where(TableHistory.id.is_(None)) \ + .subquery() max_id_timestamp = select(TableHistory.video_path, TableHistory.language, @@ -269,7 +272,10 @@ def get_upgradable_episode_subtitles(): def get_upgradable_movies_subtitles(): if not settings.general.getboolean('upgrade_subs'): - return [] + # return an empty set of rows + return select(TableHistoryMovie.id) \ + .where(TableHistoryMovie.id.is_(None)) \ + .subquery() max_id_timestamp = select(TableHistoryMovie.video_path, TableHistoryMovie.language,