add optional base64 image parameter to newscrobble
#324
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.
What?
I would like to add a new optional parameter to the scrobble API function
newscrobblethat allows (but does not require) a scrobble client to include a base64 encoded album/track art image alongside a scrobble.Why?
For example, many songs and albums on Bandcamp do not have their art stored on the usual sources like Deezer or Spotify. Scrobble clients that include album art alongside their scrobble requests can remove an extra manual step of having to download the album art and reupload it to maloja. I've had to do this many times and I've come up with this idea to automate the process.
I've already added support for this feature to Web Scrobbler: duckfromdiscord/web-scrobbler@2dd8790. I've tested it and it works, and I will open a PR there if this one is merged.
How?
To use this, all a scrobble client has to do is encode an image in base64 and include it in the
imageparameter tonewscrobble.Additional context
Let me know if there's anything I have to change to get this PR merged. I'm not 100% sure if all edge cases work, but I've tested a couple albums on Bandcamp that work. The edge cases I've tested are where album artists are not the same as track artists, and also tracks that have multiple artists. The way I've mitigated these issues is by using the parsed scrobble for info instead of the info provided directly to
newscrobble.Another way of doing this could be sending a URL from a scrobbler to maloja, but I chose not to do this because of possible malicious URLS (i.e. IP grabbers) and also because
images.set_imagealready accepts base64.