-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(user): add presence * feat(Ongaku): fixed objects
- Loading branch information
Showing
2 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"$schema": "https://schemas.premid.app/metadata/1.10", | ||
"author": { | ||
"id": "709704536821858304", | ||
"name": "cyadine" | ||
}, | ||
"service": "Ongaku", | ||
"description": { | ||
"en": "Discover the best of Jpop and Kpop on Ongaku your go-to platform for streaming all your favorite Japanese and Korean pop music hits. Dive into the latest tracks, timeless classics, and carefully curated playlists that celebrate the vibrant world of Jpop and Kpop music." | ||
}, | ||
"url": "ongaku.zvbt.space", | ||
"version": "1.0.0", | ||
"logo": "https://ongaku.zvbt.space/favicon.png", | ||
"thumbnail": "https://ongaku.zvbt.space/preview.png", | ||
"color": "#cba6f7", | ||
"category": "music", | ||
"tags": [ | ||
"music", | ||
"kpop", | ||
"jpop" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
const presence = new Presence({ | ||
clientId: "1232447632765485126", | ||
}); | ||
|
||
const enum Assets { | ||
Logo = "https://ongaku.zvbt.space/favicon.png", | ||
} | ||
|
||
presence.on("UpdateData", async () => { | ||
const song: string = document.title.split(" | ")[0], | ||
artist = song.split(" - ")[0], | ||
songname = song.split(" - ").pop(); | ||
|
||
if (document.location.pathname.match("/jpop")) { | ||
const presenceDataJpop: PresenceData = { | ||
largeImageKey: Assets.Logo, | ||
details: "Listening to", | ||
state: `${artist} - ${songname}`, | ||
buttons: [ | ||
{ | ||
label: "Listen Along", | ||
url: "https://ongaku.zvbt.space/jpop", | ||
}, | ||
], | ||
}; | ||
presence.setActivity(presenceDataJpop); | ||
} | ||
|
||
if (document.location.pathname.match("/song")) { | ||
const presenceDataSong: PresenceData = { | ||
largeImageKey: Assets.Logo, | ||
details: "Browsing the songs lists", | ||
buttons: [ | ||
{ | ||
label: "View the page", | ||
url: "https://ongaku.zvbt.space/song", | ||
}, | ||
], | ||
}; | ||
presence.setActivity(presenceDataSong); | ||
} | ||
|
||
if (document.location.pathname.match("/about")) { | ||
const presenceDataAbout: PresenceData = { | ||
largeImageKey: Assets.Logo, | ||
details: "Reading the about page", | ||
buttons: [ | ||
{ | ||
label: "View the page", | ||
url: "https://ongaku.zvbt.space/about", | ||
}, | ||
], | ||
}; | ||
presence.setActivity(presenceDataAbout); | ||
} | ||
|
||
if (document.location.pathname === "/") { | ||
const presenceDataKpop: PresenceData = { | ||
largeImageKey: Assets.Logo, | ||
details: "Listening to", | ||
state: `${artist} - ${songname}`, | ||
buttons: [ | ||
{ | ||
label: "Listen Along", | ||
url: "https://ongaku.zvbt.space", | ||
}, | ||
], | ||
}; | ||
presence.setActivity(presenceDataKpop); | ||
} | ||
}); |