Fix Artist logo images from TheAudioDb
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Fri, 3 Oct 2025 18:42:10 +0000 (20:42 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Fri, 3 Oct 2025 18:42:10 +0000 (20:42 +0200)
music_assistant/controllers/metadata.py

index 551379ec81faac523cc3afc40d886d64bdde98a3..b28c6b9e22a50fe6de5aa6a2edefea79531b37d8 100644 (file)
@@ -186,14 +186,13 @@ class MetaDataController(CoreController):
         # just run the scan for missing metadata once at startup
         # background scan for missing metadata
         self.mass.call_later(300, self._scan_missing_metadata)
-        # migrate old image path for collage images from absolute to relative
-        # TODO: remove this after 2.5+ release
-        old_path = f"{self.mass.storage_path}/collage_images/"
-        new_path = "/collage/"
+        # migrate theaudiodb images to new url
+        # they updated their cdn url to r2.theaudiodb.com
+        # TODO: remove this after 2.7 release
         query = (
-            "UPDATE playlists SET metadata = "
-            f"REPLACE (metadata, '{old_path}', '{new_path}') "
-            f"WHERE playlists.metadata LIKE '%{old_path}%'"
+            "UPDATE artists SET metadata = "
+            "REPLACE (metadata, 'https://www.theaudiodb.com', 'https://r2.theaudiodb.com') "
+            "WHERE artists.metadata LIKE '%https://www.theaudiodb.com%'"
         )
         if self.mass.music.database:
             await self.mass.music.database.execute(query)