ref: lastfm: show last update and reduce limit

This commit is contained in:
GivFNZ 2025-03-22 18:13:51 -03:00
parent f44e78e10b
commit 68710d14d7
No known key found for this signature in database
GPG Key ID: 63DD92181B575322
4 changed files with 19 additions and 6 deletions

View File

@ -1,7 +1,7 @@
{
"name": "givs-website-react",
"private": true,
"version": "1.2.3",
"version": "1.2.4",
"type": "module",
"scripts": {
"dev": "vite",

View File

@ -15,8 +15,19 @@ export interface getRecentTracksResponse {
mbid: string,
name: string,
url: string,
date: {
uts: string,
"#text": string
}
}
],
"@attr": {
user: string,
totalPages: string,
page: string,
perPage: string,
total: string
}
]
}
}
@ -26,7 +37,8 @@ export async function getRecentTracks() {
api_key,
method: 'user.getrecenttracks',
user: 'givfnz',
format: 'json'
format: 'json',
limit: 1
}
})
return response.data

View File

@ -2,7 +2,7 @@ export default function Footer() {
return (
<footer>
<p>© 2025 GivFNZ</p>
<p>Version: 1.2.3</p>
<p>Version: 1.2.4</p>
</footer>
)
}

View File

@ -14,9 +14,10 @@ export default function Music() {
return (
<MainContainer>
<h1>{t("myLast")}</h1>
<h2>{t("myLastDescription")}</h2>
<h3>{t("myLastDescription")}</h3>
<Paragraph>{lastResponse?.recenttracks?.track[0].name} - {lastResponse?.recenttracks?.track[0].artist["#text"]}</Paragraph>
<a href={lastResponse?.recenttracks?.track[0].url}>{t("lastLink")}</a>
<a target="blank" href={lastResponse?.recenttracks?.track[0].url}>{t("lastLink")}</a>
<Paragraph>Last update: {lastResponse?.recenttracks?.track[0]?.date["#text"]} UTC</Paragraph>
</MainContainer>
)
}