diff --git a/websites/O/Ongaku/metadata.json b/websites/O/Ongaku/metadata.json new file mode 100644 index 000000000000..5510c71b9935 --- /dev/null +++ b/websites/O/Ongaku/metadata.json @@ -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" + ] +} \ No newline at end of file diff --git a/websites/O/Ongaku/presence.ts b/websites/O/Ongaku/presence.ts new file mode 100644 index 000000000000..c0e451425397 --- /dev/null +++ b/websites/O/Ongaku/presence.ts @@ -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); + } +});