Skip to content

Commit

Permalink
Fixed languages profile creation issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus65535 committed Nov 10, 2023
1 parent b87aef8 commit cb3a274
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions bazarr/api/system/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
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
Expand Down Expand Up @@ -66,11 +67,12 @@ def post(self):
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'])
Expand All @@ -81,11 +83,12 @@ def post(self):
.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
Expand Down

0 comments on commit cb3a274

Please sign in to comment.