new currently playing music card

This commit is contained in:
alex 3
2023-12-19 17:34:35 -05:00
parent 7468125ad3
commit 30173a5bbd
8 changed files with 175 additions and 3 deletions
+39
View File
@@ -0,0 +1,39 @@
import axios from 'axios';
import {
createTRPCRouter,
publicProcedure
} from '@/server/api/trpc';
type ImageListType = {
"size": string,
"#text": string
}
type LastTrackType = {
status: number,
track: {
"@attr": object,
"album": {
"mbid": 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")
return response.data
}),
})