-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YouTube Music Not syncing #3485
Comments
@marcelveldt I see you added a new property to the Playlist object Could there be something missing in the serialisation of the Playlist object when inserting it into the database? |
Hey guys, while you are looking at this. Is there a reason why all items in the YTM library are brought in as favorites? (Songs, Albums, Artists, Playlists, etc). In my case, I like to add a lot of ablums to my library. Every track in every album is imported as a favorite in MASS (even if it wasnt a favorite in YTM). My preference would be to be able to use my discretion on what to favorite within MASS. Its a lot of work to unfavorite everything.... So either bring my YTM library in with no favorites in MASS, or only favorite the items that are favorites in YTM. Thoughts? Were you able to replicate the problem above on your library? I see that there was a new property added. Just curious if there is something unique to my library, or if it is causing issues in other libraries. FYI, I deleted everything out of my YTM library except for 3 user generated playlists, and still had the issue. |
@Doug411 is this still an issue in the latest beta (2.4.0 b20)? |
Update, managed to reproduce the issue. Will fix it. |
Much Thanks Marvin! I'm anxious to get my playlists back! : ) In addition to the playlists not syncing due to null.....Any thoughts on not favoriting all items when syncing YTM library? |
@OzGav Do you happen to know if this is default behaviour in MA, e.g. 'items in the provider's library are considered favourites?' I checked for YTM, and even though the |
What version of Music Assistant has the issue?
2.40b18
What version of the Home Assistant Integration have you got installed?
No response
Have you tried everything in the Troubleshooting FAQ and reviewed the Open and Closed Issues and Discussions to resolve this yourself?
The problem
My YTM provider stopped syncing. Its failing when attempting to sync playlists. It was working, and had synced all my YTM playlists previously
I verified that none of the playlists in YTM are empty.
I've compared inventory of playlists in my YTM library to my inventory of playlists in MA. They are the same. Most are YTM generated playlists (not created by me). They had all synced successfully in the past
Things I've tried.
This is an exerpt from the verbose log (I will attach the non-verbose one below). It seems to indicate there is a null value somewhere.
2025-01-21 12:37:33.673 INFO (MainThread) [music_assistant] Loaded music provider ytmusic
2025-01-21 12:37:33.687 DEBUG (MainThread) [music_assistant.ytmusic] Start sync of artist items.
2025-01-21 12:37:33.851 DEBUG (MainThread) [music_assistant.ytmusic] Start sync of album items.
2025-01-21 12:37:33.957 DEBUG (MainThread) [music_assistant.webserver] Handling command config/providers
2025-01-21 12:37:34.005 DEBUG (MainThread) [music_assistant.ytmusic] Start sync of track items.
2025-01-21 12:37:34.153 DEBUG (MainThread) [music_assistant.ytmusic] Start sync of playlist items.
2025-01-21 12:37:34.567 WARNING (MainThread) [music_assistant] Exception in task Task-216 - target: <coroutine object MusicController._start_provider_sync..run_sync at 0x7f56e65ceb40>: NOT NULL constraint failed: playlists.is_editable
Traceback (most recent call last):
File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/music.py", line 931, in run_sync
await provider.sync_library(media_types)
File "/app/venv/lib/python3.12/site-packages/music_assistant/models/music_provider.py", line 616, in sync_library
library_item = await controller.add_item_to_library(prov_item)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/media/base.py", line 127, in add_item_to_library
library_id = await self._add_library_item(item)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/media/playlists.py", line 283, in _add_library_item
db_id = await self.mass.music.database.insert(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/music_assistant/helpers/database.py", line 179, in insert
row_id = await self._db.execute_insert(sql_query, values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/aiosqlite/core.py", line 203, in execute_insert
return await self._execute(self._execute_insert, sql, parameters)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/aiosqlite/core.py", line 132, in _execute
return await future
^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/aiosqlite/core.py", line 115, in run
result = function()
^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/aiosqlite/core.py", line 88, in _execute_insert
cursor = self._conn.execute(sql, parameters)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sqlite3.IntegrityError: NOT NULL constraint failed: playlists.is_editable
2025-01-21 12:37:34.567 WARNING (MainThread) [music_assistant.music] Sync task for YouTube Music completed with errors
Traceback (most recent call last):
File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/music.py", line 931, in run_sync
await provider.sync_library(media_types)
File "/app/venv/lib/python3.12/site-packages/music_assistant/models/music_provider.py", line 616, in sync_library
library_item = await controller.add_item_to_library(prov_item)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/media/base.py", line 127, in add_item_to_library
library_id = await self._add_library_item(item)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/media/playlists.py", line 283, in _add_library_item
db_id = await self.mass.music.database.insert(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/music_assistant/helpers/database.py", line 179, in insert
row_id = await self._db.execute_insert(sql_query, values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/aiosqlite/core.py", line 203, in execute_insert
return await self._execute(self._execute_insert, sql, parameters)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/aiosqlite/core.py", line 132, in _execute
return await future
^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/aiosqlite/core.py", line 115, in run
result = function()
^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/aiosqlite/core.py", line 88, in _execute_insert
cursor = self._conn.execute(sql, parameters)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sqlite3.IntegrityError: NOT NULL constraint failed: playlists.is_editable
How to reproduce
Sync YTM
Music Providers
Sirius
YTM
Audiobookshelf
RadioBrowser
Jellyfin
Player Providers
Chromecast
Full log output
music-assistant-log.pdf
Additional information
No response
What version of Home Assistant Core are your running
2025.1.3
What type of installation are you running?
Home Assistant OS
On what type of hardware are you running?
Generic x86-64 (e.g. Intel NUC)
The text was updated successfully, but these errors were encountered: