mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-02-24 23:07:36 +08:00
Some DB fixes.
This commit is contained in:
parent
24fc1473df
commit
c933481d9a
4 changed files with 7 additions and 6 deletions
|
@ -996,7 +996,8 @@ def upgrade_subtitles():
|
|||
"table_history.score, table_shows.hearing_impaired, "
|
||||
"table_episodes.scene_name, table_episodes.title,"
|
||||
"table_episodes.sonarrSeriesId, table_episodes.sonarrEpisodeId,"
|
||||
"MAX(table_history.timestamp), table_shows.languages, table_shows.forced "
|
||||
"MAX(table_history.timestamp) as timestamp, "
|
||||
"table_shows.languages, table_shows.forced "
|
||||
"FROM table_history INNER JOIN table_shows on "
|
||||
"table_shows.sonarrSeriesId = table_history.sonarrSeriesId INNER JOIN "
|
||||
"table_episodes on table_episodes.sonarrEpisodeId = "
|
||||
|
@ -1028,7 +1029,7 @@ def upgrade_subtitles():
|
|||
upgradable_movies = database.execute("SELECT table_history_movie.video_path, table_history_movie.language, "
|
||||
"table_history_movie.score, table_movies.hearing_impaired, "
|
||||
"table_movies.sceneName, table_movies.title, table_movies.radarrId, "
|
||||
"MAX(table_history_movie.timestamp), table_movies.languages, "
|
||||
"MAX(table_history_movie.timestamp) as timestamp, table_movies.languages, "
|
||||
"table_movies.forced FROM table_history_movie INNER JOIN "
|
||||
"table_movies on table_movies.radarrId = table_history_movie.radarrId "
|
||||
"WHERE action IN (" + ','.join(map(str, query_actions)) +
|
||||
|
|
|
@ -110,7 +110,7 @@ def store_subtitles(file):
|
|||
episode = database.execute("SELECT sonarrEpisodeId FROM table_episodes WHERE path=?",
|
||||
(path_replace_reverse(file),), only_one=True)
|
||||
|
||||
if len(episode):
|
||||
if episode:
|
||||
logging.debug("BAZARR storing those languages to DB: " + str(actual_subtitles))
|
||||
list_missing_subtitles(epno=episode['sonarrEpisodeId'])
|
||||
else:
|
||||
|
@ -208,7 +208,7 @@ def store_subtitles_movie(file):
|
|||
movie = database.execute("SELECT radarrId FROM table_movies WHERE path=?",
|
||||
(path_replace_reverse_movie(file),), only_one=True)
|
||||
|
||||
if len(movie):
|
||||
if movie:
|
||||
logging.debug("BAZARR storing those languages to DB: " + str(actual_subtitles))
|
||||
list_missing_subtitles_movies(no=movie['radarrId'])
|
||||
else:
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
</div>
|
||||
</td>
|
||||
<td>
|
||||
% upgradable_criteria = (row['timestamp'], row['video_path'], row['score'])
|
||||
% upgradable_criteria = dict([('timestamp', row['timestamp']), ('video_path', row['video_path']), ('score', row['score'])])
|
||||
% if upgradable_criteria in upgradable_movies:
|
||||
% if row['languages'] != "None":
|
||||
% desired_languages = ast.literal_eval(str(row['languages']))
|
||||
|
|
|
@ -104,7 +104,7 @@
|
|||
</div>
|
||||
</td>
|
||||
<td>
|
||||
% upgradable_criteria = (row['timestamp'], row['path'], row['score'])
|
||||
% upgradable_criteria = dict([('timestamp', row['timestamp']), ('video_path', row['path']), ('score', row['score'])])
|
||||
% if upgradable_criteria in upgradable_episodes:
|
||||
% if row['languages'] != "None":
|
||||
% desired_languages = ast.literal_eval(str(row['languages']))
|
||||
|
|
Loading…
Reference in a new issue