From 5feb806ab0c8b040e81c41aec2ae674de240f587 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Sat, 24 Aug 2024 01:02:30 +0200 Subject: [PATCH] fix playlist info not getting overwritten --- music_assistant/server/controllers/media/playlists.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/music_assistant/server/controllers/media/playlists.py b/music_assistant/server/controllers/media/playlists.py index 5acb121d4..5fbf96260 100644 --- a/music_assistant/server/controllers/media/playlists.py +++ b/music_assistant/server/controllers/media/playlists.py @@ -313,19 +313,17 @@ async def _update_library_item( {"item_id": db_id}, { # always prefer name/owner from updated item here - "name": update.name if overwrite else cur_item.name, + "name": update.name, "sort_name": update.sort_name - if overwrite - else cur_item.sort_name or update.sort_name, + if (overwrite or update.name != cur_item.name) + else cur_item.sort_name, "owner": update.owner or cur_item.owner, "is_editable": update.is_editable, "metadata": serialize_to_json(metadata), "external_ids": serialize_to_json( update.external_ids if overwrite else cur_item.external_ids ), - "cache_checksum": update.cache_checksum - if overwrite - else update.cache_checksum or cur_item.cache_checksum, + "cache_checksum": update.cache_checksum or cur_item.cache_checksum, }, ) # update/set provider_mappings table