AbstractRadioService

AbstractRadioService ⇐ Abstract

Kind: global abstract class
Extends: Abstract
Service:

AbstractRadioService()

This class represents the service that handles the radios.

getRadioList([options]) ⇒ Promise.<AbstractRadioList, Error>

Get the radios of the current radio list , sorted by position.

Kind: instance method of AbstractRadioService
Returns: Promise.<AbstractRadioList, Error> - A promise resolved with an array of radios or rejected in case of problem

ParamTypeDefaultDescription
[options]Object

Additional options

[options.duration]number

Duration in milliseconds before invalidation of cache (if null, $$maxAge value is used by default)

getRadio(id) ⇒ Promise.<AbstractRadio>

Get a radio by its id. The radio must belongs to the list

Kind: instance method of AbstractRadioService
Returns: Promise.<AbstractRadio> - A promise resolved with the radio data (or undefined if not found).

ParamTypeDescription
idstring

the id of the radio

_getRadioList() ⇒ * | Promise.<AbstractRadioList, Error>

Kind: instance abstract method of AbstractRadioService

_getRadio(id, radioList) ⇒ Radio | Promise.<Radio, Error>

Given the radioList, get the radio by it’s id

Kind: instance method of AbstractRadioService
Returns: Radio | Promise.<Radio, Error> - the found radio, null otherwise
Access: protected

ParamTypeDescription
idstring

the radio id

radioListRadioList

The radio list

_onRadioListChange(newRadioListDef, oldRadioListDef) ⇒ Promise

Kind: instance method of AbstractRadioService
Access: protected

ParamType
newRadioListDefArray.<AbstractRadio>
oldRadioListDefArray.<AbstractRadio>

“radioListChange” (newRadioListDef, oldRadioListDef)

Fired when the current list has been changed

Kind: event emitted by AbstractRadioService

ParamTypeDescription
newRadioListDefObject

The new list {listId:listId, type:listType}

oldRadioListDefObject

The old list {listId:listId, type:listType}