jeffvli / feishin

A modern self-hosted music player.
https://feishin.vercel.app
GNU General Public License v3.0
2.35k stars 96 forks source link

Discord Rich Presence : Display album cover #341

Open Kayn017 opened 10 months ago

Kayn017 commented 10 months ago

Hello !

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

jeffvli commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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 commented 2 months ago

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.