moved files

This commit is contained in:
Nicholas St. Germain 2018-12-01 17:46:56 -06:00
parent ecb330206a
commit 762e644d46
7 changed files with 9 additions and 91 deletions

43
varken.py Normal file
View file

@ -0,0 +1,43 @@
import schedule
import threading
from time import sleep
from Varken.iniparser import INIParser
from Varken.sonarr import SonarrAPI
from Varken.tautulli import TautulliAPI
def threaded(job, days=None):
thread = threading.Thread(target=job, args=([days]))
thread.start()
if __name__ == "__main__":
CONFIG = INIParser()
if CONFIG.sonarr_enabled:
SONARR = SonarrAPI(CONFIG.sonarr_servers, CONFIG.influx_server)
for server in CONFIG.sonarr_servers:
if server.queue:
schedule.every(server.queue_run_seconds).seconds.do(threaded, SONARR.get_queue)
if server.missing_days > 0:
schedule.every(server.missing_days_run_seconds).seconds.do(threaded, SONARR.get_missing,
server.missing_days)
if server.future_days > 0:
schedule.every(server.future_days_run_seconds).seconds.do(threaded, SONARR.get_future,
server.future_days)
if CONFIG.tautulli_enabled:
TAUTULLI = TautulliAPI(CONFIG.tautulli_servers, CONFIG.influx_server)
for server in CONFIG.tautulli_servers:
if server.get_activity:
schedule.every(server.get_activity_run_seconds).seconds.do(threaded, TAUTULLI.get_activity)
if server.get_sessions:
schedule.every(server.get_sessions_run_seconds).seconds.do(threaded, TAUTULLI.get_sessions)
while True:
schedule.run_pending()
sleep(1)