Skip to content

Commit

Permalink
feat(jut.su): add cover art and change activity type to watching (#8982)
Browse files Browse the repository at this point in the history
* feat(jut.su): add cover art and change activity type to watching

* feat(jut.su): improve activity message clarity
  • Loading branch information
quincyqqe authored Dec 22, 2024
1 parent 4ce1e37 commit 8d85bdb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion websites/J/jut.su/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"nl": "Jut.su is een Russische anime-website"
},
"url": "jut.su",
"version": "3.0.9",
"version": "3.0.11",
"logo": "https://cdn.rcd.gg/PreMiD/websites/J/jut.su/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/J/jut.su/assets/thumbnail.png",
"color": "#c9e58b",
Expand Down
15 changes: 14 additions & 1 deletion websites/J/jut.su/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ presence.on("UpdateData", async () => {
largeImageKey:
"https://cdn.rcd.gg/PreMiD/websites/J/jut.su/assets/logo.png",
startTimestamp: browsingTimestamp,
type: ActivityType.Watching,
},
{ pathname } = document.location,
title =
Expand Down Expand Up @@ -77,10 +78,22 @@ presence.on("UpdateData", async () => {
.replace(/смотреть\s/i, "")
.replace(/([0-9]* сезон)?\s?[0-9]* серия|[0-9] фильм/g, "")
.trim();
presenceData.details = `Смотрит аниме «${titles}»`;
presenceData.details = titles;
presenceData.state = name.textContent
.replace(/смотреть\s/i, "")
.replace(titles, "");

const coverArtElement = document.querySelector<HTMLDivElement>(
".all_anime_title.aat_ep"
);
if (coverArtElement) {
const coverArt = coverArtElement.style.backgroundImage;
if (coverArt) {
presenceData.largeImageKey = coverArt
.replace('url("', "")
.replace('")', "");
}
}
break;
}
case !!title:
Expand Down

0 comments on commit 8d85bdb

Please sign in to comment.