diff --git a/src/payloads/album.payload.ts b/src/payloads/album.payload.ts index 9291e73..0d8f520 100644 --- a/src/payloads/album.payload.ts +++ b/src/payloads/album.payload.ts @@ -52,7 +52,7 @@ export function albumPayload( name: decode(title), subtitle: decode( subtitle || - (artistMap?.artists.map((a) => a.name.trim()).join(", ") ?? "") + (artistMap?.artists?.map((a) => a.name.trim()).join(", ") ?? "") ), type, language, diff --git a/src/payloads/artist.payload.ts b/src/payloads/artist.payload.ts index ff1efde..df12c54 100644 --- a/src/payloads/artist.payload.ts +++ b/src/payloads/artist.payload.ts @@ -282,9 +282,9 @@ export function artistMapPayload( primary_artists: [], } : { - artists: dedupArtists(a.artists.map(artistMiniPayload)), + artists: dedupArtists(a.artists?.map(artistMiniPayload) ?? []), featured_artists: dedupArtists( - a.featured_artists.map(artistMiniPayload) + a.featured_artists?.map(artistMiniPayload) ?? [] ), primary_artists: dedupArtists(a.primary_artists.map(artistMiniPayload)), }; diff --git a/src/payloads/misc.payload.ts b/src/payloads/misc.payload.ts index 838fd3a..cf33c45 100644 --- a/src/payloads/misc.payload.ts +++ b/src/payloads/misc.payload.ts @@ -61,7 +61,7 @@ export function miniPayload(item: MiniPayloadRequest): MiniResponse { album_url = more_info.album_url; } if (type === "album" && "artistMap" in more_info) { - subs = more_info?.artistMap?.artists.map((a) => a.name.trim()).join(","); + subs = more_info?.artistMap?.artists?.map((a) => a.name.trim()).join(","); } if (type === "radio_station" && "color" in more_info) { color = more_info.color; diff --git a/src/routes/get.route.ts b/src/routes/get.route.ts index 786fcd2..5d6cc4f 100644 --- a/src/routes/get.route.ts +++ b/src/routes/get.route.ts @@ -237,7 +237,7 @@ get.get("/footer-details", async (c) => { if (!lang) throw new Error("Language param is required"); const result: FooterDetails = await api(fd, { - query: { language: validLangs(lang), p, n }, + query: { language: validLangs(lang).split(",").at(0) ?? "hindi", p, n }, }); // if (!result.playlist.length) { diff --git a/src/types/artist.ts b/src/types/artist.ts index 95a3f74..b6e02f6 100644 --- a/src/types/artist.ts +++ b/src/types/artist.ts @@ -95,8 +95,8 @@ export type SimilarArtistRequest = { export type ArtistMapRequest = { primary_artists: ArtistMiniRequest[]; - featured_artists: ArtistMiniRequest[]; - artists: ArtistMiniRequest[]; + featured_artists?: ArtistMiniRequest[]; + artists?: ArtistMiniRequest[]; }; export type ArtistMiniRequest = {