Implement Art(grid-stats) Endpoint from ListenBrainz #441
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.
I'm no professional, so excuse the poor-quality code(I did my best)! I've been hoping for this endpoint for quite some time, though(#387), and so I decided I'd give it a shot myself. I tried to take advantage of as many of the existing functions Maloja had available, and I examined the ListenBrainz code to ensure as much parity as possible with the official API.
There are some limitations: primarily, this implementation only supports layout 0, or the default grid! There's a lot more complexity for non-square charts, so I didn't bother, since this should cover most use-cases anyhow. I tried to be as consistent and efficient as possible, but I'm sure there's a better way to do things, so if you see any obvious fixes, let me know!
I couldn't figure out any better way to output as .svg files, at least not without adding some complexity. I didn't want to import anything too heavy for something so basic! Anyways, merge if you think it's good, or don't if you don't. I just figured I'd throw my hat into the ring!