INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: MCWS Search File Order  (Read 4844 times)

sarkonovich

  • Galactic Citizen
  • ****
  • Posts: 312
MCWS Search File Order
« 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
Logged
JRiver 21 Linux (ARM) on Pine 64 => PS Audio DirectWave DAC => ATC 50asl speakers. JRiver controlled by House Band on Amazon Echo

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10944
Re: MCWS Search File Order
« Reply #1 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 #]
Logged
~ nevcairiel
~ Author of LAV Filters

sarkonovich

  • Galactic Citizen
  • ****
  • Posts: 312
Re: MCWS Search File Order
« Reply #2 on: December 27, 2016, 03:53:57 pm »

How have I not seen this page before!
This is great! Thank you!

Steve
Logged
JRiver 21 Linux (ARM) on Pine 64 => PS Audio DirectWave DAC => ATC 50asl speakers. JRiver controlled by House Band on Amazon Echo

sarkonovich

  • Galactic Citizen
  • ****
  • Posts: 312
Re: MCWS Search File Order
« Reply #3 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?
Logged
JRiver 21 Linux (ARM) on Pine 64 => PS Audio DirectWave DAC => ATC 50asl speakers. JRiver controlled by House Band on Amazon Echo

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10944
Re: MCWS Search File Order
« Reply #4 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#]
Logged
~ nevcairiel
~ Author of LAV Filters

sarkonovich

  • Galactic Citizen
  • ****
  • Posts: 312
Re: MCWS Search File Order
« Reply #5 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
Logged
JRiver 21 Linux (ARM) on Pine 64 => PS Audio DirectWave DAC => ATC 50asl speakers. JRiver controlled by House Band on Amazon Echo
Pages: [1]   Go Up