Refresh MA playlist with script #2403
-
Is it possible to trigger a refresh of the random playlists (random artist from library/random album) from a script/automation? I have programmed a shelly button in my kitchen to start the random artist on my kitchen chromecast audio. Works like a charm, double click it and it starts a spotify pop list for my wife. Tripple click it and it starts random artist from library for me. The thing is that I always not satisfied with the first pick of artist. Therefore I want to clear the cue and refresh the playlist then repopulate with the next random artist. I have managed it to work exept it doesen't change artist until either the time triggers it or I manually reset it in the webview. Also I really like MA, great work everyone involved! |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 17 replies
-
Not at the moment but you could do something like this https://music-assistant.io/faq/how-to/#play-a-random-item |
Beta Was this translation helpful? Give feedback.
-
I have a similar request to update the playlist, I'm using https://basyl.stream/ - excellent spotify playlists, but they are 'running with the day' so to say, so I need to refresh the playlist every time before starting a new play. Adding a refresh service call would be amazing, I can also imagine people using collaborative playlists would like that too, or other 'real time' playlists. |
Beta Was this translation helpful? Give feedback.
-
I have the same need for Navidrome Smart/dynamic playlists. |
Beta Was this translation helpful? Give feedback.
-
While it will take some time to properly document it MA has an extensive API. This can be used to refresh the playlist. Here is an example:
You may need to adjust the URL and item_id. If you have port 8095 exposed via the MA webserver settings then the above will work. If not then try http://d5369777-music-assistant:8095/api To get the item_id use |
Beta Was this translation helpful? Give feedback.
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
Question: Is the rest_command solution for the refresh playlist still available on the 2.5.8 version of Music Assistant? content: | <title>500 Internal Server Error</title>500 Internal Server ErrorServer got itself in trouble status: 500 headers: Content-Type: text/html; charset=utf-8 Content-Length: "145" Date: Thu, 04 Sep 2025 09:31:01 GMT Server: Python/3.13 aiohttp/3.12.15 Connection: close |
Beta Was this translation helpful? Give feedback.
Thanks!
The
.name
did it and I had the wrong syntax for calling helpers. Now I set up a input_select to randomly fetch my manually added favorites from and store in a helper (then I can also edit it from UI) and then do a mass search for random album. Works great. Also I did one more script for artist radio.Random artist from input select and mass album search: