Repository: music-assistant/support

Issue #108: AttributeError: 'NoneType' object has no attribute 'musicbrainz_id'
Created: 2022-05-10T07:55:02Z
Hi! I'm trying to make Hass Music Assistant to work on single mp3 file in a specific folder. The mp3 file is tagged with Song Title, Artist and Album. I have configured nothing as a music provider but filesystem provider and typed the folder containing that mp3 file. I get this error in the logs:
2022-05-10 09:31:43 ERROR (MainThread) [music_assistant.mass] Job [Library sync of tracks for provider Filesystem] failed with error 'NoneType' object has no attribute 'musicbrainz_id'.
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/__init__.py", line 397, in _library_items_sync
    db_item = await controller.add_db_item(prov_item)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/tracks.py", line 145, in add_db_item
    or await self.mass.music.albums.add_db_item(track.album)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/albums.py", line 121, in add_db_item
    if album.artist.musicbrainz_id and album.artist.provider != "database":
AttributeError: 'NoneType' object has no attribute 'musicbrainz_id'

It came out that this was due to missing infos in the id3 tag. As a minimum requirement, it looks like that you need at least the following:
Song Title:	SongTitle
Artist:		ArtistName
Album:		AlbumName
Track:		5
Year:		2022
so that it gets the proper musicbrainz_id. A software like MusicBrainz Picard could be used to properly tag the mp3s.
I did not find specific details in the docs, maybe this should be added :)

Duplicate issue #113: Parsing local files stopped after a few minutes
Created: 2022-05-10T09:14:19Z
I have a large local collection and just configured them in. The parsing stopped after ca 2 minutes with these errors:

Clearly my ID3 tags are not fit to import (many files skipped). But here the detailed log:
...
2022-05-10 11:00:55 WARNING (MainThread) [music_assistant.mass.music.filesystem] Skipping track due to invalid ID3 tags: /media/Albums/Type O Negative/Type o negative - Out of fire.mp3
2022-05-10 11:01:07 WARNING (MainThread) [music_assistant.mass.music.filesystem] Skipping track due to invalid ID3 tags: /media/Albums/Behemoth/2004 -Demigod/01 - Behemoth - Sculpting the throne ov Seth.mp3
2022-05-10 11:01:07 WARNING (MainThread) [music_assistant.mass.music.filesystem] Skipping track due to invalid ID3 tags: /media/Albums/Behemoth/2004 -Demigod/01 - Behemoth - Sculpting the throne ov Seth.mp3
2022-05-10 11:01:07 WARNING (MainThread) [music_assistant.mass.music.filesystem] Skipping track due to invalid ID3 tags: /media/Albums/Behemoth/2004 -Demigod/01 - Behemoth - Sculpting the throne ov Seth.mp3
2022-05-10 11:01:25 ERROR (MainThread) [music_assistant.mass] Job [Library sync of albums for provider Filesystem] failed with error 'NoneType' object has no attribute 'musicbrainz_id'.
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/__init__.py", line 397, in _library_items_sync
    db_item = await controller.add_db_item(prov_item)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/albums.py", line 121, in add_db_item
    if album.artist.musicbrainz_id and album.artist.provider != "database":
AttributeError: 'NoneType' object has no attribute 'musicbrainz_id'
2022-05-10 11:01:25 ERROR (MainThread) [music_assistant.mass] Job [Library sync of tracks for provider Filesystem] failed with error 'NoneType' object has no attribute 'musicbrainz_id'.
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/__init__.py", line 397, in _library_items_sync
    db_item = await controller.add_db_item(prov_item)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/tracks.py", line 145, in add_db_item
    or await self.mass.music.albums.add_db_item(track.album)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/albums.py", line 121, in add_db_item
    if album.artist.musicbrainz_id and album.artist.provider != "database":
AttributeError: 'NoneType' object has no attribute 'musicbrainz_id'
2022-05-10 11:01:26 WARNING (MainThread) [music_assistant.mass.metadata] Unable to get musicbrainz ID for artist Madonna !
2022-05-10 11:01:30 WARNING (MainThread) [music_assistant.mass.metadata] Unable to get musicbrainz ID for artist Original Soundtrack !
2022-05-10 11:01:36 WARNING (MainThread) [music_assistant.mass.metadata] Unable to get musicbrainz ID for artist  !
2022-05-10 11:01:36 ERROR (MainThread) [music_assistant.mass.audiodb] Failed to retrieve artist-mb.php
2022-05-10 11:01:36 ERROR (MainThread) [music_assistant.mass] Job [Library sync of artists for provider Filesystem] failed with error .
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/__init__.py", line 390, in _library_items_sync
    db_item = await controller.get(
  File "/usr/local/lib/python3.9/site-packages/music_assistant/models/media_controller.py", line 68, in get
    return await self.add(details)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/artists.py", line 67, in add
    db_item = await self.add_db_item(item)
  File "/usr/local/lib/python3.9/site-packages/music_assistant/controllers/music/artists.py", line 120, in add_db_item
    assert artist.musicbrainz_id
AssertionError

Closing comment (2022-05-10T09:16:52Z): duplicate of #108
I'm going to work on the files provider this afternoon. I need to proper guard it for the not so happy flow cases where a tag is missing etc. To be continued!
Thanks for the patience and help testing!!