diff --git a/websites/S/SoundCloud/metadata.json b/websites/S/SoundCloud/metadata.json index 8565989ef402..d0b7bbdc1962 100644 --- a/websites/S/SoundCloud/metadata.json +++ b/websites/S/SoundCloud/metadata.json @@ -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.4.16", + "version": "2.5.0", "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", @@ -76,6 +76,12 @@ "title": "Show Buttons", "icon": "fas fa-compress-arrows-alt", "value": true + }, + { + "id": "usePresenceName", + "title": "Show Title as Presence", + "icon": "fad fa-user-edit", + "value": false } ] } \ No newline at end of file diff --git a/websites/S/SoundCloud/presence.ts b/websites/S/SoundCloud/presence.ts index a4b1e9444d0b..6f7418ea1a7e 100644 --- a/websites/S/SoundCloud/presence.ts +++ b/websites/S/SoundCloud/presence.ts @@ -119,6 +119,7 @@ presence.on("UpdateData", async () => { showTimestamps, showCover, showButtons, + usePresenceName, newLang, ] = await Promise.all([ presence.getSetting("browse"), @@ -127,6 +128,7 @@ presence.on("UpdateData", async () => { presence.getSetting("timestamp"), presence.getSetting("cover"), presence.getSetting("buttons"), + presence.getSetting("usePresenceName"), presence.getSetting("lang").catch(() => "en"), ]), playing = Boolean(document.querySelector(".playControls__play.playing")); @@ -152,10 +154,17 @@ presence.on("UpdateData", async () => { } if ((playing || (!playing && !showBrowsing)) && showSong) { - presenceData.details = getElement( - ".playbackSoundBadge__titleLink > span:nth-child(2)" - ); - presenceData.state = getElement(".playbackSoundBadge__lightLink"); + if (!usePresenceName) { + presenceData.details = getElement( + ".playbackSoundBadge__titleLink > span:nth-child(2)" + ); + presenceData.state = getElement(".playbackSoundBadge__lightLink"); + } else { + presenceData.name = getElement( + ".playbackSoundBadge__titleLink > span:nth-child(2)" + ); + presenceData.details = getElement(".playbackSoundBadge__lightLink"); + } const timePassed = document.querySelector( "div.playbackTimeline__timePassed > span:nth-child(2)"