diff --git a/get_episodes.py b/get_episodes.py index c9b8e198e..6f869a3d9 100644 --- a/get_episodes.py +++ b/get_episodes.py @@ -42,10 +42,10 @@ def update_all_episodes(): try: c.execute('''INSERT INTO table_episodes(sonarrSeriesId, sonarrEpisodeId, title, path, season, episode) VALUES (?, ?, ?, ?, ?, ?)''', (episode['seriesId'], episode['id'], episode['title'], episode['episodeFile']['path'], episode['seasonNumber'], episode['episodeNumber'])) - db.commit() + db.commit() except sqlite3.Error: c.execute('''UPDATE table_episodes SET sonarrSeriesId = ?, sonarrEpisodeId = ?, title = ?, path = ?, season = ?, episode = ? WHERE sonarrEpisodeId = ?''', (episode['seriesId'], episode['id'], episode['title'], episode['episodeFile']['path'], episode['seasonNumber'], episode['episodeNumber'], episode['id'])) - db.commit() + db.commit() else: continue continue