created and assigned basic dbmanager
This commit is contained in:
parent
818f4bea7c
commit
0249f58247
8 changed files with 46 additions and 42 deletions
10
varken.py
10
varken.py
|
|
@ -7,6 +7,7 @@ from Varken.sonarr import SonarrAPI
|
|||
from Varken.tautulli import TautulliAPI
|
||||
from Varken.radarr import RadarrAPI
|
||||
from Varken.ombi import OmbiAPI
|
||||
from Varken.dbmanager import DBManager
|
||||
|
||||
def threaded(job):
|
||||
thread = threading.Thread(target=job)
|
||||
|
|
@ -15,10 +16,11 @@ def threaded(job):
|
|||
|
||||
if __name__ == "__main__":
|
||||
CONFIG = INIParser()
|
||||
DBMANAGER = DBManager(CONFIG.influx_server)
|
||||
|
||||
if CONFIG.sonarr_enabled:
|
||||
for server in CONFIG.sonarr_servers:
|
||||
SONARR = SonarrAPI(server, CONFIG.influx_server)
|
||||
SONARR = SonarrAPI(server, DBMANAGER)
|
||||
if server.queue:
|
||||
schedule.every(server.queue_run_seconds).seconds.do(threaded, SONARR.get_queue)
|
||||
if server.missing_days > 0:
|
||||
|
|
@ -28,7 +30,7 @@ if __name__ == "__main__":
|
|||
|
||||
if CONFIG.tautulli_enabled:
|
||||
for server in CONFIG.tautulli_servers:
|
||||
TAUTULLI = TautulliAPI(server, CONFIG.influx_server)
|
||||
TAUTULLI = TautulliAPI(server, DBMANAGER)
|
||||
if server.get_activity:
|
||||
schedule.every(server.get_activity_run_seconds).seconds.do(threaded, TAUTULLI.get_activity)
|
||||
if server.get_sessions:
|
||||
|
|
@ -36,7 +38,7 @@ if __name__ == "__main__":
|
|||
|
||||
if CONFIG.radarr_enabled:
|
||||
for server in CONFIG.radarr_servers:
|
||||
RADARR = RadarrAPI(server, CONFIG.influx_server)
|
||||
RADARR = RadarrAPI(server, DBMANAGER)
|
||||
if server.get_missing:
|
||||
schedule.every(server.get_missing_run_seconds).seconds.do(threaded, RADARR.get_missing)
|
||||
if server.queue:
|
||||
|
|
@ -44,7 +46,7 @@ if __name__ == "__main__":
|
|||
|
||||
if CONFIG.ombi_enabled:
|
||||
for server in CONFIG.ombi_servers:
|
||||
OMBI = OmbiAPI(server, CONFIG.influx_server)
|
||||
OMBI = OmbiAPI(server, DBMANAGER)
|
||||
if server.request_type_counts:
|
||||
schedule.every(server.request_type_run_seconds).seconds.do(threaded, OMBI.get_request_counts)
|
||||
if server.request_total_counts:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue