INTERACT FORUM

Please login or register.

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

Author Topic: MCWS - Get Media TYpe or Media SubType  (Read 4332 times)

kensn

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1362
MCWS - Get Media TYpe or Media SubType
« on: September 20, 2013, 11:42:56 am »

I looked a coulple of times, but is there a way to get Media Type or Media SubType from the current playing file for MCWS?

Thanks,
Ken
Logged
If(IsEmpty([Coffee Cup]), Coffee, Drink)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: MCWS - Get Media TYpe or Media SubType
« Reply #1 on: September 20, 2013, 12:13:58 pm »

Get the currently playing file:

   http://localhost:52199/MCWS/v1/Playback/Info?Zone=-1

   <Response Status="OK">
   <Item Name="ZoneID">0</Item>
   <Item Name="ZoneName">Music - main</Item>
   <Item Name="State">2</Item>
   <Item Name="FileKey">3872499</Item>
   ...

and from that you'll have the FileKey, which you'll use to get info on the file, asking for just the File Type:

   http://localhost:52199/MCWS/v1/File/GetInfo?File=3872499&Fields=File%20Type

   <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
   <MPL Version="2.0" Title="MCWS - Files - 9048">
   <Item>
   <Field Name="Key">3872499</Field>
   <Field Name="File Type">flac</Field>
   </Item>
   </MPL>
Logged
The opinions I express represent my own folly.

kensn

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1362
Re: MCWS - Get Media TYpe or Media SubType
« Reply #2 on: September 20, 2013, 12:22:40 pm »

Yea I saw I could get the File Type, but there are many file types that can make up "Audio". Was just looking to see if I could get MediaType = Audio.

Ken
Logged
If(IsEmpty([Coffee Cup]), Coffee, Drink)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: MCWS - Get Media TYpe or Media SubType
« Reply #3 on: September 20, 2013, 12:39:32 pm »

Sorry, I gave instructions for File Type, not Media Type/Media Sub Type, which would be:

      http://localhost:52199/MCWS/v1/File/GetInfo?File=3872499&Fields=Media%20Sub%20Type,Media%20Type
Logged
The opinions I express represent my own folly.

kensn

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1362
Re: MCWS - Get Media TYpe or Media SubType
« Reply #4 on: September 20, 2013, 12:44:12 pm »

Fields...

Thanks MrC

Ken
Logged
If(IsEmpty([Coffee Cup]), Coffee, Drink)

kensn

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1362
Re: MCWS - Get Media TYpe or Media SubType
« Reply #5 on: September 20, 2013, 07:45:59 pm »

This seems to want to give me an MPL file.. No way to get a return value???

Ken
Logged
If(IsEmpty([Coffee Cup]), Coffee, Drink)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: MCWS - Get Media TYpe or Media SubType
« Reply #6 on: September 20, 2013, 08:19:10 pm »

It doesn't output a file, but an MPL stream with MIME Content-Type: application/x-mediajukebox-mpl.  Since you're probably using your browser, the browser doesn't know what to do with the output, since it offers to store the result to a file.

How do you intend to make the call?


Example:
 $ curl 'http://localhost:52199/MCWS/v1/File/GetInfo?File=3872499&Fields=Media%20Sub%20Type,Media%20Type'
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<MPL Version="2.0" Title="MCWS - Files - 4712">
<Item>
<Field Name="Key">3872499</Field>
<Field Name="Media Type">Audio</Field>
</Item>
</MPL>
Logged
The opinions I express represent my own folly.

kensn

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1362
Re: MCWS - Get Media TYpe or Media SubType
« Reply #7 on: September 20, 2013, 08:22:44 pm »

OK... Back to the grind..

Thanks,
Ken
Logged
If(IsEmpty([Coffee Cup]), Coffee, Drink)
Pages: [1]   Go Up