mirror of
https://github.com/morpheus65535/bazarr
synced 2025-02-06 22:42:10 +00:00
Fix for multiple episode where only the first one was being updated with existing subtitles.
This commit is contained in:
parent
4df312438a
commit
2e7a78cde6
1 changed files with 15 additions and 13 deletions
|
@ -90,14 +90,15 @@ def store_subtitles(original_path, reversed_path):
|
||||||
|
|
||||||
database.execute("UPDATE table_episodes SET subtitles=? WHERE path=?",
|
database.execute("UPDATE table_episodes SET subtitles=? WHERE path=?",
|
||||||
(str(actual_subtitles), original_path))
|
(str(actual_subtitles), original_path))
|
||||||
episode = database.execute("SELECT sonarrEpisodeId FROM table_episodes WHERE path=?",
|
matching_episodes = database.execute("SELECT sonarrEpisodeId FROM table_episodes WHERE path=?",
|
||||||
(original_path,), only_one=True)
|
(original_path,))
|
||||||
|
|
||||||
if episode:
|
for episode in matching_episodes:
|
||||||
logging.debug("BAZARR storing those languages to DB: " + str(actual_subtitles))
|
if episode:
|
||||||
list_missing_subtitles(epno=episode['sonarrEpisodeId'])
|
logging.debug("BAZARR storing those languages to DB: " + str(actual_subtitles))
|
||||||
else:
|
list_missing_subtitles(epno=episode['sonarrEpisodeId'])
|
||||||
logging.debug("BAZARR haven't been able to update existing subtitles to DB : " + str(actual_subtitles))
|
else:
|
||||||
|
logging.debug("BAZARR haven't been able to update existing subtitles to DB : " + str(actual_subtitles))
|
||||||
else:
|
else:
|
||||||
logging.debug("BAZARR this file doesn't seems to exist or isn't accessible.")
|
logging.debug("BAZARR this file doesn't seems to exist or isn't accessible.")
|
||||||
|
|
||||||
|
@ -161,13 +162,14 @@ def store_subtitles_movie(original_path, reversed_path):
|
||||||
|
|
||||||
database.execute("UPDATE table_movies SET subtitles=? WHERE path=?",
|
database.execute("UPDATE table_movies SET subtitles=? WHERE path=?",
|
||||||
(str(actual_subtitles), original_path))
|
(str(actual_subtitles), original_path))
|
||||||
movie = database.execute("SELECT radarrId FROM table_movies WHERE path=?", (original_path,), only_one=True)
|
matching_movies = database.execute("SELECT radarrId FROM table_movies WHERE path=?", (original_path,))
|
||||||
|
|
||||||
if movie:
|
for movie in matching_movies:
|
||||||
logging.debug("BAZARR storing those languages to DB: " + str(actual_subtitles))
|
if movie:
|
||||||
list_missing_subtitles_movies(no=movie['radarrId'])
|
logging.debug("BAZARR storing those languages to DB: " + str(actual_subtitles))
|
||||||
else:
|
list_missing_subtitles_movies(no=movie['radarrId'])
|
||||||
logging.debug("BAZARR haven't been able to update existing subtitles to DB : " + str(actual_subtitles))
|
else:
|
||||||
|
logging.debug("BAZARR haven't been able to update existing subtitles to DB : " + str(actual_subtitles))
|
||||||
else:
|
else:
|
||||||
logging.debug("BAZARR this file doesn't seems to exist or isn't accessible.")
|
logging.debug("BAZARR this file doesn't seems to exist or isn't accessible.")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue