Exception handling for UNIQUE constraint on episode.path #114

pull/115/merge
Louis Vézina 6 years ago
parent 7aedf79b33
commit 2db22f0271

@ -68,7 +68,11 @@ def sync_episodes():
db.commit()
for added_episode in added_episodes:
try:
c.execute('''INSERT INTO table_episodes(sonarrSeriesId, sonarrEpisodeId, title, path, season, episode, scene_name) VALUES (?, ?, ?, ?, ?, ?, ?)''', added_episode)
except sqlite3.IntegrityError as e:
logging.exception("You're probably an early adopter of Bazarr and this is a known issue. Please open an issue on Github and we'll fix this.")
else:
db.commit()
store_subtitles(path_replace(added_episode[3]))

Loading…
Cancel
Save