Fix for new notifier

This commit is contained in:
morpheus65535 2018-08-10 19:28:47 -04:00
parent a8d7b91490
commit d4938cb2fc
1 changed files with 6 additions and 4 deletions

View File

@ -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"')