AbstractProgramList


title: AbstractProgramList

Classes

AbstractProgramListAbstract
AbstractProgramList

AbstractProgramList ⇐ Abstract

Kind: global abstract class
Extends: Abstract
Properties

NameTypeDescription
channelIdstring | integer

Channel ID. Used by ProgramGrid.

sectionsArray.<Object>

The sections composing this program list

boundingStartnumber

start date of the bounding (in milliseconds)

boundingEndnumber

end date of the bounding (in milliseconds)

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)

AbstractProgramList()

Base class describing a list of programs on a single channel. The list is divided into independently loaded sections. This allows to use the AbstractProgramList before it is fully loaded.

Sections do not need to be contiguous. All sections contain at least 1 program.

AbstractProgramList()

Create clean empty fields inside this EPG program list at startup.

insertSection(section)

Insert a ProgramListSection in this list.

This method allows to initialize the list by chunks, in any order. If the section is empty, it is not inserted.

Kind: instance method of AbstractProgramList
Throws:

  • Will throw an error if the sections cannot be inserted (overlap)
ParamType
sectionSection

getProgramById(programId) ⇒ Promise.<GridProgram>

Allows to retrieve a program in the current sections

Kind: instance method of AbstractProgramList

ParamTypeDescription
programIdString

Id of the program to retrieve

getProgramAt(timestamp, [offset]) ⇒ GridProgram

Get a Program object.

Kind: instance method of AbstractProgramList
Returns: GridProgram - or undefined if not found

ParamTypeDefaultDescription
timestamptimestamp
[offset]number0

+1: next (if possible), -1: previous (if possible)

_getProgram(section, index) ⇒ GridProgram

Extension point to create a light program from data in a section

Kind: instance abstract method of AbstractProgramList
Access: protected

ParamTypeDescription
sectionobject

section to retrieve program data on

indexnumber

index of the program in the section

_getProgramById(programId) ⇒ Promise.<GridProgram>

Allows to retrieve a program in the current sections

Kind: instance method of AbstractProgramList

ParamTypeDescription
programIdString

Id of the program to retrieve

_removeProgramsBefore(section, number)

Extension point to remove the beginning of a section.

Kind: instance abstract method of AbstractProgramList
Access: protected

ParamTypeDescription
sectionobject

section to remove programs data from

numbernumber

number of programs to delete

_removeProgramsAfter(section, number)

Extension point to remove the end of a section.

Kind: instance abstract method of AbstractProgramList
Access: protected

ParamTypeDescription
sectionobject

section to remove programs data from

numbernumber

number of programs to delete

_createSection(startTime, endTime, isEmpty) ⇒ Section

Extension point to create a section

Kind: instance abstract method of AbstractProgramList
Access: protected

ParamTypeDescription
startTimenumber

start time of the section

endTimenumber

end time of the section

isEmptyboolean

True if an empty section is needed

_getSectionIndexAt(timestamp) ⇒ integer

Returns the index of the first section ending strictly after timestamp. The returned section does not necessarily include the timestamp, it can start after it (not checked because this method is also used to find where to insert a new section).

Kind: instance method of AbstractProgramList
Returns: integer - section index, in the range 0..sections.length. If there is no section after the timestamp, returns the total number of sections.

ParamTypeDescription
timestamptimestamp

as stored in the ProgramListSection

isSectionValid(section) ⇒ boolean

Allows to test if a section object is valid

Kind: static method of AbstractProgramList

ParamType
sectionSection

isSectionEmpty(section) ⇒ boolean

Allows to test if a section object is empty

Kind: static method of AbstractProgramList

ParamType
sectionSection

Section : Object

Kind: inner typedef of AbstractProgramList
Properties

NameTypeDescription
channelIdstring

Id of the related channel

startTimenumber

The start time of the section (in seconds)

endTimenumber

The end time of the section (in seconds)

idsArray.<string>

List of programs id in the section (ordered by program start date)

contentIdsArray.<string>

List of program related contents id in the section (ordered by program start date)

namesArray.<string>

List of programs title in the section (ordered by program start date)

relativeStartsArray.<number>

The start time (in seconds) of the programs, in ascending order ; the time is relative to startTime

moreArray.<string>

More information: the genre or if content is an episode of a series the episode name

shortDescriptionsArray.<string>

Array of program short descriptions, which is the shortDescription field of the content tied to the program

tagsArray.<string>

Array of tags, flags and additional info for each program stored in 31-bit integers

AbstractProgramList

Kind: global class

AbstractProgramList()

Base class describing a list of programs on a single channel. The list is divided into independently loaded sections. This allows to use the AbstractProgramList before it is fully loaded.

Sections do not need to be contiguous. All sections contain at least 1 program.

AbstractProgramList()

Create clean empty fields inside this EPG program list at startup.

insertSection(section)

Insert a ProgramListSection in this list.

This method allows to initialize the list by chunks, in any order. If the section is empty, it is not inserted.

Kind: instance method of AbstractProgramList
Throws:

  • Will throw an error if the sections cannot be inserted (overlap)
ParamType
sectionSection

getProgramById(programId) ⇒ Promise.<GridProgram>

Allows to retrieve a program in the current sections

Kind: instance method of AbstractProgramList

ParamTypeDescription
programIdString

Id of the program to retrieve

getProgramAt(timestamp, [offset]) ⇒ GridProgram

Get a Program object.

Kind: instance method of AbstractProgramList
Returns: GridProgram - or undefined if not found

ParamTypeDefaultDescription
timestamptimestamp
[offset]number0

+1: next (if possible), -1: previous (if possible)

_getProgram(section, index) ⇒ GridProgram

Extension point to create a light program from data in a section

Kind: instance abstract method of AbstractProgramList
Access: protected

ParamTypeDescription
sectionobject

section to retrieve program data on

indexnumber

index of the program in the section

_getProgramById(programId) ⇒ Promise.<GridProgram>

Allows to retrieve a program in the current sections

Kind: instance method of AbstractProgramList

ParamTypeDescription
programIdString

Id of the program to retrieve

_removeProgramsBefore(section, number)

Extension point to remove the beginning of a section.

Kind: instance abstract method of AbstractProgramList
Access: protected

ParamTypeDescription
sectionobject

section to remove programs data from

numbernumber

number of programs to delete

_removeProgramsAfter(section, number)

Extension point to remove the end of a section.

Kind: instance abstract method of AbstractProgramList
Access: protected

ParamTypeDescription
sectionobject

section to remove programs data from

numbernumber

number of programs to delete

_createSection(startTime, endTime, isEmpty) ⇒ Section

Extension point to create a section

Kind: instance abstract method of AbstractProgramList
Access: protected

ParamTypeDescription
startTimenumber

start time of the section

endTimenumber

end time of the section

isEmptyboolean

True if an empty section is needed

_getSectionIndexAt(timestamp) ⇒ integer

Returns the index of the first section ending strictly after timestamp. The returned section does not necessarily include the timestamp, it can start after it (not checked because this method is also used to find where to insert a new section).

Kind: instance method of AbstractProgramList
Returns: integer - section index, in the range 0..sections.length. If there is no section after the timestamp, returns the total number of sections.

ParamTypeDescription
timestamptimestamp

as stored in the ProgramListSection

isSectionValid(section) ⇒ boolean

Allows to test if a section object is valid

Kind: static method of AbstractProgramList

ParamType
sectionSection

isSectionEmpty(section) ⇒ boolean

Allows to test if a section object is empty

Kind: static method of AbstractProgramList

ParamType
sectionSection

Section : Object

Kind: inner typedef of AbstractProgramList
Properties

NameTypeDescription
channelIdstring

Id of the related channel

startTimenumber

The start time of the section (in seconds)

endTimenumber

The end time of the section (in seconds)

idsArray.<string>

List of programs id in the section (ordered by program start date)

contentIdsArray.<string>

List of program related contents id in the section (ordered by program start date)

namesArray.<string>

List of programs title in the section (ordered by program start date)

relativeStartsArray.<number>

The start time (in seconds) of the programs, in ascending order ; the time is relative to startTime

moreArray.<string>

More information: the genre or if content is an episode of a series the episode name

shortDescriptionsArray.<string>

Array of program short descriptions, which is the shortDescription field of the content tied to the program

tagsArray.<string>

Array of tags, flags and additional info for each program stored in 31-bit integers