AbstractProgramGrid

AbstractProgramGrid ⇐ Class

Kind: global abstract class
Extends: Class
Properties

NameTypeDescription
programListsListModel.<ProgramList>

List of program lists

channelCountNumber

Number of channels in EPG

boundingStartnumber

start date of the bounding

boundingEndnumber

end date of the bounding

emptyProgramDurationnumber

empty program duration to fill empty section, no filling if null

modifyOverlappingSectionsboolean

Flag to activate auto modification of section overlapping existing ones (default=true)

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

ParamTypeDescription
gridSectionsArray.<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

ParamType
channelIdstring

_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

ParamTypeDescription
chunkObject

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

ParamType
channelIdstring