We have moved at community.getvera.com

Author Topic: Sonos queue management  (Read 10200 times)

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos queue management
« Reply #15 on: March 03, 2013, 05:54:04 am »
I discovered a little bug: "CLEAR_QUEUE" should work even if the URI is not provided.
Will be fixed later.

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos queue management
« Reply #16 on: March 04, 2013, 02:57:10 pm »
I discovered a little bug: "CLEAR_QUEUE" should work even if the URI is not provided.
Will be fixed later.

"CLEAR_QUEUE" type has now been suppressed.
RemoveAllTracksFromQueue callback can be easily used for the same result.

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos queue management
« Reply #17 on: March 05, 2013, 04:13:26 pm »
New changes have been done (in the trunk): http://forum.micasaverde.com/index.php/topic,8505.msg104965.html#msg104965

To enqueue (and play) a URI, you must now use EnqueueURI. PlayURI is only for playing without enqueuing.

Note that action name or parameters names could change again.

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos queue management
« Reply #18 on: March 16, 2013, 03:50:57 pm »
Using qobuz service, I discovered a bug relative to the queue restore.
qobuz is using the queue.
When restoring the queue (for example when using action Say or Alert actions), nothing is lost and the queue is resumed but all information on the queue items are lost.
I will provide a fix later.

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos queue management
« Reply #19 on: March 18, 2013, 05:41:02 pm »
For information, parameters EnqueuedURIs and EnqueuedURIsMetaData for action AddMultipleURIsToQueue are list of values separated by a blank (space).

For the restore of the queue, I will probably replace the use of multiple calls of action AddURIToQueue by a unique call to action AddMultipleURIsToQueue. It will be more efficient I imagine.

Offline Ds514

  • Full Member
  • ***
  • Posts: 189
  • Karma: +2/-0
  • Because automatic.
Re: Sonos queue management
« Reply #20 on: December 18, 2013, 04:26:52 pm »
"CLEAR_QUEUE" type has now been suppressed.
RemoveAllTracksFromQueue callback can be easily used for the same result.

To enqueue (and play) a URI, you must now use EnqueueURI. PlayURI is only for playing without enqueuing.

Hi Lolodomo,

Thanks again for this plugin. I am looking for some help with a Sonos action that occurs nightly as part of a scene, always playing the same Sonos playlist.

When I use "PlayURI", I find that the playlist is being queued. Unless I manually delete this on occasion, the queue would grow indefinitely, and I am concerned that this may cause issues down the road. What I would like to do is be able to clear the device's queue each night just prior to running the PlayURI. I am not certain how to call the RemoveAllTracksFromQueue action, or if that is still active.

Is deletion of the queue or avoidance of appending the queue still a possibility in the plugin?

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos queue management
« Reply #21 on: December 19, 2013, 07:34:12 pm »
[quote author=lolodomo link=topic=13842.msg104813#msg104813 date=136242703Hi Lolodomo,

Thanks again for this plugin. I am looking for some help with a Sonos action that occurs nightly as part of a scene, always playing the same Sonos playlist.

When I use "PlayURI", I find that the playlist is being queued. Unless I manually delete this on occasion, the queue would grow indefinitely, and I am concerned that this may cause issues down the road. What I would like to do is be able to clear the device's queue each night just prior to running the PlayURI. I am not certain how to call the RemoveAllTracksFromQueue action, or if that is still active.

Is deletion of the queue or avoidance of appending the queue still a possibility in the plugin?

A recent Sonos firmware update now constraints to put the playlist items in the queue.
I have not thought about that but you're right, that's a problem because the queue will grow up each time you launch a Sonos playlist.
Your solution with a call to RemoveAllTracksFromQueue before calling PlayURI will work. But of course you will loose all your queue. An alternative with a unique call would be to simply replace call to PlayURI with a call to the action EnqueueURI with parameter EnqueueMode set to REPLACE_QUEUE_AND_PLAY and of course the same URI.

Offline Ds514

  • Full Member
  • ***
  • Posts: 189
  • Karma: +2/-0
  • Because automatic.
Re: Sonos queue management
« Reply #22 on: December 19, 2013, 08:42:21 pm »
Lolodomo, that appears to have solved it, thank you.

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos queue management
« Reply #23 on: December 22, 2013, 04:20:27 am »
Should I change the behaviour in PayURI to replace the queue rather than appending at the end of the queue ?
What's your feeling ?

Offline Ds514

  • Full Member
  • ***
  • Posts: 189
  • Karma: +2/-0
  • Because automatic.
Re: Sonos queue management
« Reply #24 on: December 22, 2013, 06:32:15 pm »
Lolodomo, given the simplicity of using REPLACE_QUEUE_AND_PLAY, I don't think that would be a critical addition. However, unless I am mistaken, it seems that the default action of PlayURI and EnqueueURI are currently the same. If the modification is not difficult, this would make the plugin more versatile.

Offline Ds514

  • Full Member
  • ***
  • Posts: 189
  • Karma: +2/-0
  • Because automatic.
Re: Sonos queue management
« Reply #25 on: December 23, 2013, 12:48:38 pm »
Lolodomo,

If the PlayURI command is used, could I then specify REPEAT_ALL as the enqueue mode?

If yes, then I would certainly vote to have PlayURI revert to a replace queue and play function.

If no, is there some way to call this command in the context of what I am doing (i.e., eliminate existing queue, set device to place a new queue, plus set the repeat all command)?

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos queue management
« Reply #26 on: December 26, 2013, 08:04:11 am »
Lolodomo,

If the PlayURI command is used, could I then specify REPEAT_ALL as the enqueue mode?

If yes, then I would certainly vote to have PlayURI revert to a replace queue and play function.

If no, is there some way to call this command in the context of what I am doing (i.e., eliminate existing queue, set device to place a new queue, plus set the repeat all command)?

I changed SetURIToPlay / PlayURI to a replace queue.

Regarding repeat mode, you have to use the action SetPlayMode after loading your playlist. I would recommend in this case to use SetURIToPlay  then SetPlayMode  then Play
« Last Edit: December 26, 2013, 08:14:27 am by lolodomo »

Offline Ds514

  • Full Member
  • ***
  • Posts: 189
  • Karma: +2/-0
  • Because automatic.
Re: Sonos queue management
« Reply #27 on: December 29, 2013, 07:42:59 pm »
Thanks for this lolodomo. Am I correct in understanding that this change was incorporated into the Beta2 files? When looking for the files here, I could not see an update.

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos queue management
« Reply #28 on: December 30, 2013, 06:07:38 am »
Thanks for this lolodomo. Am I correct in understanding that this change was incorporated into the Beta2 files? When looking for the files here, I could not see an update.

No, I don't change a already released version.
You can find my "working in progress" version in the trunk: http://code.mios.com/trac/mios_sonos-wireless-music-systems/browser/trunk#