From d4938cb2fc651c13c2ea4a425816a3208d5f8193 Mon Sep 17 00:00:00 2001 From: morpheus65535 <5130500+morpheus65535@users.noreply.github.com> Date: Fri, 10 Aug 2018 19:28:47 -0400 Subject: [PATCH] Fix for new notifier --- update_db.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/update_db.py b/update_db.py index 3e5f45c3b..da027f6b2 100644 --- a/update_db.py +++ b/update_db.py @@ -173,11 +173,13 @@ if os.path.exists(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db')) try: c.execute('DELETE FROM table_settings_notifier WHERE rowid > 24') #Modify this if we add more notification provider - c.execute('SELECT name FROM table_settings_notifier WHERE name = "Discord"').fetchone() + rows = c.execute('SELECT name FROM table_settings_notifier WHERE name = "Discord"').fetchall() + if rows == "[]": + providers = ['Discord', 'E-Mail', 'Emby', 'IFTTT', 'Stride', 'Windows'] + for provider in providers: + c.execute('INSERT INTO `table_settings_notifier` (name, enabled) VALUES (?, ?);', (provider, '0')) except: - providers = ['Discord', 'E-Mail', 'Emby', 'IFTTT', 'Stride', 'Windows'] - for provider in providers: - c.execute('INSERT INTO `table_settings_notifier` (name, enabled) VALUES (?, ?);', (provider, '0')) + pass try: c.execute('alter table table_settings_general add column "use_embedded_subs" "text"')