jeffvli / sonixd

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

Supysonic support (Subsonic API v1.10.x) #170

Closed rossbates closed 2 years ago

rossbates commented 2 years ago

Describe the bug When using Sonixd with a Supysonic backend the artist page fails to load.

To Reproduce

  1. Click 'Artists' in the sidebar
  2. Select an artist from the list
  3. Progress indicator will display indefinitely preventing any additional user input

Expected behavior The artist's album list should load. A graceful fallback if supplemental artist metadata is unavailable (see notes).

Desktop (please complete the following information):

Notes Watching the supysonic log files during this you can see that the Sonixd client requests getArtists, then when an artist is clicked it's followed by getArtist and getArtistInfo2. It's the second request to getArtistInfo2 that fires 4 times getting a 404 which causes the UI to hang indefinitely.

According to the Supysonic docs getArtistInfo and getArtistInfo2 is on the roadmap

https://supysonic.readthedocs.io/en/latest/api.html#getartistinfo2

Would it be possible for Sonixd to handle this and load a fallback page for the artist album list? If not, perhaps just catch the error and warn the user so they can continue using the application. Currently the only way out of this is to kill and restart the app.

jeffvli commented 2 years ago

I think this is actually an issue with Supysonic not following the Subsonic API spec of returning a HTTP 200 status for failed requests. I spent some time trying to fix this before I realized.

I have opened up an issue to see if this can be implemented on their side since it causes inconsistencies if I were to handle it specifically on my side (https://github.com/spl0k/supysonic/issues/228).

jeffvli commented 2 years ago

Supysonic support will be dropped for the time being until either I or someone else wants to implement better error handling for some endpoints. The current API target for Supysonic is 1.10.2, while Sonixd was written while targeting v1.15.0+ (though has been tested for 1.13.0).

For reasoning, see @spl0k's post here.

As a temporary workaround, Sonixd v0.10.0 should still work (turn off auto updates). I believe versions before the API handler was rewritten (before 0.8.0) may work as expected, though there is no option to disable auto updates before 0.8.2.

rossbates commented 2 years ago

Thanks for looking into this. Totally understand that you're limited in what you can do without effectively removing functionality from the client. Sonixd is honestly such a good Subsonic client that I'll figure out a way around it. Really impressive work you've done here.

Currently I'm running a forked version of Supysonic modified to scrobble to the local database to preserve ownership and privacy. I might stub out getArtistInfo with some default data to see where I can take it. I believe the original Subsonic did this when last.fm changed their terms of service. Other clients like Play:Sub on iOS implement a similar approach.

I'll keep following this issue for updates. If on the other hand you choose to close it that's fine too. Thanks again!!

jeffvli commented 2 years ago

Decided to take a look at this again with a fresh mindset, and I believe I was able to implement a simple fix for this.

jeffvli commented 2 years ago

I pushed a dev build here http://ftp.sonixd.com/ if you would like to test it out. Download a build for Sonixd(dev)_2022-01-13....

rossbates commented 2 years ago

Nice! Works great. You can see Sonixd ask for getArtistInfo2 and getTopSongs then brush if off and keep moving along with no issues when it gets the 404s. You rock Jeff, time to buy you some coffee.

jeffvli commented 2 years ago

Appreciate the support, and glad it's working for you now!