Album art browser in web plugin UI #5568
Draft
+3,973
−1,712
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a "browse albums" page to the web plugin's UI, with a couple tweaks (via query params, to preserve backwards compatibility) to the API in order to enable it. This is a feature that's been requested and kind of hacked together in the past. This implementation has the following characteristics:
It includes assorted other improvements to the web plugin as well. A list summarizing the changes:
album_art
route includes theb64
query string (regardless of its value), the art data will be returned as base64 data rather than binary. This was mainly because this conversion was easier (for me) to do in Python than in JavaScript.all_albums
route includes therandom
query string (regardless of value), the albums will be returned in random order.Here is what the browser looks like. I figured others will likely have libraries like mine where the album art situation is patchy so I tried to make the alt text look nice:
To Do
I haven't done any of these yet because I'm not sure this will even get merged, much less what from its current state will end up making it in. It doesn't really change any of the documented functionality of the web plugin. And there are no tests as the JS is completely untested and the API changes are not straightforward or particularly interesting to test (randomness? base-64 encoding?)
That said, I'm happy to do any of these that reviewers would like me to and I'll certainly add a changelog entry if this gets to a mergeable state.