IProgramLineupProvider2
An updated interface for IProgramLineupProvider
which supports partially successful commits and
provides error feedback for programs that failed to commit.
Details
This provider is used to update the program lineup in the EPG.
The upsert()
function can be called multiple times within the same provider object to add programs to the
commit queue. All operations performed within the provider will be persisted when the commit()
function is called.
Please note that this interface is not thread-safe. Do not create multiple instances of this object for use
in different threads to avoid non-deterministic behavior.
Please discard this object and create a new instance if this object has thrown an error in one of its methods.
Properties
clearAllPrograms()
clearAllPrograms: () =>
Promise
<void
>
Clears all programs from the data store.
Returns
Promise
<void
>
Details
Removes all programs from the data store. This action is not persisted until commit()
is called.
This will not clear channel information from the data store. Utilize this function exclusively when there is a need
to remove added programs from the Electronic Program Guide (EPG). The function call for clearAllPrograms()
must preceed all calls to upsert()
within the same transaction.
Throws
IllegalStateError
if clearAllPrograms() is called after upsert() within this transaction,
or if this function is called after the Provider has already thrown an InternalError
previously.
Throws
InternalError
if the program data cannot be cleared for any other reason.
Methods
commit()
commit(
version
):Promise
<void
>
Commits any pending operations that didn't result in a IUpsertProgramFailure
to the data store.
Parameters
version
string
A string representing the version of the program lineup that will be in the data store as a result of this commit.
Returns
Promise
<void
>
Details
This function should be called after performing operations on the provider using the other
methods in the provider interface. EpgLineupInformation.getLastCommittedProgramLineupVersion()
will begin to return this version value once this call succeeds.
Throws
IllegalStateError
if this function is called after the Provider has already
thrown an InternalError
previously in one of its methods.
Throws
InternalError
if the data cannot be committed to the data store.
upsert()
upsert(
programs
):Promise
<IUpsertProgramFailure
[]>
Upserts a list of programs for the program lineup in the EPG. Will skip any programs that fail to be inserted and will continue to try to insert the rest of the programs provided.
Parameters
programs
IProgram
[]
An array of program instances to be inserted.
Returns
Promise
<IUpsertProgramFailure
[]>
IUpsertProgramFailure*[] A list of programs that failed to be added to the commit queue and the error causing the failure. An empty array will be returened if all programs are added to the commit queue successfully.
Details
Inserts programs into the LiveTV Provider data store.
This action is not persisted until commit()
is called.
Throws
IllegalStateError
if this function is called after the Provider has already
thrown an error previously in one of its methods.
Throws
InternalError
if the data cannot be added to the commit queue for any other reason.
Throws
StorageLimitError
if this function encounters an error due to ingested data exceeding the storage limit.
Consult with your Amazon contact if you encounter this error.
Last updated: Sep 30, 2025