mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-01-10 08:47:52 +08:00
Continuing development.
This commit is contained in:
parent
d75c278a48
commit
278263c08d
6 changed files with 8 additions and 9 deletions
|
@ -1,7 +1,6 @@
|
|||
# coding=utf-8
|
||||
import os
|
||||
import logging
|
||||
import sqlite3
|
||||
import json
|
||||
import requests
|
||||
import tarfile
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# coding=utf-8
|
||||
import os
|
||||
import sqlite3
|
||||
import requests
|
||||
import logging
|
||||
import re
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# coding=utf-8
|
||||
|
||||
import os
|
||||
import sqlite3
|
||||
import pycountry
|
||||
|
||||
from get_args import args
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# coding=utf-8
|
||||
|
||||
import os
|
||||
import sqlite3
|
||||
import requests
|
||||
import logging
|
||||
from queueconfig import notifications
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# coding=utf-8
|
||||
|
||||
import os
|
||||
import sqlite3
|
||||
import requests
|
||||
import logging
|
||||
from queueconfig import notifications
|
||||
|
|
|
@ -18,17 +18,21 @@ def update_notifier():
|
|||
notifiers_new = []
|
||||
notifiers_old = []
|
||||
|
||||
notifiers_current = TableSettingsNotifier.select(
|
||||
notifiers_current_db = TableSettingsNotifier.select(
|
||||
TableSettingsNotifier.name
|
||||
)
|
||||
|
||||
notifiers_current = []
|
||||
for notifier in notifiers_current_db:
|
||||
notifiers_current.append(notifier.name)
|
||||
|
||||
for x in results['schemas']:
|
||||
if x['service_name'] not in str(notifiers_current):
|
||||
if x['service_name'] not in notifiers_current:
|
||||
notifiers_new.append(x['service_name'])
|
||||
logging.debug('Adding new notifier agent: ' + x['service_name'])
|
||||
else:
|
||||
notifiers_old.append(x['service_name'])
|
||||
notifier_current = [i.name for i in notifiers_current]
|
||||
notifier_current = [i for i in notifiers_current]
|
||||
|
||||
notifiers_to_delete = list(set(notifier_current) - set(notifiers_old))
|
||||
|
||||
|
@ -42,7 +46,7 @@ def update_notifier():
|
|||
|
||||
for notifier_to_delete in notifiers_to_delete:
|
||||
TableSettingsNotifier.delete().where(
|
||||
TableSettingsNotifier.Name == notifier_to_delete
|
||||
TableSettingsNotifier.name == notifier_to_delete
|
||||
).execute()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue