Prevent overwriting album_tracks table (#1388)
authorMelvyn Harbour <melharbour@gmail.com>
Wed, 19 Jun 2024 09:26:21 +0000 (10:26 +0100)
committerGitHub <noreply@github.com>
Wed, 19 Jun 2024 09:26:21 +0000 (11:26 +0200)
music_assistant/server/controllers/media/tracks.py

index 40402af65a3967b8872730f244dc0d9a6ec3b1b6..2850dc8d3bc9d33f96aad207df582f7322bfc8c2 100644 (file)
@@ -410,16 +410,6 @@ class TracksController(MediaControllerBase[Track]):
         For digital releases, the discnumber will be just 0 or 1.
         Track number should start counting at 1.
         """
-        if overwrite and album.provider.startswith("filesystem"):
-            # on overwrite, clear the album_tracks table first
-            # this is done for filesystem providers only (to account for changing ID3 tags)
-            # TODO: find a better way to deal with this as this doesn't cover all (edge) cases
-            await self.mass.music.database.delete(
-                DB_TABLE_ALBUM_TRACKS,
-                {
-                    "track_id": db_id,
-                },
-            )
         db_album: Album | ItemMapping = None
         if album.provider == "library":
             db_album = album