AbstractProgramGrid
AbstractProgramGrid ⇐ Class
Kind: global abstract class
Extends: Class
Properties
Name | Type | Description |
---|---|---|
programLists | ListModel.<ProgramList> | List of program lists |
channelCount | Number | Number of channels in EPG |
boundingStart | number | start date of the bounding |
boundingEnd | number | end date of the bounding |
emptyProgramDuration | number | empty program duration to fill empty section, no filling if null |
modifyOverlappingSections | boolean | Flag to activate auto modification of section overlapping existing ones (default=true) |
- AbstractProgramGrid ⇐
Class
- new AbstractProgramGrid()
- .insertSection(gridSections) ⇒
AbstractProgramGrid
- .getProgramList(channelId) ⇒
ProgramList
|undefined
- ._getChunkChannelId(chunk) ⇒
string
- ._resolveChannelId(channelId) ⇒
string
AbstractProgramGrid()
Base class describing a grid of programs on multiple channels. It is basically a collection of ProgramLists
Usage: grid = new $ProgramGrid(); grid.insertSection([channel1Section, channel2Section, …]); grid.fill().padStart(…).padEnd(…)
insertSection(gridSections) ⇒ AbstractProgramGrid
Populate the grid partially: inserts programs for some channels in some time range. ProgramLists are created only for non-empty channels.
Base implementation with JSON data standardized to be as close as possible to the internal model. This method allows to initialize the grid by chunks (any channels, any time range in any order).
Chunks must be in a format close to ProgramSection :
[
{
channelId: channel ID,
endTime: end time of the last program
ids, titles, genres, starts: arrays
}, ...
]
Important: data chunks must be adjacent (next first time === previous last time) and must not overlap (next first time < previous last time)
Kind: instance method of AbstractProgramGrid
Returns: AbstractProgramGrid
- Current instance to allow chaining functions
Param | Type | Description |
---|---|---|
gridSections | Array.<object> | a list of ProgramListSections (1 grid section = multiple channel sections) |
getProgramList(channelId) ⇒ ProgramList
| undefined
Get the ProgramList associated to a specific channel.
Kind: instance method of AbstractProgramGrid
Param | Type |
---|---|
channelId | string |
_getChunkChannelId(chunk) ⇒ string
Return the channel id of the chunk It is the channel id that will be used later on to retrieve programs associated to a channel By default, the channel id is chunk.channelId
Kind: instance method of AbstractProgramGrid
Returns: string
- the chunk channel id
Access: protected
Param | Type | Description |
---|---|---|
chunk | Object | the chunk |
_resolveChannelId(channelId) ⇒ string
From the id of a channel, returns the id of the corresponding chunk. By default, it should be the same. But on some implementations, it may differs, and there is a need to make a reconciliation between tht channel ids and the guide ones
Kind: instance method of AbstractProgramGrid
Returns: string
- the chunk channel id
Access: protected
Param | Type |
---|---|
channelId | string |