Constructor
new module:ct-sljsadapter /providers /Stream Link Watchlist Service()
Methods
create(name, erroropt, successopt)
This method is meant to be invoked by UI components wishing to create a new shareable watchlist.
The newly created watchlist will be represented on the front-end by a
module:ct-sljsadapter/watchlist/StreamLinkWatchlist
.
This method submits a contrib to streamlink to create the new watchlist.
If the request is successful, an ADDED event will be raised
(see module:ct-watchlist/WatchlistServiceEvents
) and the newly created watchlist object will be passed.
If the requested watchlist has not been created by streamlink after the timeout has elapsed, error will be called.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
String | The presentation name for the watchlist. |
|
error |
function |
<optional> |
A callback that will be invoked if the request times out. |
success |
module:ct-sljsadapter |
<optional> |
A callback that will be invoked when the backend reports that the new watchlist is successfully added. |
- Implements:
- See:
Throws:
-
If required properties are not included, or if error and success are not functions.
dispose(watchlists, erroropt, successopt)
A request to dispose of the given watchlists, removing them from the user's list of watchlists.
If the request is successful, a REMOVED event will be raised for each
watchlist removed (see module:ct-watchlist/WatchlistServiceEvents
).
If all the watchlists have not been removed by streamlink after the timeout
has elapsed, error will be called.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
watchlists |
Array |
The watchlists to dispose of. |
|
error |
function |
<optional> |
A callback that will be invoked if the request fails. |
success |
function |
<optional> |
A callback that will be invoked when the request succeeds. |
- Implements:
- See:
Throws:
-
If the given watchlists are not Watchlists, not found in the current list, or if error and success are not functions.
get ById()
- Implements:
get Watchlist Count()
get Watchlists()
set Request Timeout(duration)
Set the duration in milliseconds for how long to wait after a contrib before timing out and calling
the error callback. If this method is never called, the timeout defaults to
module:ct-sljsadapter/watchlist/StreamLinkWatchlistServiceConstants#CONTRIB_TIMEOUT
Parameters:
Name | Type | Description |
---|---|---|
duration |
Number | duration in milliseconds for timeouts for contribs to back-end |
Type Definitions
create Success Callback(watchlist)
A callback function called upon success of
module:ct-sljsadapter/providers/StreamLinkWatchlistService#create
.
Parameters:
Name | Type | Description |
---|---|---|
watchlist |
module:ct-sljsadapter |
The newly created watchlist object. |