mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-24 00:33:27 +00:00
Updating notification system to support new services from apprise 0.0.9
This commit is contained in:
parent
7af17c9703
commit
7b7c02c9c4
3 changed files with 56 additions and 2 deletions
49
bazarr.py
49
bazarr.py
|
@ -1,4 +1,4 @@
|
|||
bazarr_version = '0.5.5'
|
||||
bazarr_version = '0.5.6'
|
||||
|
||||
import gc
|
||||
gc.enable()
|
||||
|
@ -934,6 +934,53 @@ def save_settings():
|
|||
settings_notifier_XBMC_url = request.forms.get('settings_notifier_XBMC_url')
|
||||
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'XBMC'", (settings_notifier_XBMC_enabled, settings_notifier_XBMC_url))
|
||||
|
||||
settings_notifier_Discord_enabled = request.forms.get('settings_notifier_Discord_enabled')
|
||||
if settings_notifier_Discord_enabled == 'on':
|
||||
settings_notifier_Discord_enabled = 1
|
||||
else:
|
||||
settings_notifier_Discord_enabled = 0
|
||||
settings_notifier_Discord_url = request.forms.get('settings_notifier_Discord_url')
|
||||
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Discord'", (settings_notifier_Discord_enabled, settings_notifier_Discord_url))
|
||||
|
||||
settings_notifier_E_Mail_enabled = request.forms.get('settings_notifier_E-Mail_enabled')
|
||||
if settings_notifier_E_Mail_enabled == 'on':
|
||||
settings_notifier_E_Mail_enabled = 1
|
||||
else:
|
||||
settings_notifier_E_Mail_enabled = 0
|
||||
settings_notifier_E_Mail_url = request.forms.get('settings_notifier_E-Mail_url')
|
||||
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'E-Mail'", (settings_notifier_E_Mail_enabled, settings_notifier_E_Mail_url))
|
||||
|
||||
settings_notifier_Emby_enabled = request.forms.get('settings_notifier_Emby_enabled')
|
||||
if settings_notifier_Emby_enabled == 'on':
|
||||
settings_notifier_Emby_enabled = 1
|
||||
else:
|
||||
settings_notifier_Emby_enabled = 0
|
||||
settings_notifier_Emby_url = request.forms.get('settings_notifier_Emby_url')
|
||||
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Emby'", (settings_notifier_Emby_enabled, settings_notifier_Emby_url))
|
||||
|
||||
settings_notifier_IFTTT_enabled = request.forms.get('settings_notifier_IFTTT_enabled')
|
||||
if settings_notifier_IFTTT_enabled == 'on':
|
||||
settings_notifier_IFTTT_enabled = 1
|
||||
else:
|
||||
settings_notifier_IFTTT_enabled = 0
|
||||
settings_notifier_IFTTT_url = request.forms.get('settings_notifier_IFTTT_url')
|
||||
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'IFTTT'", (settings_notifier_IFTTT_enabled, settings_notifier_IFTTT_url))
|
||||
|
||||
settings_notifier_Stride_enabled = request.forms.get('settings_notifier_Stride_enabled')
|
||||
if settings_notifier_Stride_enabled == 'on':
|
||||
settings_notifier_Stride_enabled = 1
|
||||
else:
|
||||
settings_notifier_Stride_enabled = 0
|
||||
settings_notifier_Stride_url = request.forms.get('settings_notifier_Stride_url')
|
||||
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Stride'", (settings_notifier_Stride_enabled, settings_notifier_Stride_url))
|
||||
|
||||
settings_notifier_Windows_enabled = request.forms.get('settings_notifier_Windows_enabled')
|
||||
if settings_notifier_Windows_enabled == 'on':
|
||||
settings_notifier_Windows_enabled = 1
|
||||
else:
|
||||
settings_notifier_Windows_enabled = 0
|
||||
settings_notifier_Windows_url = request.forms.get('settings_notifier_Windows_url')
|
||||
c.execute("UPDATE table_settings_notifier SET enabled = ?, url = ? WHERE name = 'Windows'", (settings_notifier_Windows_enabled, settings_notifier_Windows_url))
|
||||
|
||||
conn.commit()
|
||||
c.close()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#Bazarr requirements
|
||||
apprise>=0.0.8
|
||||
apprise>=0.0.9
|
||||
apscheduler>=3.5.1
|
||||
babelfish>=0.5.5
|
||||
bottle>=0.12.13
|
||||
|
|
|
@ -164,6 +164,13 @@ if os.path.exists(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'))
|
|||
else:
|
||||
c.execute('UPDATE table_settings_general SET page_size="25"')
|
||||
|
||||
try:
|
||||
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:
|
||||
pass
|
||||
|
||||
# Commit change to db
|
||||
db.commit()
|
||||
|
||||
|
|
Loading…
Reference in a new issue