From 93b79f8046300c597b5d8e6ef8d834f3c38606eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Tue, 21 Nov 2023 06:18:22 +0200 Subject: [PATCH] Update Stations class: Add type to fetched stations list --- src/client/classes/Stations.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/classes/Stations.ts b/src/client/classes/Stations.ts index c8319af..225a2eb 100644 --- a/src/client/classes/Stations.ts +++ b/src/client/classes/Stations.ts @@ -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); for(const station of stations){ this.push(station);