Skip to content

Commit

Permalink
Revert "wtf man"
Browse files Browse the repository at this point in the history
This reverts commit f2cae0c.
  • Loading branch information
Rhys committed Nov 28, 2021
1 parent f2cae0c commit 0e31803
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
7 changes: 2 additions & 5 deletions websites/R/R10.net/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ presence.on("UpdateData", async () => {
cevap = document.querySelector(
"body > main > div > form > div:nth-child(12) > div.head"
),
head = document.querySelector("head > title"),
analiz = document.querySelector(
"body > div.page-header.r10title > div > div > h4 > span"
),
Expand All @@ -51,11 +52,7 @@ presence.on("UpdateData", async () => {
presenceData.state = document.querySelector(
"body > main > div > div.breadCrumb > div.top > div.left > div:nth-child(2) > span > h2"
).textContent;
} else if (
document
.querySelector("head > title")
.textContent.includes("Profil bilgileri:")
) {
} else if (head.textContent.includes("Profil bilgileri:")) {
presenceData.details = "Bir kullanıcıyı inceliyor:";
presenceData.state = document.querySelector(
"body > main > div.container > div.left > div:nth-child(1) > div > div.top > div.info > div.name > a"
Expand Down
16 changes: 7 additions & 9 deletions websites/R/Radiko/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,18 @@ let radioStation = "",
presence.on("UpdateData", async () => {
// code
const preStrings = await _preStrings,
streamPlayer = document.getElementById("stream-player") as HTMLElement,
whenPlayerIsOn = streamPlayer.style.display,
state: PresenceData = {
largeImageKey: "largeimage"
};

// In Radio
if (
(document.getElementById("stream-player") as HTMLElement).style.display ===
"block"
) {
const showTitle = (
document.querySelector(
"a.slick-slide:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(1) > div:nth-child(1)"
) as HTMLElement
).textContent,
if (whenPlayerIsOn === "block") {
const _showTitle = document.querySelector(
"a.slick-slide:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(1) > div:nth-child(1)"
) as HTMLElement,
showTitle = _showTitle.textContent,
[codeChannel] = document
.querySelector("a.slick-slide:nth-child(1)")
.getAttribute("href")
Expand Down
9 changes: 9 additions & 0 deletions websites/R/Radio Garden/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ presence.on("UpdateData", async () => {
presenceData.details = "Stopped";
delete presenceData.startTimestamp;
}
// This could work with some tweaks. It detects when youre not tuned into anything, but trips if radio youre tuned into is not in view...
// else {
// presenceData.smallImageKey = "statusstop";
// presenceData.smallImageText = "Tuning";
// presenceData.details = "Tuning";
// delete presenceData.state;
// delete presenceData.startTimestamp;
// console.log("broke")
// };
presence.setActivity(presenceData);
}
});
5 changes: 3 additions & 2 deletions websites/R/Rádio Animu/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ presence.on(

presence.on("UpdateData", async () => {
const presenceData: PresenceData = {
largeImageKey: "animu",
startTimestamp: browsingTimestamp
largeImageKey: "animu"
};

presenceData.startTimestamp = browsingTimestamp;
if (playing) {
presenceData.details = artist;
presenceData.state = title;
Expand Down

0 comments on commit 0e31803

Please sign in to comment.