diff options
author | morpheus65535 <[email protected]> | 2022-04-30 08:48:19 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2022-04-30 08:48:19 -0400 |
commit | 9be3674f3a08a64aa4d11d9a28cf79dbc14fc2e0 (patch) | |
tree | 099a868c01ea0524894988ec52accc5db6ef3f60 | |
parent | f074114995f556e841faa035886b7590bb3d7084 (diff) | |
download | bazarr-1.0.4.tar.gz bazarr-1.0.4.zip |
no log: fixed issue with profile_id_listv1.0.4
-rw-r--r-- | bazarr/database.py | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/bazarr/database.py b/bazarr/database.py index a134366a1..f06fb3445 100644 --- a/bazarr/database.py +++ b/bazarr/database.py @@ -398,7 +398,6 @@ def get_exclusion_clause(exclusion_type): def update_profile_id_list(): - global profile_id_list profile_id_list = TableLanguagesProfiles.select(TableLanguagesProfiles.profileId, TableLanguagesProfiles.name, TableLanguagesProfiles.cutoff, @@ -412,12 +411,11 @@ def update_profile_id_list(): profile['mustContain'] = ast.literal_eval(profile['mustContain']) if profile['mustContain'] else [] profile['mustNotContain'] = ast.literal_eval(profile['mustNotContain']) if profile['mustNotContain'] else [] + return profile_id_list + def get_profiles_list(profile_id=None): - try: - len(profile_id_list) - except NameError: - update_profile_id_list() + profile_id_list = update_profile_id_list() if profile_id and profile_id != 'null': for profile in profile_id_list: @@ -429,9 +427,7 @@ def get_profiles_list(profile_id=None): def get_desired_languages(profile_id): languages = [] - - if not len(profile_id_list): - update_profile_id_list() + profile_id_list = update_profile_id_list() if profile_id and profile_id != 'null': for profile in profile_id_list: @@ -445,9 +441,7 @@ def get_desired_languages(profile_id): def get_profile_id_name(profile_id): name_from_id = None - - if not len(profile_id_list): - update_profile_id_list() + profile_id_list = update_profile_id_list() if profile_id and profile_id != 'null': for profile in profile_id_list: @@ -461,9 +455,7 @@ def get_profile_id_name(profile_id): def get_profile_cutoff(profile_id): cutoff_language = None - - if not len(profile_id_list): - update_profile_id_list() + profile_id_list = update_profile_id_list() if profile_id and profile_id != 'null': cutoff_language = [] |