INTERACT FORUM

Windows => Plug-in Development => Topic started by: sarkonovich on December 27, 2016, 01:50:55 pm

Title: MCWS Search File Order
Post by: sarkonovich on December 27, 2016, 01:50:55 pm
Is there a way to get the MCWS to play album search results in order of track number?
For example,

...../MCWS/v1/Files/Search?Query=[Album]=My Favorite Album

will start playing  "My Favorite Album" with the track in the following order: 8,9,10,2,1,3,4,5,6,7

Thanks,
Steve
Title: Re: MCWS Search File Order
Post by: Hendrik on December 27, 2016, 02:06:56 pm
Like with any MC search queries, you can make the sort part of the query, see https://wiki.jriver.com/index.php/Search_Language#Modifiers

So for example (encode spaces properly):
MCWS/v1/Files/Search?Query=[Album]="My Favorite Album" ~sort=[Track #]
Title: Re: MCWS Search File Order
Post by: sarkonovich on December 27, 2016, 03:53:57 pm
How have I not seen this page before!
This is great! Thank you!

Steve
Title: Re: MCWS Search File Order
Post by: sarkonovich on December 27, 2016, 04:32:00 pm
Well, gosh. What am I doing wrong here?

Encoded URL:
http://xx.xx.xxx.xx:51199/MCWS/v1/Files/Search?Action=Play&ActiveFile=-1&Zone=-1&ZoneType=ID&Token=XxXxXxX&Query=%5BAlbum%5D%3DTalking%20Heads%3A%2077%20%7B2005%20Remaster%7D%5D%20%7Esort%3D%5BTrack%20%23%5D

Decoded URL:
http://xx.xx.xxx.xx:51199/MCWS/v1/Files/Search?Action=Play&ActiveFile=-1&Zone=-1&ZoneType=ID&Token=XxXxXxX&Query=[Album]=Talking Heads: 77 {2005 Remaster}] ~sort=[Track #]

Doesn't work.  Weirdly, gives me my last played playlist.

However, removing "7Esort%3D%5BTrack%20%23%5D" (i.e., "~sort=[Track #]") return the expected album.

Am I missing something obvious?
Title: Re: MCWS Search File Order
Post by: Hendrik on December 27, 2016, 06:02:06 pm
Your quoting of the album name seems wrong. If you use anything after it, you need to put it in quotes or square brackets (depending on which behavior you want, see the page linked above for the difference, Quoting and Anchoring section), since it contains spaces.

So fixing your URL above:
http://xx.xx.xxx.xx:51199/MCWS/v1/Files/Search?Action=Play&ActiveFile=-1&Zone=-1&ZoneType=ID&Token=xxx&Query=[Album]="Talking Heads: 77 {2005 Remaster}" ~sort=[Track #]
or with minimal mandatory encoding
http://xx.xx.xxx.xx:51199/MCWS/v1/Files/Search?Action=Play&ActiveFile=-1&Zone=-1&ZoneType=ID&Token=xxx&Query=[Album]=%22Talking%20Heads:%2077%20{2005%20Remaster}%22%20~sort=[Track%20#]
Title: Re: MCWS Search File Order
Post by: sarkonovich on December 27, 2016, 06:18:04 pm
Ah. Good.

I was familiar with the use/absence of square brackets, but not quotes (and mixing quotes and brackets.)
That's very helpful.

Steve