Fix error when items are deleted from file provider (#377)
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Sun, 19 Jun 2022 22:07:32 +0000 (00:07 +0200)
committerGitHub <noreply@github.com>
Sun, 19 Jun 2022 22:07:32 +0000 (00:07 +0200)
music_assistant/music_providers/filesystem.py

index 9680a8e959f49f2de1bb6979f396ba381c5e8524..aa9162d073907a015a9a42e2e19d7512febe2d38 100644 (file)
@@ -248,7 +248,7 @@ class FileSystemProvider(MusicProvider):
             if album_tracks:
                 continue
             # album has no more tracks attached, delete prov mapping
-            await self.mass.music.albums.remove_prov_mapping(album_id)
+            await self.mass.music.albums.remove_prov_mapping(album_id, self.id)
         # check if artists are deleted
         for artist_id in artists:
             artist = await self.mass.music.artists.get_db_item(artist_id)
@@ -262,7 +262,7 @@ class FileSystemProvider(MusicProvider):
             if artist_albums:
                 continue
             # artist has no more tracks attached, delete prov mapping
-            await self.mass.music.artists.remove_prov_mapping(artist_id)
+            await self.mass.music.artists.remove_prov_mapping(artist_id, self.id)
 
     async def get_artist(self, prov_artist_id: str) -> Artist:
         """Get full artist details by id."""