mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-11-09 23:40:18 +00:00
Update Stations class: Add type to fetched stations list
This commit is contained in:
parent
12a138d52e
commit
93b79f8046
@ -6,6 +6,10 @@ export interface station {
|
|||||||
logo: string,
|
logo: string,
|
||||||
stream: {
|
stream: {
|
||||||
[key: string]: string
|
[key: string]: string
|
||||||
|
},
|
||||||
|
playlist?: {
|
||||||
|
type: "supla" | "yle",
|
||||||
|
address: string | string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20,7 +24,7 @@ export default class Stations extends Array {
|
|||||||
logger('Stations', 'Started fetching list - ' + options.url);
|
logger('Stations', 'Started fetching list - ' + options.url);
|
||||||
let stations: station[] = await fetch(options.url)
|
let stations: station[] = await fetch(options.url)
|
||||||
.then(this.checkFetchStatus)
|
.then(this.checkFetchStatus)
|
||||||
.then((response: Response) => response.json());
|
.then((response: Response) => response.json() as Promise<station[]>);
|
||||||
|
|
||||||
for(const station of stations){
|
for(const station of stations){
|
||||||
this.push(station);
|
this.push(station);
|
||||||
|
Loading…
Reference in New Issue
Block a user