INTERACT FORUM

Please login or register.

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

Author Topic: MCWS broken for Values in MC16?  (Read 4716 times)

Chili-Jam

  • Regular Member
  • World Citizen
  • ***
  • Posts: 107
  • same same ... but different
MCWS broken for Values in MC16?
« on: September 01, 2011, 01:19:18 am »

Hi,

i just realized that none of your examples for MCWS/v1/Library/Values works for MC16.
It just responds ok but no values. I have a parallel installation for MC15 on the same computer
where it works as expected. Is it broken or am I missing something?


Two other questions:

1) I want to query MC to give me all managed library fields for a filter (e.g. show only audio fields)
similar to the Manage Library Fields Options dialog. I need the field names and if possible meta-data
(data type, relational, edit type, acceptable values).
Is something like this already possible ( maybe as a workaround) or can you create a webservice method for that?

2) I want to get all fields with values for a file (playing or not, identified by filekey).
Is this possible or can you implement it?

That would be awesome since i want to be able to tag files with a remote.

Thanks
Logged

PaulSinnema

  • Galactic Citizen
  • ****
  • Posts: 393
  • You don't know what you're missing until its gone
Re: MCWS broken for Values in MC16?
« Reply #1 on: September 01, 2011, 05:23:34 am »

Hi,

You must be doing something wrong. I just tested it and it works fine for me.

Here's what I do:
First make sure the Library Server is enabled:
  • In the left pane select 'Services & Plug-ins' => 'Media Network' => click Options
  • Make sure the check in 'Use Media Network to share this library and enable DLNA' is on

Start a browser and do the following:
  • Type the following Url: http://localhost:52199
  • You should now see the 'Library Server' main menu
  • Click the 'MCWS (Web Service)' menu item
  • You'll now be presented with all the interfaces you can use

If I, for instance, click the 'Alive' example (which fires http://localhost:52199/MCWS/v1/Alive) you should see something like:

Code: [Select]
 <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <Response Status="OK">
  <Item Name="RuntimeGUID">{AEBD3140-649A-4A12-9991-304CA839AA38}</Item>
  <Item Name="LibraryVersion">20</Item>
  <Item Name="ProgramName">JRiver Media Center</Item>
  <Item Name="ProgramVersion">16.0.164</Item>
  <Item Name="FriendlyName">Speedy</Item>
  <Item Name="AccessKey">CNcvbV</Item>
  </Response>

If you only want to see library items with type 'audio' do the following:

http://localhost:52199/MCWS/v1/Files/Search?Query=[Media Type]=Audio&Action=mpl

This causes MC to collect all Audio Types and will send you a search result in the form of a 'Search1.mpl' file which has results like this:

Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<MPL Version="2.0" Title="MCWS - Files - 9244">
<Item>
<Field Name="Key">373</Field>
<Field Name="Filename">C:\Users\Public\Music\Sample Music\Kalimba.mp3</Field>
<Field Name="Name">Kalimba</Field>
<Field Name="Artist">Mr. Scruff</Field>
<Field Name="Album">Ninja Tuna</Field>
<Field Name="Genre">Electronic</Field>
<Field Name="Comment">Ninja Tune Records</Field>
<Field Name="Date">39448</Field>
<Field Name="Bitrate">192</Field>
<Field Name="Image File">INTERNAL</Field>
<Field Name="Duration">348,0550000000000068</Field>
<Field Name="Track #">1</Field>
<Field Name="Disc #">1</Field>
<Field Name="Media Type">Audio</Field>
<Field Name="Album Artist">Mr. Scruff</Field>
<Field Name="Date Imported">1303378644</Field>
<Field Name="Skip Count">7</Field>
<Field Name="Last Skipped">1305186408</Field>
<Field Name="File Type">mp3</Field>
<Field Name="File Size">8424803</Field>
<Field Name="Date Created">1247549558</Field>
<Field Name="Date Modified">1304683245</Field>
<Field Name="Compression">CBR (MPEG-1 Layer 3)</Field>
<Field Name="Publisher">Ninja Tune</Field>
<Field Name="Composer">A. Carthy and A. Kingslow</Field>
<Field Name="Sample Rate">44100</Field>
<Field Name="Channels">2</Field>
<Field Name="Bit Depth">16</Field>
</Item>
<Item>
   ...
</Item>
</MPL>

Take a close look at the options in the different interfaces and you'll see that there's almost nothing you can not do with MC.

Regards
Paul Sinnema
Logged

Chili-Jam

  • Regular Member
  • World Citizen
  • ***
  • Posts: 107
  • same same ... but different
Re: MCWS broken for Values in MC16?
« Reply #2 on: September 01, 2011, 06:52:52 am »

Hi Paul,

thanks for answering.

I can open the webservice documentation page at http://localhost:52199/MCWS/v1/doc
or the way you navigate to it.
I can succesfully call the services that should give a response, e.g. alive or authenticate are working.
Also retrieving a mpl file is working.

But can you confirm that
http://localhost:52199/MCWS/v1/Library/Values?Field=Artist
gives you any result for MC16?
It doesn't do it for me but the same library opened in MC15 does.

For my other questions:
i can see that it might be a workaround to request a mpl file and parse it.
I was just hoping i could get a plain xml response without needing to download a file.

My first question was more about getting the metadata of the library (also as xml response)
but maybe i could extract that from the real data as well.

Regards
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72437
  • Where did I put my teeth?
Re: MCWS broken for Values in MC16?
« Reply #3 on: September 01, 2011, 07:07:56 am »


But can you confirm that
http://localhost:52199/MCWS/v1/Library/Values?Field=Artist
gives you any result for MC16?

I get this:
Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="true"?>
<Response Status="OK"/>
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: MCWS broken for Values in MC16?
« Reply #4 on: September 01, 2011, 07:13:57 am »

Good coincidence, I happened to notice the missing Artists just the other day.
Logged
The opinions I express represent my own folly.

Chili-Jam

  • Regular Member
  • World Citizen
  • ***
  • Posts: 107
  • same same ... but different
Re: MCWS broken for Values in MC16?
« Reply #5 on: September 01, 2011, 07:40:50 am »

I get this:
Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="true"?>
<Response Status="OK"/>

Yes, that's what i get as well.
But there should be some artists listed if your library contains any ?
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!
Re: MCWS broken for Values in MC16?
« Reply #6 on: September 01, 2011, 07:52:53 am »

This function uses the new value search engine introduced in v16.  It does fuzzy matching, a better job of sorting matches by relevance, and includes logical things like the album "New Morning" when you search for Bob Dylan even though the album value (obviously) doesn't contain the search term.

This is used by Theater View, Gizmo, and the search suggestions in the search box.

You need to provide a filter for it to work.  

For example:
http://localhost:52199/MCWS/v1/Library/Values?Field=Artist&Filter=Dylan&Field=Artist,Album

Results:
Code: [Select]
<Response Status="OK">
<Item Name="Artist">Bob Dylan</Item>
<Item Name="Album">Dylan</Item>
<Item Name="Album">Baez Sings Dylan</Item>
<Item Name="Album">The Freewheelin' Bob Dylan</Item>
<Item Name="Artist">Jakob Dylan Featuring Dhani Harrison</Item>
<Item Name="Name">Bob Dylan's Dream</Item>
<Item Name="Name">Bob Dylan's Blues</Item>
<Item Name="Album">New Morning</Item>
<Item Name="Album">Modern Times</Item>
</Response>

It might be good to make the no-filter method work as well, although the function is really designed for searching.
Logged
Matt Ashland, JRiver Media Center

Chili-Jam

  • Regular Member
  • World Citizen
  • ***
  • Posts: 107
  • same same ... but different
Re: MCWS broken for Values in MC16?
« Reply #7 on: September 01, 2011, 08:06:26 am »

Thanks Matt,

doing it as in your example gives me results.
I was mislead by the webservice description to asume that wildcards (defaults) should work.

What about my other two questions?
Can you give me a hint how to do it with the existing services or is it not possible?
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!
Re: MCWS broken for Values in MC16?
« Reply #8 on: September 01, 2011, 08:44:54 am »

You can get information about a specific file using:
http://localhost:52199/MCWS/v1/Files/Search?Query=[Key]=[1]&Action=MPL

Switch the "1" to the file key in question.
Logged
Matt Ashland, JRiver Media Center

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!
Re: MCWS broken for Values in MC16?
« Reply #9 on: November 11, 2011, 02:44:52 pm »

In 17.0.33 (and newer):
SDK: Improved MCWS/v1/Library/Values so it can return all values for a given field or search any number of fields for matches.
Logged
Matt Ashland, JRiver Media Center

Lespaul

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 488
Re: MCWS broken for Values in MC16?
« Reply #10 on: February 12, 2012, 07:32:15 am »

Hi Matt,

When using a query like this:
http://localhost:52199/MCWS/v1/Library/Values?Field=Artist&Filter=Dylan&Field=Artist,Album

How do you get the itemID of the items returned? They are not much use without them when used in a search.
I can see that WebGizmo is able to retieve these values.
Logged

jitterjames

  • Recent member
  • *
  • Posts: 17
Re: MCWS broken for Values in MC16?
« Reply #11 on: February 21, 2012, 04:23:01 pm »

In 17.0.33 (and newer):
SDK: Improved MCWS/v1/Library/Values so it can return all values for a given field or search any number of fields for matches.

It would be really great if you could release a fix for this issue.  Clearly it is supposed to work since it works in MC15 and MC17 and all your examples in the doc use this format and none of them work.

This is taken from the doc generated by MC16:

 
Quote
   Values
         Get a list of values from the database (artists, albums, etc.).
         Parameters:
            Field: The field to get values from. (default: )
            Files: A search to use to get the files to retrieve values from (use empty to use all imported files). (default: )
            Filter: Only return values that match this filter (empty returns all). (default: )
            Limit: Maximum number of values to return. (default: )
         Response:
         Examples:
            All artists   ---- link goes to: http://xxxx:52199/MCWS/v1/Library/Values?Field=Artist
            Audio artists 
            Rock artists

            Image keywords

If it is not possible to get a fix for this could you please suggest a workaround for those of us who are trying to get a list of: "all artists", "all album" etc. in XML format.

Thanks
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!
Re: MCWS broken for Values in MC16?
« Reply #12 on: February 21, 2012, 08:14:32 pm »

If it is not possible to get a fix for this could you please suggest a workaround for those of us who are trying to get a list of: "all artists", "all album" etc. in XML format.

Library/Values can only be used for searching in MC 16.

With MC 17, it can do both:
http://localhost:52199/MCWS/v1/Library/Values?Field=Artist

MC 17 is the current version.  No changes will be made to MC 16.
Logged
Matt Ashland, JRiver Media Center

jitterjames

  • Recent member
  • *
  • Posts: 17
Re: MCWS broken for Values in MC16?
« Reply #13 on: February 22, 2012, 07:12:49 am »

Wow.  Too bad.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72437
  • Where did I put my teeth?
Re: MCWS broken for Values in MC16?
« Reply #14 on: February 22, 2012, 07:37:51 am »

We don't go backward.  We only go forward.
Logged

Lespaul

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 488
Re: MCWS broken for Values in MC16?
« Reply #15 on: March 01, 2012, 05:54:31 am »

Hi Jim, is there any way to get the itemID back in these queries?
The current search functionality in the webservice is lacking the option to group by artist,album etc.
A few additions to the "Values" call, could easily replace the current search.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!
Re: MCWS broken for Values in MC16?
« Reply #16 on: March 01, 2012, 11:22:24 am »

Hi Jim, is there any way to get the itemID back in these queries?
The current search functionality in the webservice is lacking the option to group by artist,album etc.
A few additions to the "Values" call, could easily replace the current search.

The results from this function are not browse ids.  For example, you could get results for all the composers but there's no rule that composers are listed in the browse tree.

Gizmo uses the Library/Values function for searching.  For example:
http://localhost:52199/MCWS/v1/Library/Values?Filter=Dylan

First result from call above:
<Item Name="Artist">Bob Dylan</Item>

Play the result:
http://localhost:52199/MCWS/v1/Files/Search?query=[Artist]=[Bob Dylan]&Action=Play

Someday we may add searching to the Browse interface, but it's not currently possible.
Logged
Matt Ashland, JRiver Media Center

cliff_g

  • Recent member
  • *
  • Posts: 19
Re: MCWS broken for Values in MC16?
« Reply #17 on: March 04, 2012, 09:19:32 am »

Is it possible to use wildcards in the search function?

So I would be able to pass though dylan instead of bob dylan to allow free text searching..

http://localhost:52199/MCWS/v1/Files/Search?Action=mpl&ActiveFile=-1&Zone=-1&ZoneType=ID&Query=[Artist]=[dylan]

This would be more relevant when searching for tracks that contain the word "mud" for example.

In the Web Remote you have a search function - what is this using?

Cheers
Cliff

Logged
Pages: [1]   Go Up