diff --git a/get_subtitle.py b/get_subtitle.py index 58c2ffc2b..926d23341 100644 --- a/get_subtitle.py +++ b/get_subtitle.py @@ -34,7 +34,7 @@ def download_subtitle(path, language, hi, providers, providers_auth, sceneName, lang_obj = Language(language) try: - if sceneName is None or use_scenename == "False": + if sceneName is None or use_scenename is False: used_sceneName = False video = scan_video(path) else: @@ -79,7 +79,7 @@ def download_subtitle(path, language, hi, providers, providers_auth, sceneName, else: message = downloaded_language + " subtitles downloaded from " + downloaded_provider + " with a score of " + unicode(score) + "% using filename guessing." - if use_postprocessing == "True": + if use_postprocessing is True: command = pp_replace(postprocessing_cmd, path, downloaded_path, downloaded_language, downloaded_language_code2, downloaded_language_code3) try: if os.name == 'nt': @@ -109,7 +109,7 @@ def download_subtitle(path, language, hi, providers, providers_auth, sceneName, return message def series_download_subtitles(no): - if get_general_settings()[24] == "True": + if get_general_settings()[24] is True: monitored_only_query_string = ' AND monitored = "True"' else: monitored_only_query_string = "" @@ -129,7 +129,7 @@ def series_download_subtitles(no): try: if provider[2] is not '' and provider[3] is not '': provider_auth = providers_auth.append(provider[0]) - provider_auth.update({'username':providers[2], 'password':providers[3]}) + provider_auth.update({'username':provider[2], 'password':provider[3]}) else: providers_auth = None except: @@ -164,7 +164,7 @@ def movies_download_subtitles(no): try: if provider[2] is not '' and provider[3] is not '': provider_auth = providers_auth.append(provider[0]) - provider_auth.update({'username': providers[2], 'password': providers[3]}) + provider_auth.update({'username': provider[2], 'password': provider[3]}) else: providers_auth = None except: @@ -198,7 +198,7 @@ def wanted_download_subtitles(path): try: if provider[2] is not '' and provider[3] is not '': provider_auth = providers_auth.append(provider[0]) - provider_auth.update({'username':providers[2], 'password':providers[3]}) + provider_auth.update({'username':provider[2], 'password':provider[3]}) else: providers_auth = None except: @@ -232,7 +232,7 @@ def wanted_download_subtitles_movie(path): try: if provider[2] is not '' and provider[3] is not '': provider_auth = providers_auth.append(provider[0]) - provider_auth.update({'username': providers[2], 'password': providers[3]}) + provider_auth.update({'username': provider[2], 'password': provider[3]}) else: providers_auth = None except: @@ -257,7 +257,7 @@ def wanted_search_missing_subtitles(): db.create_function("path_substitution_movie", 1, path_replace_movie) c = db.cursor() - if get_general_settings()[24] == "True": + if get_general_settings()[24] is True: monitored_only_query_string = ' AND monitored = "True"' else: monitored_only_query_string = "" @@ -272,11 +272,11 @@ def wanted_search_missing_subtitles(): integration = get_general_settings() - if integration[12] == "True": + if integration[12] is True: for episode in episodes: wanted_download_subtitles(episode[0]) - if integration[13] == "True": + if integration[13] is True: for movie in movies: wanted_download_subtitles_movie(movie[0])