mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-23 01:53:17 +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,
|
||||
stream: {
|
||||
[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);
|
||||
let stations: station[] = await fetch(options.url)
|
||||
.then(this.checkFetchStatus)
|
||||
.then((response: Response) => response.json());
|
||||
.then((response: Response) => response.json() as Promise<station[]>);
|
||||
|
||||
for(const station of stations){
|
||||
this.push(station);
|
||||
|
Loading…
Reference in New Issue
Block a user