INTERACT FORUM

Please login or register.

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

Author Topic: How to save the current playlist with MCWS  (Read 3455 times)

RaphRock

  • Recent member
  • *
  • Posts: 11
How to save the current playlist with MCWS
« on: January 16, 2014, 10:17:50 am »

Hello,

I'm working on a C# RestClient for the MCWS.  Most of the REST Uri's and their parameters are pretty good explained (or ar easy to figure out).

But I don't have a clue on  how http://localhost:52199/MCWS/v1/Playback/playlist?action=save  works.

Documentation :
Action : Save: saves the files (as a playlist in the library, etc.);
SaveName: A backslash delimited path used with the action 'Save'. (default: )


http://localhost:52199/MCWS/v1/Playback/playlist?action=save  ==>  "Failure"
http://localhost:52199/MCWS/v1/Playback/playlist?action=save&saveName=someplace\otherplace\hereitis ==> "Failure"


Can someone advise me on how this works ?


And what about :
SaveMode: Playlist: playlist (overwrites existing; returns ID) (default: )

Help would be very much appreciated.

Thnx
Raf
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: How to save the current playlist with MCWS
« Reply #1 on: January 16, 2014, 10:43:52 am »

Save saves the playlist in the Library, under Playlists, for example.  The path is something like Audio\My New Playlist.

The default action shown in the example will provide a Save As dialog to save an MPL.  I don't think you can provide a Windows path for saving.
Logged
The opinions I express represent my own folly.

RaphRock

  • Recent member
  • *
  • Posts: 11
Re: How to save the current playlist with MCWS
« Reply #2 on: January 16, 2014, 10:57:07 am »

Thnx for a fast response.

I did get that the playlist was meant to be saved in the library but still the same I keep getting a status "Failure".

Could you show me a working example of a uri where the current playlist is effectively saved in the library ?

btw what's wrong with this uri ?  why does it give a status "Failure" ?
http://localhost:52199/MCWS/v1/Playback/playlist?action=save&saveName=someplace\otherplace\hereitis


thnx!
Raf
Logged

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2926
Re: How to save the current playlist with MCWS
« Reply #3 on: January 16, 2014, 11:24:54 am »

I'm not sure if it is case sensitive but try capital "Action=Save" and make sure the "SaveName" is a valid Library path as MrC describes.  It looks like "SaveMode=playlist" might be necessary to overwrite an existing playlist or it might fail.
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: How to save the current playlist with MCWS
« Reply #4 on: January 16, 2014, 11:48:13 am »

Could you show me a working example of a uri where the current playlist is effectively saved in the library ?

http://localhost:52199/MCWS/v1/Playback/Playlist?Zone=-1&SaveMode=Playlist&Action=Save&SaveName=Audio\Foobar
Logged
The opinions I express represent my own folly.

RaphRock

  • Recent member
  • *
  • Posts: 11
Re: How to save the current playlist with MCWS
« Reply #5 on: January 16, 2014, 12:54:42 pm »

Thnx a lot cncb & MrC.

Your link worked !  So by trial and error I conclude that all 3 parameters SaveMode=Playlist, Action=Save and SaveName=some\name are mandatory.

Other findings
It's not case sensitive
It seems that a "valid" librarypath is just any "/"delimited string.  Created under Playlists.
I couldn't make it work without the Savemode=Playlist parameter, even with nonexistent paths/names so when specifying an existant  playlist it will always be overwritten.


ps Seemingly you can't get a list of all existant fields/library tags with the MCWS (like is possible in the with the com interface).
I manually made a list now but it would be nice to retrieve this info directly from the MC database..

grtz and probably until later...
Raf

Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: How to save the current playlist with MCWS
« Reply #6 on: January 16, 2014, 01:00:45 pm »

ps Seemingly you can't get a list of all existant fields/library tags with the MCWS (like is possible in the with the com interface).
I manually made a list now but it would be nice to retrieve this info directly from the MC database..

I think you'll only retrieve the fields with values (via the default ALL value).  An alternative to manually constructing a list is to export a file as a CSV showing all fields; this gives you the field names as headers.

Don't forget - User Fields greatly expand the fields dictionary.
Logged
The opinions I express represent my own folly.

RaphRock

  • Recent member
  • *
  • Posts: 11
Re: How to save the current playlist with MCWS
« Reply #7 on: January 16, 2014, 01:23:32 pm »

Thnx MrC,

An export won't help me out because I'm also interested in tag properties as MediaType, Searchable, Searchnames, dataType...
For retrieving a Playlist or other MPL file one would only be interested in the tags with values.  But I am mapping  this to a strongly typed "Tag" object.
Also when retrieving a playlist one can specify which fields one wants to have returned and if one has the list in memory to show, for example, in a dropdown..

But anyway, I did the work manually only if MC decides to change the props of (non user defined) fields my info becomes outdated..

For now thnx a lot for your good and fast suppport !

grtz,
Raf
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: How to save the current playlist with MCWS
« Reply #8 on: January 16, 2014, 01:28:49 pm »

Got it.

I wish I would have known you needed a list with props.  I have a table, which I use to generate this:

   http://wiki.jriver.com/index.php/File_Properties_%28tags%29#Predefined_Fields
Logged
The opinions I express represent my own folly.

RaphRock

  • Recent member
  • *
  • Posts: 11
Re: How to save the current playlist with MCWS
« Reply #9 on: January 16, 2014, 02:32:29 pm »

That's the page I usef to build My tag list... :)
Logged

RaphRock

  • Recent member
  • *
  • Posts: 11
Re: How to save the current playlist with MCWS
« Reply #10 on: January 16, 2014, 11:45:25 pm »

Hi,

I suppose/hope, that when fields change/are added this will be in the releasenotes of any new version.

Btw, does the MCWS allow (or will be allowing in the future) streaming/downloading like WegGizmo ?


grtz,
Raf
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: How to save the current playlist with MCWS
« Reply #11 on: January 17, 2014, 11:42:36 am »

Generally the release notes are good about mentioning field additions and changes.

Regarding downloading/streaming, see the GetFile function.  Be sure to set the correct Playback type and Mime-Type (when downloading).  Example:


   http://localhost:52199/MCWS/v1/File/GetFile?File=23480941&FileType=Key&Playback=0&MimeType=application%2Foctet-stream
Logged
The opinions I express represent my own folly.
Pages: [1]   Go Up