Fix removal of a provider (#1594)
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Thu, 22 Aug 2024 11:10:47 +0000 (13:10 +0200)
committerGitHub <noreply@github.com>
Thu, 22 Aug 2024 11:10:47 +0000 (13:10 +0200)
music_assistant/server/controllers/media/base.py

index a326bca48f360a991fd18a5d3699a8b9f1fcc60e..25028ccd6ab81b4cd8f3206dbcc17e1f83d92d78 100644 (file)
@@ -595,13 +595,6 @@ class MediaControllerBase(Generic[ItemCls], metaclass=ABCMeta):
             },
         )
         if library_item.provider_mappings:
-            # we (temporary?) duplicate the provider mappings in a separate column of the media
-            # item's table, because the json_group_array query is superslow
-            await self.mass.music.database.update(
-                self.db_table,
-                {"item_id": db_id},
-                {"provider_mappings": serialize_to_json(library_item.provider_mappings)},
-            )
             self.logger.debug(
                 "removed provider_mapping %s/%s from item id %s",
                 provider_instance_id,
@@ -638,13 +631,6 @@ class MediaControllerBase(Generic[ItemCls], metaclass=ABCMeta):
             x for x in library_item.provider_mappings if x.provider_instance != provider_instance_id
         }
         if library_item.provider_mappings:
-            # we (temporary?) duplicate the provider mappings in a separate column of the media
-            # item's table, because the json_group_array query is superslow
-            await self.mass.music.database.update(
-                self.db_table,
-                {"item_id": db_id},
-                {"provider_mappings": serialize_to_json(library_item.provider_mappings)},
-            )
             self.logger.debug(
                 "removed all provider mappings for provider %s from item id %s",
                 provider_instance_id,