AbstractProgramList
On this page
- title: AbstractProgramList
- Classes
- AbstractProgramList ⇐
Abstract
- AbstractProgramList()
- AbstractProgramList()
- insertSection(section)
- getProgramById(programId) ⇒
Promise.<GridProgram>
- getProgramAt(timestamp, [offset]) ⇒
GridProgram
- _getProgram(section, index) ⇒
GridProgram
- _getProgramById(programId) ⇒
Promise.<GridProgram>
- _removeProgramsBefore(section, number)
- _removeProgramsAfter(section, number)
- _createSection(startTime, endTime, isEmpty) ⇒
Section
- _getSectionIndexAt(timestamp) ⇒
integer
- isSectionValid(section) ⇒
boolean
- isSectionEmpty(section) ⇒
boolean
- Section :
Object
- AbstractProgramList
- AbstractProgramList()
- AbstractProgramList()
- insertSection(section)
- getProgramById(programId) ⇒
Promise.<GridProgram>
- getProgramAt(timestamp, [offset]) ⇒
GridProgram
- _getProgram(section, index) ⇒
GridProgram
- _getProgramById(programId) ⇒
Promise.<GridProgram>
- _removeProgramsBefore(section, number)
- _removeProgramsAfter(section, number)
- _createSection(startTime, endTime, isEmpty) ⇒
Section
- _getSectionIndexAt(timestamp) ⇒
integer
- isSectionValid(section) ⇒
boolean
- isSectionEmpty(section) ⇒
boolean
- Section :
Object
title: AbstractProgramList
Classes
- AbstractProgramList ⇐
Abstract
- AbstractProgramList
AbstractProgramList ⇐ Abstract
Kind: global abstract class
Extends: Abstract
Properties
Name | Type | Description |
---|---|---|
channelId | string | integer | Channel ID. Used by ProgramGrid. |
sections | Array.<Object> | The sections composing this program list |
boundingStart | number | start date of the bounding (in milliseconds) |
boundingEnd | number | end date of the bounding (in milliseconds) |
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) |
- AbstractProgramList ⇐
Abstract
- new AbstractProgramList()
- new AbstractProgramList()
- instance
- .insertSection(section)
- .getProgramById(programId) ⇒
Promise.<GridProgram>
- .getProgramAt(timestamp, [offset]) ⇒
GridProgram
- ._getProgram(section, index) ⇒
GridProgram
- ._getProgramById(programId) ⇒
Promise.<GridProgram>
- ._removeProgramsBefore(section, number)
- ._removeProgramsAfter(section, number)
- ._createSection(startTime, endTime, isEmpty) ⇒
Section
- ._getSectionIndexAt(timestamp) ⇒
integer
- static
- .isSectionValid(section) ⇒
boolean
- .isSectionEmpty(section) ⇒
boolean
- .isSectionValid(section) ⇒
- inner
- ~Section :
Object
- ~Section :
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)
Param | Type |
---|---|
section | Section |
getProgramById(programId) ⇒ Promise.<GridProgram>
Allows to retrieve a program in the current sections
Kind: instance method of AbstractProgramList
Param | Type | Description |
---|---|---|
programId | String | 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
Param | Type | Default | Description |
---|---|---|---|
timestamp | timestamp | ||
[offset] | number | 0 | +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
Param | Type | Description |
---|---|---|
section | object | section to retrieve program data on |
index | number | 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
Param | Type | Description |
---|---|---|
programId | String | 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
Param | Type | Description |
---|---|---|
section | object | section to remove programs data from |
number | number | 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
Param | Type | Description |
---|---|---|
section | object | section to remove programs data from |
number | number | number of programs to delete |
_createSection(startTime, endTime, isEmpty) ⇒ Section
Extension point to create a section
Kind: instance abstract method of AbstractProgramList
Access: protected
Param | Type | Description |
---|---|---|
startTime | number | start time of the section |
endTime | number | end time of the section |
isEmpty | boolean | 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.
Param | Type | Description |
---|---|---|
timestamp | timestamp | as stored in the ProgramListSection |
isSectionValid(section) ⇒ boolean
Allows to test if a section object is valid
Kind: static method of AbstractProgramList
Param | Type |
---|---|
section | Section |
isSectionEmpty(section) ⇒ boolean
Allows to test if a section object is empty
Kind: static method of AbstractProgramList
Param | Type |
---|---|
section | Section |
Section : Object
Kind: inner typedef of AbstractProgramList
Properties
Name | Type | Description |
---|---|---|
channelId | string | Id of the related channel |
startTime | number | The start time of the section (in seconds) |
endTime | number | The end time of the section (in seconds) |
ids | Array.<string> | List of programs id in the section (ordered by program start date) |
contentIds | Array.<string> | List of program related contents id in the section (ordered by program start date) |
names | Array.<string> | List of programs title in the section (ordered by program start date) |
relativeStarts | Array.<number> | The start time (in seconds) of the programs, in ascending order ; the time is relative to startTime |
more | Array.<string> | More information: the genre or if content is an episode of a series the episode name |
shortDescriptions | Array.<string> | Array of program short descriptions, which is the shortDescription field of the content tied to the program |
tags | Array.<string> | Array of tags, flags and additional info for each program stored in 31-bit integers |
AbstractProgramList
Kind: global class
- AbstractProgramList
- new AbstractProgramList()
- new AbstractProgramList()
- instance
- .insertSection(section)
- .getProgramById(programId) ⇒
Promise.<GridProgram>
- .getProgramAt(timestamp, [offset]) ⇒
GridProgram
- ._getProgram(section, index) ⇒
GridProgram
- ._getProgramById(programId) ⇒
Promise.<GridProgram>
- ._removeProgramsBefore(section, number)
- ._removeProgramsAfter(section, number)
- ._createSection(startTime, endTime, isEmpty) ⇒
Section
- ._getSectionIndexAt(timestamp) ⇒
integer
- static
- .isSectionValid(section) ⇒
boolean
- .isSectionEmpty(section) ⇒
boolean
- .isSectionValid(section) ⇒
- inner
- ~Section :
Object
- ~Section :
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)
Param | Type |
---|---|
section | Section |
getProgramById(programId) ⇒ Promise.<GridProgram>
Allows to retrieve a program in the current sections
Kind: instance method of AbstractProgramList
Param | Type | Description |
---|---|---|
programId | String | 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
Param | Type | Default | Description |
---|---|---|---|
timestamp | timestamp | ||
[offset] | number | 0 | +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
Param | Type | Description |
---|---|---|
section | object | section to retrieve program data on |
index | number | 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
Param | Type | Description |
---|---|---|
programId | String | 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
Param | Type | Description |
---|---|---|
section | object | section to remove programs data from |
number | number | 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
Param | Type | Description |
---|---|---|
section | object | section to remove programs data from |
number | number | number of programs to delete |
_createSection(startTime, endTime, isEmpty) ⇒ Section
Extension point to create a section
Kind: instance abstract method of AbstractProgramList
Access: protected
Param | Type | Description |
---|---|---|
startTime | number | start time of the section |
endTime | number | end time of the section |
isEmpty | boolean | 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.
Param | Type | Description |
---|---|---|
timestamp | timestamp | as stored in the ProgramListSection |
isSectionValid(section) ⇒ boolean
Allows to test if a section object is valid
Kind: static method of AbstractProgramList
Param | Type |
---|---|
section | Section |
isSectionEmpty(section) ⇒ boolean
Allows to test if a section object is empty
Kind: static method of AbstractProgramList
Param | Type |
---|---|
section | Section |
Section : Object
Kind: inner typedef of AbstractProgramList
Properties
Name | Type | Description |
---|---|---|
channelId | string | Id of the related channel |
startTime | number | The start time of the section (in seconds) |
endTime | number | The end time of the section (in seconds) |
ids | Array.<string> | List of programs id in the section (ordered by program start date) |
contentIds | Array.<string> | List of program related contents id in the section (ordered by program start date) |
names | Array.<string> | List of programs title in the section (ordered by program start date) |
relativeStarts | Array.<number> | The start time (in seconds) of the programs, in ascending order ; the time is relative to startTime |
more | Array.<string> | More information: the genre or if content is an episode of a series the episode name |
shortDescriptions | Array.<string> | Array of program short descriptions, which is the shortDescription field of the content tied to the program |
tags | Array.<string> | Array of tags, flags and additional info for each program stored in 31-bit integers |