Various small fixes and improvements (#553)
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Mon, 20 Mar 2023 09:18:30 +0000 (10:18 +0100)
committerGitHub <noreply@github.com>
Mon, 20 Mar 2023 09:18:30 +0000 (10:18 +0100)
music_assistant/server/providers/filesystem_local/base.py
music_assistant/server/providers/ytmusic/__init__.py

index 014a276c2ebf081bbb26784c4f34b4ebf5a35bd8..b1eceda5d41068a140e9dd5fb851bd2681995da0 100644 (file)
@@ -291,6 +291,8 @@ class FileSystemProviderBase(MusicProvider):
                     # playlist is always in-library
                     playlist.in_library = True
                     await self.mass.music.playlists.add_db_item(playlist)
+            except MusicAssistantError as err:
+                self.logger.error("Error processing %s - %s", item.path, str(err))
             except Exception as err:  # pylint: disable=broad-except
                 # we don't want the whole sync to crash on one file so we catch all exceptions here
                 self.logger.exception("Error processing %s - %s", item.path, str(err))
@@ -409,7 +411,7 @@ class FileSystemProviderBase(MusicProvider):
                     ]
                 else:
                     # default action is to skip the track
-                    raise InvalidDataError(f"{file_item.path} is missing ID3 tag [albumartist]")
+                    raise InvalidDataError("missing ID3 tag [albumartist]")
 
             track.album = await self._parse_album(
                 tags.album,
index f76dbbbd41aa7296e0da12696e38c1469802695f..0cdf7349686fe0831d015e8aec1da9a5a4d9f4ce 100644 (file)
@@ -545,7 +545,12 @@ class YoutubeMusicProvider(MusicProvider):
             )
         )
         if authors := playlist_obj.get("author"):
-            playlist.owner = authors[0]["name"] if isinstance(authors, list) else authors["name"]
+            if isinstance(authors, str):
+                playlist.owner = authors
+            elif isinstance(authors, list):
+                playlist.owner = authors[0]["name"]
+            else:
+                playlist.owner = authors["name"]
         else:
             playlist.owner = self.instance_id
         playlist.metadata.checksum = playlist_obj.get("checksum")