Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discord Rich Presence : Display album cover #341

Closed
Kayn017 opened this issue Oct 31, 2023 · 12 comments · Fixed by #817
Closed

Discord Rich Presence : Display album cover #341

Kayn017 opened this issue Oct 31, 2023 · 12 comments · Fixed by #817
Assignees
Labels
enhancement New feature or request

Comments

@Kayn017
Copy link

Kayn017 commented Oct 31, 2023

Hello !

Is it possible to display album cover in the Discord Rich Presence ? I remember it worked with Jellyfin on Sonixd 😄

@Kayn017 Kayn017 added the enhancement New feature or request label Oct 31, 2023
@jeffvli jeffvli self-assigned this Oct 31, 2023
@jeffvli
Copy link
Owner

jeffvli commented Nov 1, 2023

The problem with the existing implementation (that Sonixd used) is that this would only work only Jellyfin and if it is publicly accessible via reverse proxy. I'm thinking of adding an integration with lastfm to fetch and display the image from them rather than use the server itself.

@iiPythonx
Copy link
Contributor

In addition to Last.FM, if you have MusicBrainz information embedded in the file (and you're able to read it), then you could use the Cover Art Archive as a possible fallback.

@JortRoelofs
Copy link

Both retrieving album covers from LastFM or MusicBrainz are good ideas I think. I'd like to suggest another idea on how to achieve this. Before switching to Navidrome and Feishin I used MusicBee and the Discord Rich Presence plugin achieved showing album covers by uploading them to Imgur. The source can be found here.

@informaticker
Copy link
Contributor

LastFM is probably the best way, as it's in my experience pretty fast (made an RPC client for LastFM).
Uploading to Imgur is pretty inefficient as the image already exists in the web. We don't have to clutter some services storage with our cover images.

@EvilSquirrelGuy
Copy link

EvilSquirrelGuy commented Jun 20, 2024

Since it's been a couple months since this issue was active, I'll just put this here in case anyone's wondering how to re-enable this feature.

As a temporary (and very hacky) solution, I've found a hidden option in settings that re-enables the behaviour from sonixd where the discord rpc is updated with the track's cover image (only on jellyfin servers accessible via reverse proxy). Currently working on 0.7.1.

To enable this option paste the following into the console in developer tools (Ctrl+Shift+I):

let modifiableSettings = JSON.parse(localStorage.store_settings);
modifiableSettings.state.discord.showServerImage = true; // replace with false to disable option
localStorage.store_settings = JSON.stringify(modifiableSettings);

This directly modifies the settings state in local storage, so far I haven't had any issues with it, but idk what I'm doing so run it at your own risk lol.

@iiPythonx iiPythonx mentioned this issue Sep 2, 2024
Closed
@mihawk90
Copy link
Contributor

mihawk90 commented Sep 23, 2024

We don't have to clutter some services storage with our cover images.

While that's true, I'd assume that imgur has an API endpoint to delete an image (similar to how they allow it on the web frontend), so that could be called when the track/album playback has ended.

However, I do agree that this is probably not an ideal solution.
CoverArtArchive/MusicBrainz and last.fm would be the way to go as mentioned before. Fanart.tv would be another option, although I haven't checked their policy on embedding/hotlinking these images. Also their website displays 400x400 images (which would be enough for RPC to reduce load on their servers), but I don't know if those smaller preview images are returned via the API. edit: API docs say "If you want to get a smaller preview of an image simply replace fanart with preview in the assets link", so yes it's possible. Still don't know about using it as an embed though.
Imgur could be a last-ditch effort if all else fails, but at that point it's also questionable whether it's worth the effort.

@jackmerrill
Copy link
Contributor

I've created a PR with basic functionality: #817

Works perfectly, just requires a Last.fm API key.

jeffvli pushed a commit that referenced this issue Oct 31, 2024
* feat: Discord Rich Presence album art via Last.fm

* fix: securely fetch album art
@Infinidoge
Copy link

For people who do have Jellyfin behind a reverse proxy, is it still possible to show art through that? I have some albums with tracks that have individual song covers that are different from each other, which last.fm doesn't support to my knowledge.

@EvilSquirrelGuy
Copy link

Yeah, works fine for me (nginx with SSL using Cloudflare, jellyfin 10.9.11). I think as long as discord can resolve the image URL it'll be fine.

@Infinidoge
Copy link

Infinidoge commented Nov 6, 2024

Jellyfin 10.9.11, SSL using Let's Encrypt, image URL copied from the web UI embeds in Discord just fine. However, enabling showServerImage by editing local storage doesn't seem to work. My guess is it's just not saving the setting, so I can't get it to actually start including it.

@UlyssesZh
Copy link

@Infinidoge I have the same demand as yours. What is this showServerImage setting? I want to try that.

@iiPythonx
Copy link
Contributor

@UlyssesZh See #341 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants