diff --git a/apps/web/src/api/library.ts b/apps/web/src/api/library.ts index 12a9fbc1..52f4f61c 100644 --- a/apps/web/src/api/library.ts +++ b/apps/web/src/api/library.ts @@ -1,4 +1,5 @@ import { client } from "."; +import { Artist } from "../types/artist"; export const getSongByUri = async (uri: string) => { if (uri.includes("app.rocksky.scrobble")) { @@ -77,15 +78,18 @@ export const getArtists = async ( startDate?: Date, endDate?: Date, ) => { - const response = await client.get("/xrpc/app.rocksky.actor.getActorArtists", { - params: { - did, - limit, - offset, - startDate: startDate?.toISOString(), - endDate: endDate?.toISOString(), + const response = await client.get<{ artists: Artist[] }>( + "/xrpc/app.rocksky.actor.getActorArtists", + { + params: { + did, + limit, + offset, + startDate: startDate?.toISOString(), + endDate: endDate?.toISOString(), + }, }, - }); + ); return response.data; }; diff --git a/apps/web/src/hooks/useLibrary.tsx b/apps/web/src/hooks/useLibrary.tsx index c76ef85d..4f538c0e 100644 --- a/apps/web/src/hooks/useLibrary.tsx +++ b/apps/web/src/hooks/useLibrary.tsx @@ -45,8 +45,7 @@ export const useArtistsQuery = ( queryFn: () => getArtists(did, offset, limit, startDate, endDate), enabled: !!did, select: (data) => - // eslint-disable-next-line @typescript-eslint/no-explicit-any - data?.artists.map((x: any) => ({ + data?.artists.map((x) => ({ ...x, scrobbles: x.playCount, })), diff --git a/apps/web/src/pages/profile/Profile.tsx b/apps/web/src/pages/profile/Profile.tsx index a9746495..64dd9ebe 100644 --- a/apps/web/src/pages/profile/Profile.tsx +++ b/apps/web/src/pages/profile/Profile.tsx @@ -295,7 +295,7 @@ function Profile(props: ProfileProps) { )} {tags.length > 0 && ( -
+
{tags.map((genre) => (