Skip to content

Commit 0826099

Browse files
committed
chore: minor improvements and fixes
Signed-off-by: rajput-hemant <[email protected]>
1 parent 131659d commit 0826099

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/payloads/album.payload.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function albumPayload(
5252
name: decode(title),
5353
subtitle: decode(
5454
subtitle ||
55-
(artistMap?.artists.map((a) => a.name.trim()).join(", ") ?? "")
55+
(artistMap?.artists?.map((a) => a.name.trim()).join(", ") ?? "")
5656
),
5757
type,
5858
language,

src/payloads/artist.payload.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,9 @@ export function artistMapPayload(
282282
primary_artists: [],
283283
}
284284
: {
285-
artists: dedupArtists(a.artists.map(artistMiniPayload)),
285+
artists: dedupArtists(a.artists?.map(artistMiniPayload) ?? []),
286286
featured_artists: dedupArtists(
287-
a.featured_artists.map(artistMiniPayload)
287+
a.featured_artists?.map(artistMiniPayload) ?? []
288288
),
289289
primary_artists: dedupArtists(a.primary_artists.map(artistMiniPayload)),
290290
};

src/payloads/misc.payload.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function miniPayload(item: MiniPayloadRequest): MiniResponse {
6161
album_url = more_info.album_url;
6262
}
6363
if (type === "album" && "artistMap" in more_info) {
64-
subs = more_info?.artistMap?.artists.map((a) => a.name.trim()).join(",");
64+
subs = more_info?.artistMap?.artists?.map((a) => a.name.trim()).join(",");
6565
}
6666
if (type === "radio_station" && "color" in more_info) {
6767
color = more_info.color;

src/routes/get.route.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ get.get("/footer-details", async (c) => {
237237
if (!lang) throw new Error("Language param is required");
238238

239239
const result: FooterDetails = await api(fd, {
240-
query: { language: validLangs(lang), p, n },
240+
query: { language: validLangs(lang).split(",").at(0) ?? "hindi", p, n },
241241
});
242242

243243
// if (!result.playlist.length) {

src/types/artist.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ export type SimilarArtistRequest = {
9595

9696
export type ArtistMapRequest = {
9797
primary_artists: ArtistMiniRequest[];
98-
featured_artists: ArtistMiniRequest[];
99-
artists: ArtistMiniRequest[];
98+
featured_artists?: ArtistMiniRequest[];
99+
artists?: ArtistMiniRequest[];
100100
};
101101

102102
export type ArtistMiniRequest = {

0 commit comments

Comments
 (0)