From e7b261b36aeb297bee9e925d8adcc48d326b5494 Mon Sep 17 00:00:00 2001 From: morpheus65535 <5130500+morpheus65535@users.noreply.github.com> Date: Tue, 19 Dec 2017 22:25:10 -0500 Subject: Remove requirement to restart Bazarr when changing Sonarr settings --- get_episodes.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'get_episodes.py') diff --git a/get_episodes.py b/get_episodes.py index 603dc4fcb..0cbc8cdc0 100644 --- a/get_episodes.py +++ b/get_episodes.py @@ -4,10 +4,14 @@ import requests import logging from get_general_settings import * -from get_sonarr_settings import * from list_subtitles import * - + def update_all_episodes(): + from get_sonarr_settings import get_sonarr_settings + url_sonarr = get_sonarr_settings()[0] + url_sonarr_short = get_sonarr_settings()[1] + apikey_sonarr = get_sonarr_settings()[2] + # Open database connection db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30) c = db.cursor() @@ -72,6 +76,11 @@ def update_all_episodes(): logging.info('All missing subtitles updated in database.') def add_new_episodes(): + from get_sonarr_settings import get_sonarr_settings + url_sonarr = get_sonarr_settings()[0] + url_sonarr_short = get_sonarr_settings()[1] + apikey_sonarr = get_sonarr_settings()[2] + # Open database connection db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30) c = db.cursor() -- cgit v1.2.3