INTERACT FORUM

Please login or register.

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

Author Topic: WebRemote and XML  (Read 2633 times)

TMA-1

  • World Citizen
  • ***
  • Posts: 107
WebRemote and XML
« on: November 16, 2010, 03:58:40 am »

Hi,

Im looking in to the possibilities to make an Air-app for Android that will replace the WebRemote.

I have found how to make XML-requests to a library to get Artists, the artists albums, and the tracks of the album.
The thing is that I only succeed in getting the names, but I need more fields, like keys and LibraryLocation and such things to be able to make playbuttons and stuff like that.
How do I do that?

This is a request for the tracks of the album "Aladdin Sane":
Code: [Select]
http://localhost:52199/MCWS/v1/Library/Values?Field=Name&Files=[Album]=Aladdin SaneI would need to do something like this:
Code: [Select]
http://localhost:52199/MCWS/v1/Library/Values?Field=Name,Key&Files=[Album]=Aladdin SaneHow can I get the keys together with the names?
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42445
  • Shoes gone again!
Re: WebRemote and XML
« Reply #1 on: November 16, 2010, 11:09:17 am »

Given a value, you can search to get files:
MCWS/v1/Files/Search?Query=[Album]=[Aladdin Sane] [Name]=[thing returned from values list]&Output=mpl

The resulting MPL will give all files and all information about the matching files.

Does that work?

We're also considering adding a set of browse functions to expose a WebRemote / WebPlay style hierarchy.
Logged
Matt Ashland, JRiver Media Center

TMA-1

  • World Citizen
  • ***
  • Posts: 107
Re: WebRemote and XML
« Reply #2 on: November 16, 2010, 12:26:36 pm »

Quote
Given a value, you can search to get files:
MCWS/v1/Files/Search?Query=[Album]=[Aladdin Sane] [Name]=[thing returned from values list]&Output=mpl

The resulting MPL will give all files and all information about the matching files.

Does that work?

I think that might work.  I have not started coding anything yet, Im just in the process of gathering information to evaluate if it would be possible at all.

Quote
We're also considering adding a set of browse functions to expose a WebRemote / WebPlay style hierarchy.
That sounds great!
Logged

TMA-1

  • World Citizen
  • ***
  • Posts: 107
Re: WebRemote and XML
« Reply #3 on: November 17, 2010, 08:39:42 am »

Ok, I have started testing and I have run in to some trubble. When I through a flash-file make a xml-request I get a io-error. When I put the flash-file inside one of the WebRemote HTML-pages it works. I guess it has somehting to do with access-keys or something. Offcorse I can not get flash-support here but perhaps you know a trick to include an access key or login information in the xml-request-string somehow?
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42445
  • Shoes gone again!
Re: WebRemote and XML
« Reply #4 on: November 17, 2010, 08:52:37 am »

Ok, I have started testing and I have run in to some trubble. When I through a flash-file make a xml-request I get a io-error. When I put the flash-file inside one of the WebRemote HTML-pages it works. I guess it has somehting to do with access-keys or something. Offcorse I can not get flash-support here but perhaps you know a trick to include an access key or login information in the xml-request-string somehow?

If you have authentication enabled on the server, you need to include the token on your call or you might get failures.

For development, I would just turn off authentication on the server and worry about it later.

Also, I recommend using Fiddler (fiddlertool.com) to watch requests made on the client.  It will let you easily compare working and non working requests and see the server's responses.
Logged
Matt Ashland, JRiver Media Center

TMA-1

  • World Citizen
  • ***
  • Posts: 107
Re: WebRemote and XML
« Reply #5 on: November 18, 2010, 02:23:50 am »

It worked when I turned authentication off. Thanks!
I'll bother with that later as you suggested  :)
Logged

TMA-1

  • World Citizen
  • ***
  • Posts: 107
Re: WebRemote and XML
« Reply #6 on: December 08, 2010, 09:00:34 am »

Hi again,

Slow progress here, but still progress =).

Im looking for a way to get the album art.

I can get it when I request info on the current playback (MCWS/v1/Playback/Info?Zone=-1). It is then stored in the item ImageURL (like this "MCWS/v1/File/GetImage?File=195"). This is great because I then have an url to load the image from. Is there a way to get this for each artist/album/track and not only for the current playback item?

I hope I make sense? =) 
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42445
  • Shoes gone again!
Re: WebRemote and XML
« Reply #7 on: December 08, 2010, 09:32:18 am »

Use File/GetImage to get cover art.

And you might want to look at the new Browse functions which provides a user-customizable tree and artwork for each level.
Logged
Matt Ashland, JRiver Media Center

TMA-1

  • World Citizen
  • ***
  • Posts: 107
Re: WebRemote and XML
« Reply #8 on: December 08, 2010, 01:17:40 pm »

I didn't know the new browse functions already were avaliable and I just had a look at them.
They're great! This will make it much simpler! Just what I was looking for. Ha ha! Thanks a lot!  ;D
Logged

TMA-1

  • World Citizen
  • ***
  • Posts: 107
Re: WebRemote and XML
« Reply #9 on: December 09, 2010, 03:22:04 am »

Ok, another question  :)

I can now browse back and forth between most levels (audio/artists/albums) using "brows children" but as soon as I reach an album-level I have to use "get files" to get a list of the tracks?
How can I ditermin if the item im accessing can use "brows children" or it is an album and has to use "get files"?
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42445
  • Shoes gone again!
Re: WebRemote and XML
« Reply #10 on: December 09, 2010, 12:36:43 pm »

I can now browse back and forth between most levels (audio/artists/albums) using "brows children" but as soon as I reach an album-level I have to use "get files" to get a list of the tracks?

How can I ditermin if the item im accessing can use "brows children" or it is an album and has to use "get files"?

The way Gizmo works is that it does a Browse/Children.  If that returns no items, it switches to files.

Your code will have to have separate handling for browse items and files.  The IDs and available functions are different between the two.
Logged
Matt Ashland, JRiver Media Center

TMA-1

  • World Citizen
  • ***
  • Posts: 107
Re: WebRemote and XML
« Reply #11 on: December 10, 2010, 02:02:49 am »

The way Gizmo works is that it does a Browse/Children.  If that returns no items, it switches to files.

Your code will have to have separate handling for browse items and files.  The IDs and available functions are different between the two.

Roger that. Thanks for your help.
Logged
Pages: [1]   Go Up