diff options
author | morpheus65535 <[email protected]> | 2023-11-10 13:57:56 -0500 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2023-11-10 13:57:56 -0500 |
commit | cb3a274894ca43aea9cee919bcc264197a729c23 (patch) | |
tree | 1321a7fca09e1df862ac19095d70385903880089 | |
parent | b87aef8763d94f384a8142394ee6534b08a5e4b4 (diff) | |
download | bazarr-cb3a274894ca43aea9cee919bcc264197a729c23.tar.gz bazarr-cb3a274894ca43aea9cee919bcc264197a729c23.zip |
Fixed languages profile creation issue.
-rw-r--r-- | bazarr/api/system/settings.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bazarr/api/system/settings.py b/bazarr/api/system/settings.py index af722dcd3..103df6304 100644 --- a/bazarr/api/system/settings.py +++ b/bazarr/api/system/settings.py @@ -6,6 +6,7 @@ from flask import request, jsonify from flask_restx import Resource, Namespace from dynaconf.validator import ValidationError +from api.utils import None_Keys from app.database import TableLanguagesProfiles, TableSettingsLanguages, TableSettingsNotifier, \ update_profile_id_list, database, insert, update, delete, select from app.event_handler import event_stream @@ -66,11 +67,12 @@ class SystemSettings(Resource): update(TableLanguagesProfiles) .values( name=item['name'], - cutoff=item['cutoff'] if item['cutoff'] != 'null' else None, + cutoff=item['cutoff'] if item['cutoff'] not in None_Keys else None, items=json.dumps(item['items']), mustContain=str(item['mustContain']), mustNotContain=str(item['mustNotContain']), - originalFormat=int(item['originalFormat']) if item['originalFormat'] != 'null' else None, + originalFormat=int(item['originalFormat']) if item['originalFormat'] not in None_Keys else + None, ) .where(TableLanguagesProfiles.profileId == item['profileId'])) existing.remove(item['profileId']) @@ -81,11 +83,12 @@ class SystemSettings(Resource): .values( profileId=item['profileId'], name=item['name'], - cutoff=item['cutoff'] if item['cutoff'] != 'null' else None, + cutoff=item['cutoff'] if item['cutoff'] not in None_Keys else None, items=json.dumps(item['items']), mustContain=str(item['mustContain']), mustNotContain=str(item['mustNotContain']), - originalFormat=int(item['originalFormat']) if item['originalFormat'] != 'null' else None, + originalFormat=int(item['originalFormat']) if item['originalFormat'] not in None_Keys else + None, )) for profileId in existing: # Remove deleted profiles |