Fix for movies that cannot be imported.

This commit is contained in:
morpheus65535 2018-11-28 00:27:25 -05:00
parent 1f38ec8c29
commit 42cf864c19
1 changed files with 2 additions and 7 deletions

View File

@ -104,7 +104,6 @@ def update_movies():
db.commit()
db.close()
added_movies = list(set(current_movies_radarr) - set(current_movies_db_list))
removed_movies = list(set(current_movies_db_list) - set(current_movies_radarr))
db = sqlite3.connect(os.path.join(config_dir, 'db/bazarr.db'), timeout=30)
@ -114,12 +113,8 @@ def update_movies():
db.commit()
db.close()
db = sqlite3.connect(os.path.join(config_dir, 'db/bazarr.db'), timeout=30)
c = db.cursor()
for added_movie in added_movies:
added_path = c.execute('SELECT path FROM table_movies WHERE tmdbId = ?', (added_movie,)).fetchone()
store_subtitles_movie(path_replace_movie(added_path[0]))
db.close()
for added_movie in movies_to_add:
store_subtitles_movie(path_replace_movie(added_movie[1]))
for updated_movie in movies_to_update:
store_subtitles_movie(path_replace_movie(updated_movie[1]))