From 01cf81e134db04f945f78295151bcc8e1ced3112 Mon Sep 17 00:00:00 2001 From: wjpattyn Date: Sun, 3 Aug 2025 12:22:18 +0200 Subject: [PATCH 1/2] feat: discord watching status + clickable links --- src/main/discord.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/discord.ts b/src/main/discord.ts index 9d071be..390f2bd 100644 --- a/src/main/discord.ts +++ b/src/main/discord.ts @@ -45,6 +45,8 @@ export default class Discord { setDiscordRPC () { if (this.discord.user) { + const mediaUrl = 'https://anilist.co/anime/' + this.mediaId + const mediaTitle = this.allowDiscordDetails ? this.session?.title ?? 'Anime' : 'Anime' const position = (this.position?.position ?? 0) * 1000 const duration = (this.position?.duration ?? 0) * 1000 const status = { @@ -53,14 +55,19 @@ export default class Discord { type: 3, name: 'Hayase', state: this.allowDiscordDetails ? this.session?.description ?? 'Streaming anime torrents! 🍿' : 'Streaming anime torrents! 🍿', - details: this.allowDiscordDetails ? this.session?.title ?? 'Looking around...' : 'Looking around...', + details: mediaTitle, + details_url: mediaUrl, timestamps: { start: this.allowDiscordDetails && this.position ? Date.now() - position : undefined, end: this.allowDiscordDetails && this.position && this.playback === 'playing' ? Date.now() + (duration - position) : undefined }, assets: { large_image: this.allowDiscordDetails && this.session?.image ? this.session.image : 'logo', - large_text: 'https://hayase.watch' + large_text: mediaTitle, + large_url: mediaUrl, + small_image: 'logo', + small_text: 'Watching on Hayase', + small_url: 'https://hayase.watch' }, buttons: [ { @@ -75,7 +82,8 @@ export default class Discord { party: { id: '1222' }, - instance: true + instance: true, + status_display_type: 2 // details } } this.discord.request('SET_ACTIVITY', status) From c68b8a44630f661075805b01a1c197e8cdb57c26 Mon Sep 17 00:00:00 2001 From: Cas_ <6506529+ThaUnknown@users.noreply.github.com> Date: Sun, 3 Aug 2025 12:53:06 +0200 Subject: [PATCH 2/2] Update src/main/discord.ts --- src/main/discord.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/discord.ts b/src/main/discord.ts index 390f2bd..fe0cc63 100644 --- a/src/main/discord.ts +++ b/src/main/discord.ts @@ -45,7 +45,7 @@ export default class Discord { setDiscordRPC () { if (this.discord.user) { - const mediaUrl = 'https://anilist.co/anime/' + this.mediaId + const mediaUrl = this.allowDiscordDetails ? 'https://anilist.co/anime/' + this.mediaId : 'https://hayase.watch' const mediaTitle = this.allowDiscordDetails ? this.session?.title ?? 'Anime' : 'Anime' const position = (this.position?.position ?? 0) * 1000 const duration = (this.position?.duration ?? 0) * 1000