add dynamic beatmap images to presence #12

Merged
HorizonCode merged 8 commits from dev into master 2024-03-11 17:55:54 +00:00
Showing only changes of commit c4d9862860 - Show all commits

11
main.js
View File

@ -104,13 +104,12 @@ function startOsuStatus() {
: " "; : " ";
if ("beatmap" in currentStatus.player_status.status) { if ("beatmap" in currentStatus.player_status.status) {
const setId = currentStatus.player_status.status.beatmap.set_id; const setId = currentStatus.player_status.status.beatmap.set_id;
if ( const coverImage =
checkImageExists(
`https://assets.ppy.sh/beatmaps/${setId}/covers/list@2x.jpg`,
)
) {
largeImageKey =
`https://assets.ppy.sh/beatmaps/${setId}/covers/list@2x.jpg`; `https://assets.ppy.sh/beatmaps/${setId}/covers/list@2x.jpg`;
if (
checkImageExists(coverImage)
) {
largeImageKey = coverImage;
} }
} }