Skip to content

Commit

Permalink
chore(SoundCloud): only show small image on pause (#9107)
Browse files Browse the repository at this point in the history
* chore(SoundCloud): only show small image on pause

* chore(SoundCloud): bump version to 2.5.3
  • Loading branch information
Slowlife01 authored Jan 6, 2025
1 parent 0a637f9 commit cdd1b42
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion websites/S/SoundCloud/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"vi_VN": "SoundCloud là nền tảng phát nhạc và podcast trực tuyến nơi bạn có thể nghe hàng triệu bài hát từ khắp thế giới, hoặc tự đăng tải tác phẩm của riêng mình."
},
"url": "soundcloud.com",
"version": "2.5.2",
"version": "2.5.3",
"logo": "https://cdn.rcd.gg/PreMiD/websites/S/SoundCloud/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/S/SoundCloud/assets/thumbnail.jpg",
"color": "#FF7E30",
Expand Down
12 changes: 7 additions & 5 deletions websites/S/SoundCloud/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const presence = new Presence({
getStrings = async () => {
return presence.getStrings(
{
play: "general.playing",
pause: "general.paused",
browse: "general.browsing",
search: "general.searchSomething",
Expand Down Expand Up @@ -191,8 +190,13 @@ presence.on("UpdateData", async () => {
)
?.getAttribute("href");

[presenceData.startTimestamp, presenceData.endTimestamp] =
presence.getTimestamps(currentTime, duration);
if (playing) {
[presenceData.startTimestamp, presenceData.endTimestamp] =
presence.getTimestamps(currentTime, duration);
} else {
presenceData.smallImageKey = Assets.Pause;
presenceData.smallImageText = strings.pause;
}

if (showCover) {
presenceData.largeImageKey =
Expand All @@ -203,8 +207,6 @@ presence.on("UpdateData", async () => {
.style.backgroundImage.match(/"(.*)"/)?.[1]
.replace("-t50x50.jpg", "-t500x500.jpg") ?? "soundcloud";
}
presenceData.smallImageKey = playing ? Assets.Play : Assets.Pause;
presenceData.smallImageText = strings[playing ? "play" : "pause"];

if (showButtons && pathLinkSong) {
presenceData.buttons = [
Expand Down

0 comments on commit cdd1b42

Please sign in to comment.