From bd16279601c8a0763102ac8ad0cb862cc903ea36 Mon Sep 17 00:00:00 2001 From: Michiel van Baak Jansen Date: Sun, 2 May 2021 14:02:16 +0200 Subject: [PATCH] In some places the variable 'profile_id' holds the value 'null' where the code expects an int or None (#1395) --- bazarr/database.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bazarr/database.py b/bazarr/database.py index c5a1f3727..abfd3583b 100644 --- a/bazarr/database.py +++ b/bazarr/database.py @@ -293,7 +293,7 @@ def get_profiles_list(profile_id=None): if not len(profile_id_list): update_profile_id_list() - if profile_id: + if profile_id and profile_id != 'null': for profile in profile_id_list: if profile['profileId'] == profile_id: return profile @@ -307,7 +307,7 @@ def get_desired_languages(profile_id): if not len(profile_id_list): update_profile_id_list() - if profile_id: + if profile_id and profile_id != 'null': for profile in profile_id_list: profileId, name, cutoff, items = profile.values() if profileId == int(profile_id): @@ -323,7 +323,7 @@ def get_profile_id_name(profile_id): if not len(profile_id_list): update_profile_id_list() - if profile_id: + if profile_id and profile_id != 'null': for profile in profile_id_list: profileId, name, cutoff, items = profile.values() if profileId == int(profile_id): @@ -339,7 +339,7 @@ def get_profile_cutoff(profile_id): if not len(profile_id_list): update_profile_id_list() - if profile_id: + if profile_id and profile_id != 'null': cutoff_language = [] for profile in profile_id_list: profileId, name, cutoff, items = profile.values()