Skip to content

Commit

Permalink
feat(Dash Radio): change dash radio to litt live (#8118)
Browse files Browse the repository at this point in the history
* feat(Dash Radio): change dash radio to litt live

* feat(Dash Radio): change dash radio to litt live

* chore: update metadata to support matches

* chore: update metadata to support matches

* style: unnecessary { after 'if' condition

* style: unnecessary { after 'if' condition

* chore: bump schema versions

* chore: prefer using a logical operator over a ternary

* chore: prefer using a logical operator over a ternary

* Update websites/L/LITT Live/metadata.json

Co-authored-by: Daniel Lau <[email protected]>
Signed-off-by: bakzkndd <[email protected]>

* Update websites/L/LITT Live/metadata.json

Co-authored-by: Daniel Lau <[email protected]>
Signed-off-by: bakzkndd <[email protected]>

* Update websites/L/LITT Live/presence.ts

Co-authored-by: Daniel Lau <[email protected]>
Signed-off-by: bakzkndd <[email protected]>

* Update websites/L/LITT Live/presence.ts

Co-authored-by: Daniel Lau <[email protected]>
Signed-off-by: bakzkndd <[email protected]>

* chore: requested edits

* chore: requested edits

* chore: undo changes to unrelated metadata

* chore: undo changes to unrelated metadata

* chore: requested changes

* chore: requested changes

* refactor: use imgur link

- since the proposed fix doens't fit schema

* chore: revert changes to other presences

* style: format code

* refactor: simplify other songArtist setter

* chore: linting errors

* style: yarn format

---------

Signed-off-by: bakzkndd <[email protected]>
Co-authored-by: Daniel Lau <[email protected]>
Co-authored-by: theusaf <[email protected]>
  • Loading branch information
3 people authored Mar 2, 2024
1 parent 4235a9a commit 55ce07e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@
"name": "apprehends",
"id": "202236922217758721"
},
"service": "Dash Radio",
"service": "LITT Live",
"description": {
"en": "100% Free Music. More Variety. Zero Commercials. The Best DJ's & Stations. No BS",
"nl": "100% gratis muziek. Meer afwisseling. Geen reclames. De beste dj's en stations. Geen BS"
},
"url": "dashradio.com",
"version": "1.0.18",
"logo": "https://cdn.rcd.gg/PreMiD/websites/D/Dash%20Radio/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/D/Dash%20Radio/assets/thumbnail.png",
"url": "littlive.com",
"matches": [
"*://littlive.com/*",
"*://www.littlive.com/*"
],
"version": "1.0.0",
"logo": "https://i.imgur.com/bs7XU8u.png",
"thumbnail": "https://i.imgur.com/lClvjkY.png",
"color": "#55effa",
"category": "music",
"tags": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const presence = new Presence({
clientId: "761889098490183691",
clientId: "575756169986048004",
}),
strings = presence.getStrings({
play: "general.playing",
Expand All @@ -9,37 +9,43 @@ const presence = new Presence({
let songName: HTMLElement,
songArtist: HTMLElement,
songNameS: string,
songArtistS: string;
songArtistS: string,
thumbnail: HTMLImageElement;

presence.on("UpdateData", async () => {
const sidePanel = document.querySelector(".MuiPaper-elevation");
if (sidePanel && sidePanel.childNodes[1]) {
thumbnail = sidePanel.childNodes[1].childNodes[0].childNodes[0]
.childNodes[0] as HTMLImageElement;
}

const presenceData: PresenceData = {
largeImageKey:
"https://cdn.rcd.gg/PreMiD/websites/D/Dash%20Radio/assets/logo.png",
largeImageKey: thumbnail ?? "https://i.imgur.com/bs7XU8u.png",
};

songName = document.querySelector(
"header.MuiAppBar-root > div.music-dataview-container > span.App-Player-Song-Title-Text"
);
if (!songName) {
(songNameS = document.querySelector("#marquee1").textContent),
(songNameS = songNameS.replace("<span>", "")),
(songNameS = songNameS.replace("</span>", ""));
songNameS = document
.querySelector("#marquee1")
.textContent.replace("<span>", "")
.replace("</span>", "");
if (songNameS === "") songNameS = "None";
} else if (songName) songNameS = songName.textContent;

songArtist = document.querySelector(
"header.MuiAppBar-root > div.music-dataview-container > span.App-Player-Song-Artist-Text"
);
if (!songArtist) {
(songArtistS = document.querySelector("#marquee2").textContent),
(songArtistS = songArtistS.replaceAll("&amp;", "&")),
(songArtistS = songArtistS.replace('<span class="artist">', "")),
(songArtistS = songArtistS.replace("</span>", ""));
songArtistS = document
.querySelector("#marquee2")
.textContent.replaceAll("&amp;", "&")
.replace('<span class="artist">', "")
.replace("</span>", "");
if (songNameS === "") songArtistS = "None";
} else if (songArtist) {
(songArtistS = songArtist.textContent),
(songArtistS = songArtistS.replace("&amp;", "&"));
}
} else if (songArtist)
songArtistS = songArtist.textContent.replace("&amp;", "&");

if ((songNameS === "None" && songArtistS === "None") || songArtistS === "") {
presenceData.smallImageKey = Assets.Pause;
Expand Down

0 comments on commit 55ce07e

Please sign in to comment.