SchedulesDirect / JSON-Service

Code related to download, slice-and-dice and generation of JSON into database.
36 stars 5 forks source link

Issue with multi-part programs #37

Closed GameProgramer closed 9 years ago

GameProgramer commented 10 years ago

The new Json API does not seem to have a way to provide information about a program that's split into multiple parts. Additionally, in at least one case, it is providing incorrect information (as compared to the legacy web service data).

For example: The episode "Death's Shadow" of the series "Midsomer Murders" is split into two parts, with two different program id's. However, they both return the same info, even though the MD5 hash is different.

EP002708480105:

{
    "programID": "EP002708480105",
    "titles": [
        {
            "title120": "Midsomer Murders"
        }
    ],
    "eventDetails": {
        "subType": "Series"
    },
    "descriptions": {
        "description100": [
            {
                "descriptionLanguage": "en",
                "description": "A property developer is brutally murdered soon after a troubled theater director arrives in town."
            }
        ],
        "description1000": [
            {
                "descriptionLanguage": "en",
                "description": "A village must face its past when a children's game leads to brutal killings. With John Nettles and Daniel Casey."
            }
        ]
    },
    "originalAirDate": "1999-01-20",
    "genres": [
        "Crime drama",
        "Mystery"
    ],
    "episodeTitle150": "Death's Shadow",
    "metadata": [
        {
            "Tribune": {
                "season": 2,
                "episode": 1
            }
        }
    ],
    "cast": [
        {
            "personId": "84444",
            "nameId": "84444",
            "name": "John Nettles",
            "role": "Actor",
            "billingOrder": "01"
        },
        {
            "personId": "85289",
            "nameId": "85289",
            "name": "Daniel Casey",
            "role": "Actor",
            "billingOrder": "02"
        },
        {
            "personId": "85290",
            "nameId": "85290",
            "name": "Jane Wymark",
            "role": "Actor",
            "billingOrder": "03"
        },
        {
            "personId": "85291",
            "nameId": "85291",
            "name": "Laura Howard",
            "role": "Actor",
            "billingOrder": "04"
        },
        {
            "personId": "268426",
            "nameId": "272007",
            "name": "Barry Jackson",
            "role": "Actor",
            "billingOrder": "05"
        },
        {
            "personId": "73266",
            "nameId": "73266",
            "name": "Richard Briers",
            "role": "Guest Star",
            "billingOrder": "06"
        },
        {
            "personId": "72958",
            "nameId": "72958",
            "name": "Judy Parfitt",
            "role": "Guest Star",
            "billingOrder": "07"
        }
    ],
    "crew": [
        {
            "personId": "330932",
            "nameId": "339398",
            "name": "Jeremy Silberston",
            "role": "Director",
            "billingOrder": "01"
        },
        {
            "personId": "264173",
            "nameId": "267748",
            "name": "Anthony Horowitz",
            "role": "Writer",
            "billingOrder": "02"
        },
        {
            "personId": "326474",
            "nameId": "334884",
            "name": "Brian True-May",
            "role": "Executive Producer",
            "billingOrder": "03"
        }
    ],
    "showType": "Series",
    "hasImageArtwork": true,
    "md5": "cZ+g1Xsf+xSqFsRaLLIzHg"
}

EP002708480106:

{
    "programID": "EP002708480106",
    "titles": [
        {
            "title120": "Midsomer Murders"
        }
    ],
    "eventDetails": {
        "subType": "Series"
    },
    "descriptions": {
        "description100": [
            {
                "descriptionLanguage": "en",
                "description": "A property developer is brutally murdered soon after a troubled theater director arrives in town."
            }
        ],
        "description1000": [
            {
                "descriptionLanguage": "en",
                "description": "A village must face its past when a children's game leads to brutal killings. With John Nettles and Daniel Casey."
            }
        ]
    },
    "originalAirDate": "1999-01-20",
    "genres": [
        "Crime drama",
        "Mystery"
    ],
    "episodeTitle150": "Death's Shadow",
    "metadata": [
        {
            "Tribune": {
                "season": 2,
                "episode": 1
            }
        }
    ],
    "cast": [
        {
            "personId": "84444",
            "nameId": "84444",
            "name": "John Nettles",
            "role": "Actor",
            "billingOrder": "01"
        },
        {
            "personId": "85289",
            "nameId": "85289",
            "name": "Daniel Casey",
            "role": "Actor",
            "billingOrder": "02"
        },
        {
            "personId": "85290",
            "nameId": "85290",
            "name": "Jane Wymark",
            "role": "Actor",
            "billingOrder": "03"
        },
        {
            "personId": "85291",
            "nameId": "85291",
            "name": "Laura Howard",
            "role": "Actor",
            "billingOrder": "04"
        },
        {
            "personId": "268426",
            "nameId": "272007",
            "name": "Barry Jackson",
            "role": "Actor",
            "billingOrder": "05"
        },
        {
            "personId": "73266",
            "nameId": "73266",
            "name": "Richard Briers",
            "role": "Guest Star",
            "billingOrder": "06"
        },
        {
            "personId": "72958",
            "nameId": "72958",
            "name": "Judy Parfitt",
            "role": "Guest Star",
            "billingOrder": "07"
        }
    ],
    "crew": [
        {
            "personId": "330932",
            "nameId": "339398",
            "name": "Jeremy Silberston",
            "role": "Director",
            "billingOrder": "01"
        },
        {
            "personId": "264173",
            "nameId": "267748",
            "name": "Anthony Horowitz",
            "role": "Writer",
            "billingOrder": "02"
        },
        {
            "personId": "326474",
            "nameId": "334884",
            "name": "Brian True-May",
            "role": "Executive Producer",
            "billingOrder": "03"
        }
    ],
    "showType": "Series",
    "hasImageArtwork": true,
    "md5": "g9xvTg7fWox2t6bZqL74RA"
}
rkulagowski commented 10 years ago

OK; the upstream data no longer contains the part x of y information, which is why it's not included in the current data.

Because the programID is being used to generate the MD5, (and it's different for the two episodes), it leads to a different MD5 - which is what I think we want; as long as the programID is different and your application should record it.

Is there some source (online?) that indicates that "part 2" should have a different description?

GameProgramer commented 10 years ago

I am not sure how the xmltv data still has it. I compared this data with info it just grabbed this morning. Even if the part data is missing, I think it should at least have a different episode number.

rkulagowski commented 10 years ago

On Sun, Nov 9, 2014 at 1:20 PM, GameProgramer notifications@github.com wrote:

I am not sure how the xmltv data still has it. I compared this data with info it just grabbed this morning. Even if the part data is missing, I think it should at least have a different episode number.

The XML data comes from a different data set. I will try to find out why the episode number was "1" for both.

GameProgramer commented 10 years ago

It would be really nice to have the part info in the Json data as well. Is that completely impossible to do?

Thanks!

rkulagowski commented 10 years ago

It's not impossible. I'll have to investigate how difficult it will be.

GameProgramer commented 10 years ago

Thank you very much :)

If it's not too much to ask, please update this thread with any status updates, as I'm eagerly looking forward to what you find out.

rkulagowski commented 9 years ago

This has now been implemented; the schedules are being updated now. The new entity is called "multipart". If it exists, it will have the part number and total parts.

NOTE at this time, multipart data is only available for stations within the United States and Canada (and any international stations that rebroadcast U.S. or Canadian stationIDs)

{
            "programID": "EP011434540258",
            "airDateTime": "2014-11-13T15:00:00Z",
            "duration": 1800,
            "md5": "C0AVTDQ13GsHz3oL5PCzgA",
            "multipart": {
                "partNumber": 1,
                "totalParts": 3
            },
            "new": true,
            "audioProperties": [
                "cc",
                "stereo"
            ],
            "ratings": [
                {
                    "body": "USA Parental Rating",
                    "code": "TVG"
                }
            ]
        },
rkulagowski commented 9 years ago

Schedules have been updated.

GameProgramer commented 9 years ago

Thank you, confirmed that I can see the part info now. The episode number issue also seems to have been fixed.

I'll run more comprehensive tests over the next few days and get back to you if I see any issues.

Date: Tue, 11 Nov 2014 17:36:27 -0800 From: notifications@github.com To: JSON-Service@noreply.github.com CC: game_programer@hotmail.com Subject: Re: [JSON-Service] Issue with multi-part programs (#37)

Schedules have been updated.

— Reply to this email directly or view it on GitHub.

                  =
karog commented 9 years ago

@rkulagowski, thanks for adding the part info.

Why is it included at the schedule level rather than at the program level?

GameProgramer commented 9 years ago

Would be nice if the official documentation was also updated: https://github.com/SchedulesDirect/JSON-Service/wiki/API-20140530-Schedule-Response

Thanks!

rkulagowski commented 9 years ago

Documentation has been updated.

rkulagowski commented 9 years ago

@karog: it's at the schedule rather than the program for legacy reasons. In the next version of the API it will be moved to the program JSON but I don't want to pull the rug out from under developers who may have just implemented support for this.