-
-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reimplement audioscrobbler natively #4250
Conversation
bdabbd1
to
11bcf39
Compare
Very cool, @toots, thank you! It uses a source all the way now unlike (on_metadata) in the past. Is there a way to avoid scrobbling jingles? Like I did with previous version:
|
Great idea! I'm gonna add an optional metadata pre-processing callback. You should be able to bypass the process by returning an empty metadata list. |
Cool! Thanks! Could then show the usage of it when we have |
Thanks for the feedback @gAlleb. I have removed the PS: You might want to disconnect your application here: https://www.last.fm/settings/applications and get a new session key. |
Thanks, @toots. Works now and scrobbles! In order to bypass scrobbling what shall I do?
How can I disable scrobbling if m["jingle_mode"] metadata is found in a right way? (disregarding empty/not-empty artist/title) |
I added a |
Great catch on the optional arg. This is a weird historical thing that we evaluate optional argument values at script eval not at function eval. Something we could change, I'll ask David why we did that. Yes, returning empty metadata disables the process. It needs at least track title and artist to proceed. Think that this is user-friend enough? |
Well, I got an idea right away but it took me some time to get the syntax right with
It feels ok now :) |
Ok cool. We could also allow the function to return |
I think [] is fine too. |
This PR reimplements the
audioscrobbler
protocol natively.The
ocaml-lastfm
package has been unmaintained for a long and uses the old now playing protocol so it was time we switched to the new protocol.Also, since the last time we looked at it, the language is now mature enough to implement the support directly using liquidsoap script values!
The only drawback with the new protocol is that it needs both user credentials (username/password) and an API key. As much as we would love to provide a liquidsoap API key, last.fm terms of use for API keys seem to indicate that it is better to let users generate their own.
Changes
lastfm.*
andlibrefm.*
operators are removed.New
audioscrobbler
operators are added, most importantlyaudioscrobbler.api.track.updateNowPlaying
andaudioscrobbler.api.track.scrobble
The operators are combined into
audioscrobbler.submit
which takes a source and appliesupdateNowPlaying
when a track starts andscrobble
when it ends.Finally, global
settings.audioscrobbler.api_key
andsettings.audioscrobbler.api_secret
are added to make it possible to define API key and secret globally.Usage example
Fixes: #4230