Page 1 of 1

videoProperties is not always a JSON array

PostPosted: Thu Apr 13, 2017 7:50 pm
by skst
REF: https://github.com/SchedulesDirect/JSON ... stationids

Hello,

The above documentation doesn't mention that sometimes a schedule's videoProperties member might be a JSON object instead of a JSON array.I ran into the below JSON result today. Is this a bug in the emitted JSON or an oversight in the documentation? If the emitted JSON is correct, can you please expand the documentation to mention this and define what the "1" is?

Thanks for your help.

Code: Select all
program   {{
  "programID": "EP006228693397",
  "airDateTime": "2017-04-14T06:00:00Z",
  "duration": 1800,
  "md5": "lKUm/pNrZcku2RxtEq67ag",
  "new": true,
  "audioProperties": [
    "cc",
    "stereo"
  ],
  "videoProperties": {
    "1": "hdtv"
  },
  "ratings": [
    {
      "body": "USA Parental Rating",
      "code": "TVG"
    }
  ]
}}


Server ID: 20141201.web.1
Date/time: 4/14/2017 2:39:51 AM
ID: USA-IL58819-X
Name: WOW Chicago Suburbs - Digital
URI: /20141201/lineups/USA-IL58819-X
Transport: Cable
Location: Naperville

Re: videoProperties is not always a JSON array

PostPosted: Fri Apr 14, 2017 7:58 am
by gtb
Also reported in: viewtopic.php?f=17&t=2903

I am highly suspicious of the change rolled out yesterday for expanded properties.

Re: videoProperties is not always a JSON array

PostPosted: Fri Apr 14, 2017 8:06 am
by jagsd
I just ran into this videoProperties problem too. I suspect it is a bug introduced with the new HD qualifiers that were just introduced yesterday.

Instead of an array, an object is being printed. In javascript, objects are basically hash arrays with key/value pairs. Arrays are special objects also implemented as key/value pairs where the keys are the indexes of the array. So the { "1": "hdtv" } that you see is the array being printed as a regular object with the 1 being the key of the only entry.

But this appears to be happening only some of the time. It does not seem to happen when there are the new HD qualifiers in the props and thus more than one member in the array. When if fails this way, the few cases I have seen only have the single entry for { "1": "hdtv" }.

@rkulagow please fix this ASAP. Thanks.

Re: videoProperties is not always a JSON array

PostPosted: Fri Apr 14, 2017 8:15 am
by skst
He's already fixed it. :)

From The Green Button:
rkulagow wrote:Our upstream changed their API and didn't let us know, so that broke things on our ingest, which then cascaded to the outputted data. The ingest has been fixed and the schedules are being regenerated.