INTERACT FORUM

Please login or register.

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

Author Topic: MCWS/v1/Playback/Info?Fields= Can't get all fields... Please Help  (Read 624 times)

Striker

  • World Citizen
  • ***
  • Posts: 176

I've upgraded to MC v32 64-bit and need to use the new Playback/Info?Fields= ....

In testing using the url below... I can get Genre and "Track #" using "Track%20%23"

I can't get "Date (readable)" with the encoding shown.

Is there something I'm doing wrong or something I should be doing differently?

http://127.0.0.1:52199/MCWS/v1/Playback/Info?Fields=Genre;Genre-All;Track%20%23;Last%20Played;Date %28readable%29

<Item Name="Genre">Blues</Item>
<Item Name="Genre-All">Live; Blues</Item>
<Item Name="Track #">4</Item>
<Item Name="Last Played">2023-11-08 09:49:33</Item>
<Item Name="Date (readable)"/>

If I get the "Date" field I get 40544 for year 2011.  What is the calc to convert that 40544 to a year?

All of my user fields and "Date (readable)" show up using

MCWS/v1/File/GetInfo?File=34608833&Action=json
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: MCWS/v1/Playback/Info?Fields= Can't get all fields... Please Help
« Reply #1 on: March 07, 2024, 02:52:24 am »

The space in "Date (readable)" should be encoded as %20, try that.

For the date conversion, check this post:
https://yabb.jriver.com/interact/index.php/topic,100449.msg959077.html#msg959077

Python can convert it with xlrd:
https://www.geeksforgeeks.org/python-convert-excel-serial-date-to-datetime/
Logged

Striker

  • World Citizen
  • ***
  • Posts: 176
Re: MCWS/v1/Playback/Info?Fields= Can't get all fields... Please Help
« Reply #2 on: March 07, 2024, 11:48:16 am »

Thank You for the reply.

I found I already wrote code a few decades ago to make this easy...  my C++ library date object lets me do this for dates (not handling decimal time) in just a few lines to do the conversion back and forth.

The space in "Date (readable)" should be encoded as %20, try that.

No that doesn't work either...  I just get  <Item Name="Date (readable)"/> in the output

For the date conversion, check this post:
https://yabb.jriver.com/interact/index.php/topic,100449.msg959077.html#msg959077

Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: MCWS/v1/Playback/Info?Fields= Can't get all fields... Please Help
« Reply #3 on: March 07, 2024, 12:09:01 pm »

Works fine for me with a calculated field called "Aspect Ratio (crop)". Are you sure the file pointed to by FileKey has a value in that field?

http://localhost:52199/MCWS/v1/Playback/Info?Fields=Genre;Last%20Played;Aspect%20Ratio%20%28Crop%29

<Item Name="FileKey">44809</Item>
(...)
<Item Name="Genre">Animation;Comedy;Adventure;Fantasy</Item>
<Item Name="Last Played">02/03/2021 20:37:29</Item>
<Item Name="Aspect Ratio (Crop)">1.85</Item>
Logged

Striker

  • World Citizen
  • ***
  • Posts: 176
Re: MCWS/v1/Playback/Info?Fields= Can't get all fields... Please Help
« Reply #4 on: March 07, 2024, 03:02:50 pm »

Works fine for me with a calculated field called "Aspect Ratio (crop)". Are you sure the file pointed to by FileKey has a value in that field?

Okay it works using "Date (Year)"  with the appropriate % chars.

I see a value for "Date (readable)" in the MCWS File/Info json output

Date (readable)   "2000"

But I cannot get it using Fields with MCWS PlaybackInfo.

But since I can get "Date (Year)" I'm good. 

Thank You for your help and replies.

I've updated to v32 64-bit from my prior v30 32-bit.   Sadly I also notice the WritePlaying plugin no longer works.  I guess I can live without that one.

For my project to get rid of the PlayingNow plugin from 2007....  I will get it.  But I keep getting returns that are legit but I don't want to use, and finding that magic logic to know which MCWS replies I want to use for the displays around my house and which I don't is messy.  But I will get it.
Logged

MrBiff

  • World Citizen
  • ***
  • Posts: 151
Re: MCWS/v1/Playback/Info?Fields= Can't get all fields... Please Help
« Reply #5 on: March 07, 2024, 04:00:48 pm »

I see a value for "Date (readable)" in the MCWS File/Info json output

Date (readable)   "2000"

But I cannot get it using Fields with MCWS PlaybackInfo.

This is not an MC field - it's a pseudo-field that MC returns in Files/GetInfo.
Logged
Pages: [1]   Go Up