mass_queue icon indicating copy to clipboard operation
mass_queue copied to clipboard

Clear Queue from Here

Open subatomiq opened this issue 1 year ago • 4 comments

Hi thanks for this handy utility Currently when clearing the queue in Music Assistant it just nukes everything and stops playing immediately. Would it be possible for mass_queue to add a function to "Clear Playlist from Here" ?

i.e. truncating from the specified track onwards, and not stopping the currently playing track, so it could finish gracefully if it was the last track?

subatomiq avatar Sep 17 '25 23:09 subatomiq

That's not something that can be done - the MA API doesn't have an endpoint to remove all.

As a workaround, you could try adding an item to the player queue and choose the enqueue option "Play Next and Clear Queue".

droans avatar Sep 18 '25 01:09 droans

Another idea here is that you could iterate over the "remove from queue" and remove anything below the targeted song. I'm doing that for another use case with this library and it appears to be working fine.

coltoneshaw avatar Nov 01 '25 12:11 coltoneshaw

oh thank you so much @coltoneshaw this suggestion 100% helped me to create a HA script that performs the result i was hoping for. So i'm a happy camper.

@droans it would be a great bonus if it could be added as a native function of Music Assistant Queue Actions

subatomiq avatar Nov 02 '25 01:11 subatomiq

I've added it in the v0.8.0-b1 beta.

I don't think this will provide a good experience, though. The integration will fire multiple events for each item that's removed. Anything which relies on these events - including the Music Assistant Player Card - will be bombarded. The Player Card will likely make an even worse experience as it continues requesting the updated queue from the integration.

droans avatar Nov 03 '25 16:11 droans