INTERACT FORUM

Windows => Plug-in Development => Topic started by: mpg732 on February 18, 2023, 09:49:58 am

Title: MCWS Questions
Post by: mpg732 on February 18, 2023, 09:49:58 am
I have been playing around with creating controls for MC in Demopad.  I have the following command http://localhost:52199/MCWS/v1/Playback/Playlist?Zone=-1.  That works and all, but was wondering how and or if it can be done, I would like to limit how much info is returned, IE only Title, artist, duration and son ID#, so is that possible?  I also have a playlist of over 800 songs, that is a lot of returned data to sort through and parse.  I also was wondering if you can get the returned info in the shuffled state that the playlist is currently playing in?  I was also wondering if you can get a limited number of songs, such as give me the first 1 to 50 songs, then next being 51 to 100, and so on?

Thanks
Mike

PS, I have searched the internet for answers but was not able to find answers...
Title: Re: MCWS Questions
Post by: mattkhan on February 18, 2023, 10:04:05 am
see the doc at http://localhost:52199/MCWS/v1/doc

you'll see there is a parameter

            Fields: The fields to include in an MPL (use empty to include all fields) (set to Calculated to include calculated fields). (default: )

I don't believe there is any pagination built in
Title: Re: MCWS Questions
Post by: mpg732 on February 18, 2023, 03:54:04 pm
I started there, I guess I don't understand how to do this, that's why I am asking for help.  Can you please give an example command?

Thanks
Mike
Title: Re: MCWS Questions
Post by: mpg732 on February 18, 2023, 04:30:10 pm
So kinda got it working with the following line,
http://localhost:52199/MCWS/v1/Playback/Playlist?Fields=Key,Name,Artist,Duration?Zone=-1

Can not get Duration to show up in the returned data
Title: Re: MCWS Questions
Post by: retiredteacherguy on February 18, 2023, 05:33:35 pm
Try: http://localhost:52199/MCWS/v1/Playback/Playlist?Fields=Key,Name,Artist,Duration&Zone=-1
Title: Re: MCWS Questions
Post by: mpg732 on February 18, 2023, 07:03:55 pm
Thanks got that part figured out,
http://localhost:52199/MCWS/v1/Playback/Playlist?Action=JSON&ActiveFileOnly=1&Fields=Key,Name,Artist

is it possible to split up how much I que, like 1 to 50 then 51 to 100, so on and so on
Title: Re: MCWS Questions
Post by: retiredteacherguy on February 19, 2023, 05:51:32 am
Maybe if you explain your end goal you’ll get some other responses
Title: Re: MCWS Questions
Post by: eve on February 20, 2023, 01:19:46 am
This Centro stuff looks pretty cool.

Thanks for mentioning it!
Title: Re: MCWS Questions
Post by: mattkhan on February 20, 2023, 01:27:14 am
is it possible to split up how much I que, like 1 to 50 then 51 to 100, so on and so on
no
Title: Re: MCWS Questions
Post by: eve on February 20, 2023, 04:01:43 am
Thanks got that part figured out,
http://localhost:52199/MCWS/v1/Playback/Playlist?Action=JSON&ActiveFileOnly=1&Fields=Key,Name,Artist

is it possible to split up how much I que, like 1 to 50 then 51 to 100, so on and so on

There's no built in pagination. You *can* sort of work around this by 'getting' all relevant items, storing that list, and splitting it yourself. You can send multiple requests to JRiver that append items to the end of the queue. What are you trying to achieve exactly with the pagination?
800 items isn't ridiculous to parse and sort from a computational perspective.
Title: Re: MCWS Questions
Post by: mpg732 on February 20, 2023, 04:43:42 pm
Thanks all, I have a few different ways of going about it, just seeing all my options before I dive into what I am trying to accomplish.