INTERACT FORUM

Please login or register.

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

Author Topic: MCWS: Getting Artist Albums and Album Tracks??  (Read 12769 times)

SteveV

  • Regular Member
  • Recent member
  • *
  • Posts: 37
  • software geek
MCWS: Getting Artist Albums and Album Tracks??
« on: April 08, 2012, 10:04:50 am »

I'm working on a .NET wrapper for the MCWS webservice.  I'm using "Browse/Children?id=1" to get the top level categories which returns the following:

Code: [Select]

<Response Status="OK">
<Item Name="Artist">1048</Item>
<Item Name="Album">1049</Item>
<Item Name="Recent">1050</Item>
<Item Name="Genre">1051</Item>
<Item Name="Composer">1052</Item>
<Item Name="Podcast">1053</Item>
<Item Name="Highly Rated">1054</Item>
</Response>

Next, I use "Browse/Children?id=1048" to get a list of Artists and their corresponding IDs.  How would I next get a list of Artist albums using the Artist ID.  And similarly, how would I get a list of tracks using an Album ID?

Thanks -- Steve
Logged

SteveV

  • Regular Member
  • Recent member
  • *
  • Posts: 37
  • software geek
Re: MCWS: Getting Artist Albums and Album Tracks??
« Reply #1 on: April 09, 2012, 08:12:58 am »

Hmm, interesting.  If I do: "http://localhost:52199/MCWS/v1/Browse/Children?Id=1000", I get a list of artists as expected.

Code: [Select]
<Response Status="OK">
<Item Name="'Til Tuesday">1007</Item>
<Item Name=""Weird Al" Yankovic">1008</Item>
<Item Name="10,000 Maniacs">1009</Item>
<Item Name="A Flock Of Seagulls">1010</Item>
<Item Name="A Perfect Circle">1011</Item>
<Item Name="Abba">1012</Item>
<Item Name="Adam Ant">1013</Item>
<Item Name="Aerosmith">1014</Item>
...

Appending the Artist ID to the original query string like so: "http://localhost:52199/MCWS/v1/Browse/Children?Id=1000&Id=1014" produces a list of artist albums  ;D

Code: [Select]
<Response Status="OK">
<Item Name="A Little South Of Sanity - Disc One">2095</Item>
<Item Name="A Little South Of Sanity - Disc Two">2096</Item>
<Item Name="Aerosmith">2097</Item>
<Item Name="Get A Grip">2098</Item>
<Item Name="Get Your Wings">2099</Item>
<Item Name="Just Push Play">2100</Item>
<Item Name="Made In America">2101</Item>
<Item Name="Pump">2102</Item>
<Item Name="Toys In The Attic">2103</Item>
</Response>

So far, so good.  Unfortunatelly, appending the Album ID to the querystring does not have the desired result: "http://localhost:52199/MCWS/v1/Browse/Children?Id=1000&Id=1014&Id=2103"

Code: [Select]
<Response Status="OK"/>

So close  :(

Any thoughts?

Thanks -- Steve
Logged

SteveV

  • Regular Member
  • Recent member
  • *
  • Posts: 37
  • software geek
Re: MCWS: Getting Artist Albums and Album Tracks??
« Reply #2 on: April 09, 2012, 07:51:36 pm »

I feel like I'm talking to myself here  ::)

After a little more digging I can get what looks like a list of album track IDs by calling: "http://localhost:52199/MCWS/v1/Browse/Files?Id=2103&Action=serialize" (where Id=2103 represents the album ID).  This returns the following list:

Code: [Select]
2;9;-1;194;195;189;196;190;193;191;192;197

How On earth do I get track info by Id?  The MCWS docs are pretty light and I'd really appreciate some guidance from the JRiver guys on this.  Matt? Jim? Anyone?

Thanks -- Steve
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!
Re: MCWS: Getting Artist Albums and Album Tracks??
« Reply #3 on: April 09, 2012, 08:06:53 pm »

You should only put one Id on the browse request.  The numbers change each run, so you walk the tree starting at the root (Id = 0).

To get XML describing a file, you can use something like:
http://localhost:52199/MCWS/v1/Files/Search/Query=[File Key]=[INSERT_FILE_KEY_HERE]&Action=MPL
Logged
Matt Ashland, JRiver Media Center

SteveV

  • Regular Member
  • Recent member
  • *
  • Posts: 37
  • software geek
Re: MCWS: Getting Artist Albums and Album Tracks??
« Reply #4 on: April 09, 2012, 08:22:45 pm »

Hi Matt,

Thanks for the quick reply.  I'm probably being dense but I don't understand your example.  How would I look up a specific album by ID using your example?

Thanks again -- Steve
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!
Re: MCWS: Getting Artist Albums and Album Tracks??
« Reply #5 on: April 09, 2012, 08:46:42 pm »

Thanks for the quick reply.  I'm probably being dense but I don't understand your example.  How would I look up a specific album by ID using your example?

To browse, you would walk the tree one level at a time:
Audio > Album > [Name of album here]

To just search for an album and get files, you could use the Files/Search function with [Album]=[INSERT ALBUM NAME] as the search.
Logged
Matt Ashland, JRiver Media Center

SteveV

  • Regular Member
  • Recent member
  • *
  • Posts: 37
  • software geek
Re: MCWS: Getting Artist Albums and Album Tracks??
« Reply #6 on: April 09, 2012, 08:56:59 pm »

The problem with using album name for a search is that album titles like "greatest hits" will return many matches.

Ideally, I'd use Artist ID to get a list Albums and related IDs.  Next, I'd search using the Album ID to get a list of Album Tracks and related IDs.

Steve
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!
Re: MCWS: Getting Artist Albums and Album Tracks??
« Reply #7 on: April 09, 2012, 09:15:17 pm »

There's no such thing as an immutable artist id or album id in Media Center.

The browse tree gives different ids each run.

This is because the browse engine is totally flexible (100+ fields, ability to use expressions, etc.) so immutable ids don't really make sense.

You can solve the Greatest Hits problem by using a more specific search like:
[Album]=[Greatest Hits] [Artist]=[Bob Dylan]
Logged
Matt Ashland, JRiver Media Center
Pages: [1]   Go Up