diff --git a/README.md b/README.md index 8774af8a3..cf8dd3030 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you need something that is not already part of Bazarr, feel free to create a You can get more in the [screenshot](https://github.com/morpheus65535/bazarr/tree/master/screenshot) directory but it should look familiar: -![Series](/screenshot/series.png?raw=true "Series") +![Series](/screenshot/1-series/series-2-episodes.png?raw=true "Series") ### License diff --git a/bazarr/get_subtitle.py b/bazarr/get_subtitle.py index ff4de38cd..2fc3aba61 100644 --- a/bazarr/get_subtitle.py +++ b/bazarr/get_subtitle.py @@ -97,7 +97,7 @@ def download_subtitle(path, language, hi, providers, providers_auth, sceneName, logging.debug('BAZARR ' + str(len(subtitles_list)) + " subtitles have been found for this file: " + path) if len(subtitles_list) > 0: try: - pdownload_result = False + download_result = False for subtitle in subtitles_list: download_result = p.download_subtitle(subtitle) if download_result == True: @@ -130,7 +130,7 @@ def download_subtitle(path, language, hi, providers, providers_auth, sceneName, downloaded_language = language_from_alpha3(result[0].language.alpha3) downloaded_language_code2 = alpha2_from_alpha3(result[0].language.alpha3) downloaded_language_code3 = result[0].language.alpha3 - downloaded_path = get_subtitle_path(path, language=language_set) + downloaded_path = get_subtitle_path(path, downloaded_language_code2) logging.debug('BAZARR Subtitles file saved to disk: ' + downloaded_path) if used_sceneName == True: message = downloaded_language + " subtitles downloaded from " + downloaded_provider + " with a score of " + unicode(calculated_score) + "% using this scene name: " + sceneName @@ -235,7 +235,7 @@ def manual_search(path, language, hi, providers, providers_auth, sceneName, medi if type(s) is LegendasTVSubtitle: # The pickle doesn't work very well with RAR (rarfile.RarFile) or ZIP (zipfile.ZipFile) s.archive.content = None - subtitles_list.append(dict(score=round((compute_score(s, video, hearing_impaired=hi) / max_score * 100), 2), language=alpha2_from_alpha3(s.language.alpha3), hearing_impaired=str(s.hearing_impaired), provider=s.provider_name, subtitle=codecs.encode(pickle.dumps(s), "base64").decode(), url=s.page_link, matches=list(matched), dont_matches=list(not_matched))) + subtitles_list.append(dict(score=round((compute_score(s, video, hearing_impaired=hi) / max_score * 100), 2), language=alpha2_from_alpha3(s.language.alpha3), hearing_impaired=str(s.hearing_impaired), provider=s.provider_name, subtitle=codecs.encode(pickle.dumps(s), "base64").decode(), url=s.page_link, matches=list(matched), dont_matches=list(not_matched))) subtitles_dict = {} subtitles_dict = sorted(subtitles_list, key=lambda x: x['score'], reverse=True) logging.debug('BAZARR ' + str(len(subtitles_dict)) + " subtitles have been found for this file: " + path) @@ -299,7 +299,7 @@ def manual_download_subtitle(path, language, hi, subtitle, provider, providers_a downloaded_language = language_from_alpha3(result[0].language.alpha3) downloaded_language_code2 = alpha2_from_alpha3(result[0].language.alpha3) downloaded_language_code3 = result[0].language.alpha3 - downloaded_path = get_subtitle_path(path, language=lang_obj) + downloaded_path = get_subtitle_path(path, downloaded_language_code2) logging.debug('BAZARR Subtitles file saved to disk: ' + downloaded_path) message = downloaded_language + " subtitles downloaded from " + downloaded_provider + " with a score of " + unicode(score) + "% using manual search." diff --git a/bazarr/list_subtitles.py b/bazarr/list_subtitles.py index 6dd83151e..96c91276f 100644 --- a/bazarr/list_subtitles.py +++ b/bazarr/list_subtitles.py @@ -54,10 +54,10 @@ def store_subtitles(file): encoding = UnicodeDammit(text) try: text = text.decode(encoding.original_encoding) + detected_language = langdetect.detect(text) except Exception as e: logging.exception('BAZARR Error trying to detect character encoding for this subtitles file: ' + path_replace(os.path.join(os.path.dirname(file), subtitle)) + ' You should try to delete this subtitles file manually and ask Bazarr to download it again.') else: - detected_language = langdetect.detect(text) if len(detected_language) > 0: actual_subtitles.append([str(detected_language), path_replace_reverse(os.path.join(os.path.dirname(file), subtitle))]) @@ -106,10 +106,10 @@ def store_subtitles_movie(file): encoding = UnicodeDammit(text) try: text = text.decode(encoding.original_encoding) + detected_language = langdetect.detect(text) except Exception as e: logging.exception('BAZARR Error trying to detect character encoding for this subtitles file: ' + path_replace_movie(os.path.join(os.path.dirname(file), subtitle)) + ' You should try to delete this subtitles file manually and ask Bazarr to download it again.') else: - detected_language = langdetect.detect(text) if len(detected_language) > 0: actual_subtitles.append([str(detected_language), path_replace_reverse_movie(os.path.join(os.path.dirname(file), subtitle))]) diff --git a/bazarr/logger.py b/bazarr/logger.py index 1a7e34f29..daf436356 100644 --- a/bazarr/logger.py +++ b/bazarr/logger.py @@ -1,19 +1,12 @@ import os -import sys import logging import re from logging.handlers import TimedRotatingFileHandler from get_argv import config_dir -from get_settings import get_general_settings logger = logging.getLogger() -debug = get_general_settings()[4] -if debug is False: - log_level = "INFO" -else: - log_level = "DEBUG" class OneLineExceptionFormatter(logging.Formatter): def formatException(self, exc_info): @@ -39,7 +32,12 @@ class NoExceptionFormatter(logging.Formatter): return '' -def configure_logging(): +def configure_logging(debug=False): + if not debug: + log_level = "INFO" + else: + log_level = "DEBUG" + logger.handlers = [] logger.setLevel(log_level) @@ -54,7 +52,7 @@ def configure_logging(): # ch.addFilter(MyFilter()) logger.addHandler(ch) - #File Logging + # File Logging global fh fh = TimedRotatingFileHandler(os.path.join(config_dir, 'log/bazarr.log'), when="midnight", interval=1, backupCount=7) @@ -64,7 +62,7 @@ def configure_logging(): fh.addFilter(BlacklistFilter()) fh.addFilter(PublicIPFilter()) - if debug is True: + if debug: logging.getLogger("apscheduler").setLevel(logging.DEBUG) logging.getLogger("subliminal").setLevel(logging.DEBUG) logging.getLogger("git").setLevel(logging.DEBUG) @@ -145,13 +143,3 @@ class PublicIPFilter(logging.Filter): def empty_log(): fh.doRollover() - - -def update_settings(debug): - if debug == 'False': - level = "INFO" - else: - level = "DEBUG" - logger.setLevel(level) - for handler in logger.handlers: - handler.setLevel(level) diff --git a/bazarr/main.py b/bazarr/main.py index 72c1c5293..05e94a628 100644 --- a/bazarr/main.py +++ b/bazarr/main.py @@ -1,4 +1,4 @@ -bazarr_version = '0.6.7.1' +bazarr_version = '0.6.8' import gc gc.enable() @@ -23,8 +23,9 @@ update_notifier() from get_settings import get_general_settings, get_proxy_settings import logging -from logger import configure_logging, empty_log, update_settings -configure_logging() +from logger import configure_logging, empty_log + +configure_logging(get_general_settings()[4]) import requests if get_proxy_settings()[0] != 'None': @@ -469,6 +470,7 @@ def image_proxy_movies(url): @route(base_url) +@route(base_url.rstrip('/')) @custom_auth_basic(check_credentials) def redirect_root(): authorize() @@ -1129,8 +1131,6 @@ def save_settings(): cfg.set('general', 'use_embedded_subs', text_type(settings_general_embedded)) cfg.set('general', 'only_monitored', text_type(settings_general_only_monitored)) cfg.set('general', 'adaptive_searching', text_type(settings_general_adaptive_searching)) - - update_settings(settings_general_debug) if after != before: configured() @@ -1301,6 +1301,8 @@ def save_settings(): with open(config_file, 'wb') as f: cfg.write(f) + configure_logging(get_general_settings()[4]) + notifiers = c.execute("SELECT * FROM table_settings_notifier ORDER BY name").fetchall() for notifier in notifiers: enabled = request.forms.get('settings_notifier_' + notifier[0] + '_enabled') diff --git a/screenshot/0-wizard/wizard-1- general.png b/screenshot/0-wizard/wizard-1- general.png new file mode 100644 index 000000000..e1da53a53 Binary files /dev/null and b/screenshot/0-wizard/wizard-1- general.png differ diff --git a/screenshot/0-wizard/wizard-2-subliminal.png b/screenshot/0-wizard/wizard-2-subliminal.png new file mode 100644 index 000000000..47af9f776 Binary files /dev/null and b/screenshot/0-wizard/wizard-2-subliminal.png differ diff --git a/screenshot/0-wizard/wizard-3-sonarr.png b/screenshot/0-wizard/wizard-3-sonarr.png new file mode 100644 index 000000000..9325f0efc Binary files /dev/null and b/screenshot/0-wizard/wizard-3-sonarr.png differ diff --git a/screenshot/0-wizard/wizard-4-radarr.png b/screenshot/0-wizard/wizard-4-radarr.png new file mode 100644 index 000000000..f77e3b2b9 Binary files /dev/null and b/screenshot/0-wizard/wizard-4-radarr.png differ diff --git a/screenshot/1-series/series-1-list.png b/screenshot/1-series/series-1-list.png new file mode 100644 index 000000000..08a399cae Binary files /dev/null and b/screenshot/1-series/series-1-list.png differ diff --git a/screenshot/1-series/series-2-episodes.png b/screenshot/1-series/series-2-episodes.png new file mode 100644 index 000000000..860ff6285 Binary files /dev/null and b/screenshot/1-series/series-2-episodes.png differ diff --git a/screenshot/1-series/series-3-manual.png b/screenshot/1-series/series-3-manual.png new file mode 100644 index 000000000..ed8f3b4b0 Binary files /dev/null and b/screenshot/1-series/series-3-manual.png differ diff --git a/screenshot/1-series/series-4-config.png b/screenshot/1-series/series-4-config.png new file mode 100644 index 000000000..03ae100b0 Binary files /dev/null and b/screenshot/1-series/series-4-config.png differ diff --git a/screenshot/2-movies/movies-1-list.png b/screenshot/2-movies/movies-1-list.png new file mode 100644 index 000000000..0456477ba Binary files /dev/null and b/screenshot/2-movies/movies-1-list.png differ diff --git a/screenshot/2-movies/movies-2-movie.png b/screenshot/2-movies/movies-2-movie.png new file mode 100644 index 000000000..078b29c30 Binary files /dev/null and b/screenshot/2-movies/movies-2-movie.png differ diff --git a/screenshot/2-movies/movies-3-manual.png b/screenshot/2-movies/movies-3-manual.png new file mode 100644 index 000000000..826b7cd56 Binary files /dev/null and b/screenshot/2-movies/movies-3-manual.png differ diff --git a/screenshot/2-movies/movies-4-config.png b/screenshot/2-movies/movies-4-config.png new file mode 100644 index 000000000..8f9b7c88e Binary files /dev/null and b/screenshot/2-movies/movies-4-config.png differ diff --git a/screenshot/3-history/history-1-series.png b/screenshot/3-history/history-1-series.png new file mode 100644 index 000000000..145afd413 Binary files /dev/null and b/screenshot/3-history/history-1-series.png differ diff --git a/screenshot/3-history/history-2-movies.png b/screenshot/3-history/history-2-movies.png new file mode 100644 index 000000000..085cb6705 Binary files /dev/null and b/screenshot/3-history/history-2-movies.png differ diff --git a/screenshot/4-wanted/wanted-1-series.png b/screenshot/4-wanted/wanted-1-series.png new file mode 100644 index 000000000..b64d86719 Binary files /dev/null and b/screenshot/4-wanted/wanted-1-series.png differ diff --git a/screenshot/4-wanted/wanted-2-movies.png b/screenshot/4-wanted/wanted-2-movies.png new file mode 100644 index 000000000..8c09403b5 Binary files /dev/null and b/screenshot/4-wanted/wanted-2-movies.png differ diff --git a/screenshot/5-settings/settings-1-general.png b/screenshot/5-settings/settings-1-general.png new file mode 100644 index 000000000..362efc4ea Binary files /dev/null and b/screenshot/5-settings/settings-1-general.png differ diff --git a/screenshot/5-settings/settings-2-sonarr.png b/screenshot/5-settings/settings-2-sonarr.png new file mode 100644 index 000000000..0f3c2fbd2 Binary files /dev/null and b/screenshot/5-settings/settings-2-sonarr.png differ diff --git a/screenshot/5-settings/settings-3-radarr.png b/screenshot/5-settings/settings-3-radarr.png new file mode 100644 index 000000000..d358885c7 Binary files /dev/null and b/screenshot/5-settings/settings-3-radarr.png differ diff --git a/screenshot/5-settings/settings-4-subliminal.png b/screenshot/5-settings/settings-4-subliminal.png new file mode 100644 index 000000000..07d077b03 Binary files /dev/null and b/screenshot/5-settings/settings-4-subliminal.png differ diff --git a/screenshot/5-settings/settings-5-notifications.png b/screenshot/5-settings/settings-5-notifications.png new file mode 100644 index 000000000..e443b110b Binary files /dev/null and b/screenshot/5-settings/settings-5-notifications.png differ diff --git a/screenshot/6-system/system-1-tasks.png b/screenshot/6-system/system-1-tasks.png new file mode 100644 index 000000000..fe831a1f2 Binary files /dev/null and b/screenshot/6-system/system-1-tasks.png differ diff --git a/screenshot/6-system/system-2-logs.png b/screenshot/6-system/system-2-logs.png new file mode 100644 index 000000000..2088f0e98 Binary files /dev/null and b/screenshot/6-system/system-2-logs.png differ diff --git a/screenshot/6-system/system-3-releases.png b/screenshot/6-system/system-3-releases.png new file mode 100644 index 000000000..f681fc1ac Binary files /dev/null and b/screenshot/6-system/system-3-releases.png differ diff --git a/screenshot/episodes.png b/screenshot/episodes.png deleted file mode 100644 index c5ec6e12d..000000000 Binary files a/screenshot/episodes.png and /dev/null differ diff --git a/screenshot/history.png b/screenshot/history.png deleted file mode 100644 index 65caa157d..000000000 Binary files a/screenshot/history.png and /dev/null differ diff --git a/screenshot/series.png b/screenshot/series.png deleted file mode 100644 index 70e1b28e1..000000000 Binary files a/screenshot/series.png and /dev/null differ diff --git a/screenshot/settings.png b/screenshot/settings.png deleted file mode 100644 index 84508c156..000000000 Binary files a/screenshot/settings.png and /dev/null differ diff --git a/screenshot/system.png b/screenshot/system.png deleted file mode 100644 index cb795ab1c..000000000 Binary files a/screenshot/system.png and /dev/null differ diff --git a/screenshot/wanted.png b/screenshot/wanted.png deleted file mode 100644 index 4da27a4c3..000000000 Binary files a/screenshot/wanted.png and /dev/null differ diff --git a/views/settings.tpl b/views/settings.tpl index 84b23370b..bdbbff1fb 100644 --- a/views/settings.tpl +++ b/views/settings.tpl @@ -1059,9 +1059,6 @@
Subtitles providers
-
-

Be aware that the more providers you enable, the longer it will take everytime you search for a subtitles.

-
diff --git a/views/wizard.tpl b/views/wizard.tpl index 0ab7ecd0a..85ef4a9f9 100644 --- a/views/wizard.tpl +++ b/views/wizard.tpl @@ -337,9 +337,6 @@
Subtitles providers
-
-

Be aware that the more providers you enable, the longer it will take everytime you search for a subtitles.

-