jeffvli / sonixd

A full-featured Subsonic/Jellyfin compatible desktop music player
GNU General Public License v3.0
1.85k stars 74 forks source link

Load all artist images in the artists overview page #89

Open rusher97 opened 2 years ago

rusher97 commented 2 years ago

Is your feature request related to a problem? Please describe. On the artists overview page the sonixd icon is displayed for all artists. The correct artist image is only displayed after opening the artist and going back to the artists overview page. (Using sonixd 0.7.0 for windows and navidrome 0.46.0)

Describe the solution you'd like In my opinion sonixd should load all artist images in the overview page without opening the artist first. Like it does for albums.

jeffvli commented 2 years ago

I've talked with @deluan regarding this in Navidrome. It's definitely possible to handle this on the client-side via Sonixd but there was talks of handling this (fetching all the artist images) via the server itself which we both believe would be the better solution.

This is because the rest of the Subsonic-compatible servers (Airsonic, etc.) already handle this on the server-side so adding anything for this in Sonixd would only be limited to Navidrome only.

Edit: Additional clarity: artist images on Navidrome are all fetched from external sources (Spotify, last.fm etc.) as opposed to the album images (which defaults to local sources). So until the artist is specifically fetched, Navidrome doesn't return any image url for the artist.

rossbates commented 2 years ago

@jeffvli I was searching for info about artist images and stumbled upon this issue. Is the behavior mentioned above correct... when you visit an artist page the artist image will be cached and displayed on the artist list page? I'm implementing local artist images for Supysonic. They display on the artist's page, but not the artist list. Just curious if there's something else I need to do on my end.

jeffvli commented 2 years ago

@rossbates It might actually be that you need to fetch /getArtistInfo2 for that particular artist, I'm actually not 100% sure. Spotify integration enabled on Navidrome is required though.

Edit: Your artists will look like this on /getArtists after it has been fetched.

{
    "id": "ID",
    "name": "NAME",
    "albumCount": 1,
    "artistImageUrl": "https://i.scdn.co/image/IMGID"
},
rossbates commented 2 years ago

@jeffvli yes, /getArtistInfo2 is the call I implemented. When I visit the artist page in Sonixd it will display the artist image and bio. It doesn't display images for any of the artists that /getArtistInfo2 have been called when I return to the artist list though.

I was just looking at the cache settings and noticed it mentioned artist images. Will Sonixd store artist images there? I don't see any so that could be a clue.

Also, when you say /getArtists will include artistImageUrl after it has been fetched. Is that something which some certain server APIs have implemented? It's not part of the regular Subsonic spec right?

http://www.subsonic.org/pages/api.jsp#getArtists

jeffvli commented 2 years ago

artistImageUrl seems to be part of Subsonic's spec according to v6.1.4.

Sonixd does locally store artist images, but only after it has been fetched once. Did you press the Refresh button on the artist list after visiting an artist page and getting the image?? I have the artist list request permanently cached for the session since it doesn't change often.

jeffvli commented 2 years ago

@rossbates I think Navidrome is the only server I've seen that uses artistImageUrl though, since it doesn't create artist images locally. If you look at other servers, they usually only have the coverArt property that references the id of the image.

rossbates commented 2 years ago

I'm populating largeImageUrl inside of /getArtistInfo2 - I've wired that up so that the endpoint serves static images mapped to the artist folder. These are successfully being rendered in Sonixd on the artist page, but I don't see them being saved in the sonicxdCache folder on the file system.

That issue aside, now I'm wondering if I'm going about this the wrong way and should be using getCoverArt as it seems like a standard way to do this for local artist images.

jeffvli commented 2 years ago

Yeah I'd say ignore Sonixd's cache implementation for this. getCoverArt with the coverArt id property on each item is Subsonic's default way of fetching images..