changed to seconds instead of minutes
This commit is contained in:
parent
dc3c7b2f5a
commit
3eb91d5352
3 changed files with 20 additions and 13 deletions
|
@ -3,6 +3,7 @@ import configparser
|
|||
|
||||
from Varken.helpers import Server, TautulliServer, SonarrServer, InfluxServer
|
||||
|
||||
|
||||
class INIParser(object):
|
||||
def __init__(self):
|
||||
self.config = configparser.ConfigParser()
|
||||
|
@ -61,21 +62,24 @@ class INIParser(object):
|
|||
queue = self.config.getboolean(sonarr_section, 'queue')
|
||||
missing_days = self.config.getint(sonarr_section, 'missing_days')
|
||||
future_days = self.config.getint(sonarr_section, 'future_days')
|
||||
missing_days_run_minutes = self.config.getint(sonarr_section, 'missing_days_run_minutes')
|
||||
future_days_run_minutes = self.config.getint(sonarr_section, 'future_days_run_minutes')
|
||||
queue_run_minutes = self.config.getint(sonarr_section, 'queue_run_minutes')
|
||||
missing_days_run_seconds = self.config.getint(sonarr_section, 'missing_days_run_seconds')
|
||||
future_days_run_seconds = self.config.getint(sonarr_section, 'future_days_run_seconds')
|
||||
queue_run_seconds = self.config.getint(sonarr_section, 'queue_run_seconds')
|
||||
|
||||
self.sonarr_servers.append(SonarrServer(server_id, scheme + url, apikey, verify_ssl, missing_days,
|
||||
missing_days_run_minutes, future_days,
|
||||
future_days_run_minutes, queue, queue_run_minutes))
|
||||
missing_days_run_seconds, future_days,
|
||||
future_days_run_seconds, queue, queue_run_seconds))
|
||||
|
||||
# Parse Radarr options
|
||||
try:
|
||||
if not self.config.getboolean('global', 'radarr_server_ids'):
|
||||
sys.exit('radarr_server_ids must be either false, or a comma-separated list of server ids')
|
||||
elif self.config.getint('global', 'radarr_server_ids'):
|
||||
self.radarr_enabled = True
|
||||
except ValueError:
|
||||
self.radarr_enabled = True
|
||||
sids = self.config.get('global', 'radarr_server_ids').strip(' ').split(',')
|
||||
|
||||
for server_id in sids:
|
||||
radarr_section = 'radarr-' + server_id
|
||||
url = self.config.get(radarr_section, 'url')
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# - Sonarr + Radarr scripts support multiple servers. You can remove the second
|
||||
# server by putting a # in front of the lines and section name, and removing
|
||||
# that number from your server_ids list
|
||||
# - tautulli_failback_ip, This is used when there is no IP listed in tautulli.
|
||||
# - fallback_ip, This is used when there is no IP listed in tautulli.
|
||||
# This can happen when you are streaming locally. This is usually your public IP.
|
||||
|
||||
[global]
|
||||
|
@ -24,11 +24,11 @@ apikey = xxxxxxxxxxxxxxxx
|
|||
ssl = false
|
||||
verify_ssl = true
|
||||
missing_days = 7
|
||||
missing_days_run_minutes = 30
|
||||
missing_days_run_seconds = 300
|
||||
future_days = 1
|
||||
future_days_run_minutes = 30
|
||||
future_days_run_seconds = 300
|
||||
queue = true
|
||||
queue_run_minutes = 1
|
||||
queue_run_seconds = 300
|
||||
|
||||
[sonarr-2]
|
||||
url = sonarr2.domain.tld
|
||||
|
@ -36,8 +36,11 @@ apikey = yyyyyyyyyyyyyyyy
|
|||
ssl = false
|
||||
verify_ssl = true
|
||||
missing_days = 7
|
||||
missing_days_run_seconds = 300
|
||||
future_days = 1
|
||||
future_days_run_seconds = 300
|
||||
queue = true
|
||||
queue_run_seconds = 300
|
||||
|
||||
[radarr-1]
|
||||
url = radarr1.domain.tld
|
||||
|
@ -63,7 +66,6 @@ fallback_ip = 0.0.0.0
|
|||
apikey = xxxxxxxxxxxxxxxx
|
||||
ssl = false
|
||||
verify_ssl = true
|
||||
influx_db = plex
|
||||
|
||||
[asa]
|
||||
url = firewall.domain.tld
|
||||
|
|
|
@ -10,6 +10,7 @@ def threaded(job, days=None):
|
|||
thread = threading.Thread(target=job, args=([days]))
|
||||
thread.start()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
CONFIG = INIParser()
|
||||
|
||||
|
@ -18,12 +19,12 @@ if __name__ == "__main__":
|
|||
|
||||
for server in CONFIG.sonarr_servers:
|
||||
if server.queue:
|
||||
schedule.every(server.queue_run_minutes).minutes.do(threaded, SONARR.get_queue)
|
||||
schedule.every(server.queue_run_seconds).seconds.do(threaded, SONARR.get_queue)
|
||||
if server.missing_days > 0:
|
||||
schedule.every(server.missing_days_run_minutes).minutes.do(threaded, SONARR.get_missing,
|
||||
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_minutes).minutes.do(threaded, SONARR.get_future,
|
||||
schedule.every(server.future_days_run_seconds).seconds.do(threaded, SONARR.get_future,
|
||||
server.future_days)
|
||||
|
||||
while True:
|
||||
|
|
Loading…
Reference in a new issue