new music card

This commit is contained in:
Alex Frantz
2024-03-23 22:55:38 -04:00
parent 41ec9550bd
commit 5acf3b30c7
5 changed files with 67 additions and 87 deletions
+21 -17
View File
@@ -10,30 +10,34 @@ type ImageListType = {
"#text": string
}
type LastTrackType = {
type TrackResponseType = {
status: number,
track: {
"@attr": object,
"album": {
"mbid": string,
"#text": string
},
"artist": {
"mbid": string,
"#text": string,
},
"image": ImageListType[],
track: LastTrackType[]
}
type LastTrackType = {
"@attr": {
"nowplaying": string
},
"album": {
"mbid": string,
"name": string,
"streamable": number,
"url": string
}
"#text": string
},
"artist": {
"mbid": string,
"#text": string,
},
"image": ImageListType[],
"mbid": string,
"name": string,
"streamable": number,
"url": string
}
export const miscRouter = createTRPCRouter({
song: publicProcedure
.query(async () => {
const response = await axios.get<LastTrackType>("https://api.thatalex.dev/v3/music/last-track")
const response = await axios.get<TrackResponseType>("https://api.thatalex.dev/v3/music/last-track")
return response.data
}),
})