Skip to content

Commit

Permalink
chore: minor improvements and fixes
Browse files Browse the repository at this point in the history
Signed-off-by: rajput-hemant <[email protected]>
  • Loading branch information
rajput-hemant committed Nov 22, 2024
1 parent 131659d commit 0826099
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/payloads/album.payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/payloads/artist.payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
};
Expand Down
2 changes: 1 addition & 1 deletion src/payloads/misc.payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/get.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/types/artist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 0826099

Please sign in to comment.