From 992057b6f71687b0db0be741c74e4c0946c50db3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20H=C3=A5rek=20Andreassen?= Date: Sat, 2 Mar 2024 18:29:02 +0100 Subject: [PATCH] fix: Clean up types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tim HÄrek Andreassen --- lib/nrk.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/nrk.ts b/lib/nrk.ts index d53e98a..c0e121c 100644 --- a/lib/nrk.ts +++ b/lib/nrk.ts @@ -4,8 +4,8 @@ import { components as catalogComponents } from "./nrk-catalog.ts"; type ArrayElement = A extends readonly (infer T)[] ? T : never; export type Serie = catalogComponents["schemas"]["SeriesViewModel"]; -type OriginalEpisode = catalogComponents["schemas"]["EpisodeHalResource"]; -export type OriginalEpisode = OriginalEpisode & { url: string }; +type _OriginalEpisode = catalogComponents["schemas"]["EpisodeHalResource"]; +export type OriginalEpisode = _OriginalEpisode & { url: string }; export type SearchResultList = searchComponents["schemas"]["seriesResult"]["results"]; export type SearchResult = ArrayElement & { description?: string; @@ -27,7 +27,7 @@ interface Manifest { } async function withDownloadLink( - episode: OriginalEpisode, + episode: _OriginalEpisode, ): Promise { // getting stream link const [playbackStatus, playbackResponse] = await get( @@ -80,10 +80,7 @@ export const nrkRadio = { throw `Error getting episodes for ${seriesId}: EpisodeStatus: ${episodeStatus}. SerieStatus: ${seriesStatus}`; } }, - getEpisode: async ( - seriesId: string, - episodeId: string, - ): Promise => { + getEpisode: async (seriesId: string, episodeId: string): Promise => { const url = `https://psapi.nrk.no/radio/catalog/podcast/${seriesId}/episodes/${episodeId}`; const [status, episode] = await get(url); if (status !== OK) {