mirror of
https://github.com/morpheus65535/bazarr.git
synced 2024-09-21 07:55:59 +08:00
Continuing development.
This commit is contained in:
parent
d75c278a48
commit
278263c08d
|
@ -1,7 +1,6 @@
|
||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
import sqlite3
|
|
||||||
import json
|
import json
|
||||||
import requests
|
import requests
|
||||||
import tarfile
|
import tarfile
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
import os
|
import os
|
||||||
import sqlite3
|
|
||||||
import requests
|
import requests
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sqlite3
|
|
||||||
import pycountry
|
import pycountry
|
||||||
|
|
||||||
from get_args import args
|
from get_args import args
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sqlite3
|
|
||||||
import requests
|
import requests
|
||||||
import logging
|
import logging
|
||||||
from queueconfig import notifications
|
from queueconfig import notifications
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sqlite3
|
|
||||||
import requests
|
import requests
|
||||||
import logging
|
import logging
|
||||||
from queueconfig import notifications
|
from queueconfig import notifications
|
||||||
|
|
|
@ -18,17 +18,21 @@ def update_notifier():
|
||||||
notifiers_new = []
|
notifiers_new = []
|
||||||
notifiers_old = []
|
notifiers_old = []
|
||||||
|
|
||||||
notifiers_current = TableSettingsNotifier.select(
|
notifiers_current_db = TableSettingsNotifier.select(
|
||||||
TableSettingsNotifier.name
|
TableSettingsNotifier.name
|
||||||
)
|
)
|
||||||
|
|
||||||
|
notifiers_current = []
|
||||||
|
for notifier in notifiers_current_db:
|
||||||
|
notifiers_current.append(notifier.name)
|
||||||
|
|
||||||
for x in results['schemas']:
|
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'])
|
notifiers_new.append(x['service_name'])
|
||||||
logging.debug('Adding new notifier agent: ' + x['service_name'])
|
logging.debug('Adding new notifier agent: ' + x['service_name'])
|
||||||
else:
|
else:
|
||||||
notifiers_old.append(x['service_name'])
|
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))
|
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:
|
for notifier_to_delete in notifiers_to_delete:
|
||||||
TableSettingsNotifier.delete().where(
|
TableSettingsNotifier.delete().where(
|
||||||
TableSettingsNotifier.Name == notifier_to_delete
|
TableSettingsNotifier.name == notifier_to_delete
|
||||||
).execute()
|
).execute()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue