Skip to content
This repository has been archived by the owner on Apr 9, 2018. It is now read-only.

Homecontrol Server: Bindings: [Info Service] TV Listings

Robert Morigi-Eades edited this page Mar 24, 2017 · 1 revision

Overview

TV Listings information is retrieved from the bleb.org. The listing data is gathered when the server starts, and at 6am each day.

Information is requested from the data sources on a daily basis and held in memory until requested by the clients.

Data structure

TV Listings are used in a set data structure within the HomeControl-server and is shared to the requesting clients in the same structure. The python module(s) for retrieving listing data from online sources convert the incoming data to suit the required specification.

Outline structure as follows:

{
    "<category_id>": {
        "<channel_id>": {
            "<listing_start_time>": {
                "start": "YYYY-MM-DD HH:MM:SS",
                "desc": "string",
                "end": "YYYY-MM-DD HH:MM:SS",
                "subtitle": "string",
                "title": "string"
            }
        }
    }
}

The <category_id> and <channel_id> values are as per the TV channels list and can be retrieved by clients using the GET /cache/tvchannels API.

Example data structure for TV listings is shown below:

{
    "0": {
        "0": {
            "2017-02-10 09:50:00": {
                "start": "2017-02-10 09:50:00",
                "desc": "A team of the world's greatest superheroes unite to try to save mankind. Awesome action starring Robert Downey Jr, Scarlett Johansson, Chris Evans and Tom Hiddleston. (2012)(138mins) Also in HD",
                "end": "2017-02-10 12:15:00",
                "subtitle": "",
                "title": "Avengers Assemble"
            },
            "2017-02-10 12:15:00": {...},
            ...
        },
        "1": {...},
        "...": {...},
        ...
    },
    "1" {
        "0": {...},
        "1": {...},
        ...
    },
    ...
}

Data Sources

The following data sources are used to retrieve the necessary information:

Clone this wiki locally