Fix new playlists get corrupted (#1590)
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Thu, 22 Aug 2024 05:59:47 +0000 (07:59 +0200)
committerGitHub <noreply@github.com>
Thu, 22 Aug 2024 05:59:47 +0000 (07:59 +0200)
due to leftover redundant column

music_assistant/server/controllers/music.py

index 01cdc06cc776ad7f6276a4e1b6fee420f2b99b44..90dded007f0aedd4a7c776d64fac1cfec26a01e2 100644 (file)
@@ -73,7 +73,7 @@ DEFAULT_SYNC_INTERVAL = 3 * 60  # default sync interval in minutes
 CONF_SYNC_INTERVAL = "sync_interval"
 CONF_DELETED_PROVIDERS = "deleted_providers"
 CONF_ADD_LIBRARY_ON_PLAY = "add_library_on_play"
-DB_SCHEMA_VERSION: Final[int] = 7
+DB_SCHEMA_VERSION: Final[int] = 8
 
 
 class MusicController(CoreController):
@@ -1058,9 +1058,15 @@ class MusicController(CoreController):
             await self.__create_database_tables()
             return
 
-        if prev_version <= 6:
+        if prev_version <= 7:
             # remove redundant artists and provider_mappings columns
-            for table in (DB_TABLE_TRACKS, DB_TABLE_ALBUMS, DB_TABLE_ARTISTS, DB_TABLE_RADIOS):
+            for table in (
+                DB_TABLE_TRACKS,
+                DB_TABLE_ALBUMS,
+                DB_TABLE_ARTISTS,
+                DB_TABLE_RADIOS,
+                DB_TABLE_PLAYLISTS,
+            ):
                 for column in ("artists", "provider_mappings"):
                     try:
                         await self.database.execute(f"ALTER TABLE {table} DROP COLUMN {column}")