From 240c0a72ef67ceb341afbf0a58d8ec86cbb8504e Mon Sep 17 00:00:00 2001 From: morpheus65535 <5130500+morpheus65535@users.noreply.github.com> Date: Mon, 1 Oct 2018 10:44:27 -0400 Subject: [PATCH] Initial commit --- bazarr.py | 3 +++ get_episodes.py | 6 +++--- get_movies.py | 6 +++--- get_subtitle.py | 4 ++-- init.py | 8 ++++---- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/bazarr.py b/bazarr.py index 3a90e25c4..0e2f134a2 100644 --- a/bazarr.py +++ b/bazarr.py @@ -57,6 +57,7 @@ configure_logging() import requests if get_proxy_settings()[0] != 'None': + logging.debug('BAZARR Applying proxy settings.') if get_proxy_settings()[3] != '' and get_proxy_settings()[4] != '': proxy = get_proxy_settings()[0] + '://' + get_proxy_settings()[3] + ':' + get_proxy_settings()[4] + '@' + get_proxy_settings()[1] + ':' + get_proxy_settings()[2] else: @@ -100,6 +101,7 @@ from scheduler import * from notifier import send_notifications, send_notifications_movie # Reset restart required warning on start +logging.debug('BAZARR Clearing restart required warning.') conn = sqlite3.connect(os.path.join(config_dir, 'db/bazarr.db'), timeout=30) c = conn.cursor() c.execute("UPDATE system SET configured = 0, updated = 0") @@ -111,6 +113,7 @@ load_language_in_db() from get_settings import get_auth_settings +logging.debug('BAZARR Applying authentication settings') aaa = Cork(os.path.normpath(os.path.join(config_dir, 'config'))) app = app() diff --git a/get_episodes.py b/get_episodes.py index c0a1f12e6..bbbe34bef 100644 --- a/get_episodes.py +++ b/get_episodes.py @@ -21,7 +21,7 @@ def update_all_movies(): logging.info('All missing movie subtitles updated in database.') def sync_episodes(): - logging.debug('Starting episode sync from Sonarr.') + logging.debug('BAZARR Starting episode sync from Sonarr.') from get_settings import get_sonarr_settings url_sonarr = get_sonarr_settings()[6] apikey_sonarr = get_sonarr_settings()[4] @@ -100,7 +100,7 @@ def sync_episodes(): for added_episode in episodes_to_add: store_subtitles(path_replace(added_episode[3])) - logging.debug('All episodes synced from Sonarr into database.') + logging.debug('BAZARR All episodes synced from Sonarr into database.') list_missing_subtitles() - logging.debug('All missing subtitles updated in database.') \ No newline at end of file + logging.debug('BAZARR All missing subtitles updated in database.') \ No newline at end of file diff --git a/get_movies.py b/get_movies.py index 267a46c33..d4a434ab1 100644 --- a/get_movies.py +++ b/get_movies.py @@ -9,7 +9,7 @@ from get_settings import get_general_settings, path_replace_movie from list_subtitles import store_subtitles_movie, list_missing_subtitles_movies def update_movies(): - logging.debug('Starting movie sync from Radarr.') + logging.debug('BAZARR Starting movie sync from Radarr.') from get_settings import get_radarr_settings url_radarr = get_radarr_settings()[6] apikey_radarr = get_radarr_settings()[4] @@ -117,10 +117,10 @@ def update_movies(): store_subtitles_movie(path_replace_movie(added_path[0])) db.close() - logging.debug('All movies synced from Radarr into database.') + logging.debug('BAZARR All movies synced from Radarr into database.') list_missing_subtitles_movies() - logging.debug('All movie missing subtitles updated in database.') + logging.debug('BAZARR All movie missing subtitles updated in database.') def get_profile_list(): from get_settings import get_radarr_settings diff --git a/get_subtitle.py b/get_subtitle.py index b94e32e89..a25ead25b 100644 --- a/get_subtitle.py +++ b/get_subtitle.py @@ -63,7 +63,7 @@ def download_subtitle(path, language, hi, providers, providers_auth, sceneName, try: best_subtitle = best_subtitles[video][0] except: - logging.debug('No subtitles found for ' + path) + logging.debug('BAZARR No subtitles found for ' + path) return None else: single = get_general_settings()[7] @@ -341,7 +341,7 @@ def wanted_download_subtitles(path): history_log(1, episode[3], episode[2], message) send_notifications(episode[3], episode[2], message) else: - logging.debug('Search is not active for episode ' + episode[0] + ' Language: ' + attempt[i][0]) + logging.debug('BAZARR Search is not active for episode ' + episode[0] + ' Language: ' + attempt[i][0]) def wanted_download_subtitles_movie(path): diff --git a/init.py b/init.py index e160c947e..03466c0ad 100644 --- a/init.py +++ b/init.py @@ -10,20 +10,20 @@ if os.path.exists(config_dir) is False: # Create config_dir directory tree try: os.mkdir(os.path.join(config_dir)) - logging.debug("Created data directory") + logging.debug("BAZARR Created data directory") except OSError: logging.exception("The configuration directory doesn't exist and Bazarr cannot create it (permission issue?).") exit(2) if os.path.exists(os.path.join(config_dir, 'config')) is False: os.mkdir(os.path.join(config_dir, 'config')) - logging.debug("Created config folder") + logging.debug("BAZARR Created config folder") if os.path.exists(os.path.join(config_dir, 'db')) is False: os.mkdir(os.path.join(config_dir, 'db')) - logging.debug("Created db folder") + logging.debug("BAZARR Created db folder") if os.path.exists(os.path.join(config_dir, 'log')) is False: os.mkdir(os.path.join(config_dir, 'log')) - logging.debug("Created log folder") + logging.debug("BAZARR Created log folder") config_file = os.path.normpath(os.path.join(config_dir, 'config/config.ini'))