From b5aaa2eaa17cb2bd86f2695e49134b0a8a2d3fa6 Mon Sep 17 00:00:00 2001 From: Wraient Date: Tue, 5 Nov 2024 01:35:36 +0530 Subject: [PATCH 1/2] Discord RPC CoverImage Fix --- internal/api/anime.go | 7 ------- internal/api/discord.go | 25 +++++++++++++------------ 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/internal/api/anime.go b/internal/api/anime.go index cb0ebdd..a9fdbbc 100644 --- a/internal/api/anime.go +++ b/internal/api/anime.go @@ -1203,13 +1203,6 @@ func FetchAnimeDetails(anime *Anime) error { return errors.New("cover image URL not found") } - anime.ImageURL = imageURL - err = downloadMedia(imageURL, "cover") - if err != nil { - return errors.Wrap(err, "failed to download cover image") - } - - log.Printf("Cover image URL set for anime: %s", anime.Name) return nil } diff --git a/internal/api/discord.go b/internal/api/discord.go index a8ec02e..0aa1395 100644 --- a/internal/api/discord.go +++ b/internal/api/discord.go @@ -120,19 +120,20 @@ func DiscordPresence(clientId string, anime Anime, isPaused bool) error { // Set up the activity for Discord Rich Presence without a LargeImage key activity := client.Activity{ - Details: anime.Name, - State: state, - Buttons: []*client.Button{ - { - Label: "View Cover Image", - Url: anime.ImageURL, // Link to the cover image + Details: anime.Name, + LargeImage: anime.ImageURL, + State: state, + Buttons: []*client.Button{ + { + Label: "View on AniList", + Url: fmt.Sprintf("https://anilist.co/anime/%d", anime.AnilistID), + }, + { + Label: "View on MAL", // Button label + Url: fmt.Sprintf("https://myanimelist.net/anime/%d", anime.MalID), // Button link + }, }, - { - Label: "View on AniList", - Url: fmt.Sprintf("https://anilist.co/anime/%d", anime.AnilistID), - }, - }, - } + } // Set the activity err = client.SetActivity(activity) From a9d20864bb80160c5be59648b16e1913f07148cb Mon Sep 17 00:00:00 2001 From: Wraient Date: Tue, 5 Nov 2024 01:41:19 +0530 Subject: [PATCH 2/2] Show anime name while hovering over the large image --- internal/api/discord.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/api/discord.go b/internal/api/discord.go index 0aa1395..8569db1 100644 --- a/internal/api/discord.go +++ b/internal/api/discord.go @@ -122,6 +122,7 @@ func DiscordPresence(clientId string, anime Anime, isPaused bool) error { activity := client.Activity{ Details: anime.Name, LargeImage: anime.ImageURL, + LargeText: anime.Name, State: state, Buttons: []*client.Button{ {