A decentralized music tracking and discovery platform built on AT Protocol 🎵

Add Artist type and type getArtists response

Remove explicit any in useLibrary artist mapping to use inferred Artist
types. Add mb-[35px] to profile tags container for extra bottom spacing.

+24 -11
+12 -8
apps/web/src/api/library.ts
··· 1 1 import { client } from "."; 2 + import { Artist } from "../types/artist"; 2 3 3 4 export const getSongByUri = async (uri: string) => { 4 5 if (uri.includes("app.rocksky.scrobble")) { ··· 77 78 startDate?: Date, 78 79 endDate?: Date, 79 80 ) => { 80 - const response = await client.get("/xrpc/app.rocksky.actor.getActorArtists", { 81 - params: { 82 - did, 83 - limit, 84 - offset, 85 - startDate: startDate?.toISOString(), 86 - endDate: endDate?.toISOString(), 81 + const response = await client.get<{ artists: Artist[] }>( 82 + "/xrpc/app.rocksky.actor.getActorArtists", 83 + { 84 + params: { 85 + did, 86 + limit, 87 + offset, 88 + startDate: startDate?.toISOString(), 89 + endDate: endDate?.toISOString(), 90 + }, 87 91 }, 88 - }); 92 + ); 89 93 return response.data; 90 94 }; 91 95
+1 -2
apps/web/src/hooks/useLibrary.tsx
··· 45 45 queryFn: () => getArtists(did, offset, limit, startDate, endDate), 46 46 enabled: !!did, 47 47 select: (data) => 48 - // eslint-disable-next-line @typescript-eslint/no-explicit-any 49 - data?.artists.map((x: any) => ({ 48 + data?.artists.map((x) => ({ 50 49 ...x, 51 50 scrobbles: x.playCount, 52 51 })),
+1 -1
apps/web/src/pages/profile/Profile.tsx
··· 295 295 )} 296 296 </Group> 297 297 {tags.length > 0 && ( 298 - <div className="mt-[30px] flex flex-wrap"> 298 + <div className="mt-[30px] mb-[35px] flex flex-wrap"> 299 299 {tags.map((genre) => ( 300 300 <span 301 301 className="mr-[15px] mb-[5px] text-[var(--color-genre)] text-[13px] whitespace-nowrap"
+10
apps/web/src/types/artist.ts
··· 1 + export type Artist = { 2 + id: string; 3 + name: string; 4 + picture: string; 5 + playCount: number; 6 + sha256: string; 7 + tags: string[] | null; 8 + uniqueListeners: number; 9 + uri: string; 10 + };