nrubin29 / finale

A fully-featured Last.fm client and scrobbler with Shazam-like scrobbling, a collage generator, home screen widgets, and more!
https://finale.app
BSD 3-Clause "New" or "Revised" License
114 stars 4 forks source link

Add libre.fm/listenbrainz support #4

Closed jbwharris closed 2 years ago

jbwharris commented 3 years ago

Is it possible to add the ability to scrobble to multiple services? I use both last.fm and libre.fm and can do this with Web Scrobbler and I'd love to be able to do it on iOS/iPadOS as well. From what I can tell there isn't an actual scrobbler client for libre.fm/ListenBrainz, so this would fill a bit of a gap on the platform. Simple last.fm scrobbler and Pano Scrobbler does this on Android, so the functionality does exist on other platforms with some precedent.

Seeing how DeaDBeeF handles libre.fm integration, it's really just seems like submitting to another API url, just like how it's done with last.fm.

Screen Shot 2021-06-14 at 1 07 06 PM

nrubin29 commented 2 years ago

I took a quick look at this and it seems like libre.fm's API doesn't support scrobbling. If I'm mistaken, could you point me to some documentation?

Edit: Looks like this page was last updated 5 years ago, but it also seems like libre.fm hasn't been updated in awhile. I could try and look into adding scrobbling support if you're still interested.

jbwharris commented 2 years ago

There's 2 apps that I know that scrobble to libre.fm

DeaDBeeF scrobbler plugin

Web Scrobbler libre.fm scrobbler

In both cases I believe all they're really doing is changing the API call URL they're sending the scrobbles to, from last.fm to https://libre.fm/2.0/ or http://turtle.libre.fm, otherwise the data it's passing via that URL seems to mirror how last.fm handles it.

nrubin29 commented 2 years ago

I cannot for the life of me figure out how to get an API key for Libre.fm. There's nothing in the docs or on the website, and I even tried joining their IRC channel but it's empty (unless I joined it wrong).

Would connecting your Last.fm account to Libre.fm be sufficient? See here.

jbwharris commented 2 years ago

I have posed this question to the Git for Web Scrobbler and I'll see what I hear back. I figure since they've done it, they might have some additional insight on the process.

As for connecting last.fm to libre.fm, that's kind of the root need I have. It can't sync last.fm to libre.fm, but it can scrobble from libre.fm to the connected last.fm account. So how I'm using that is to scrobble to a second last.fm account. The purpose of that is to allow me to separate the things I listen to on web radio from what I listen to overall. By doing this, I can then import the things I listen to in Web Scrobbler to my Apple Music account(or Spotify or whatever else) using SongShift. I outlined the process in detail awhile back on reddit.

Why I care about this is it's truly amazing in execution once you get this flow working. By being able to import the music I'm truly listening to outside the scope of Apple Music, I can begin to inform the algorithms of what I actually like and am listening to, so then my playlists tend to get better. With how much I use the continuous listen mode in Finale, I'd love to add this stream of scrobbles into that second stream that imports into Apple Music.

nrubin29 commented 2 years ago

Thanks for the additional information and for looking into this. If I'm able to get an API key, I'd be happy to add support for Libre.fm. Just to be sure, you would want every scrobble that the app sends to Last.fm to also go to Libre.fm, correct?

nrubin29 commented 2 years ago

It actually looks like you don't even need a Libre.fm API key to use their API (yikes!). I implemented Libre.fm scrobbling in commit https://github.com/nrubin29/finale/commit/2011e1b08e4ce631fe9487380deec3e501612398 and it seems to work, but the site is pretty slow to load and sometimes requires multiple reloads to get a response. Are you able to build the app for yourself and test it? If not, I can just release the update and fix any issues that we find. I'd prefer to have a Libre.fm API key before releasing the update since Libre.fm says "Unknown client...wants your permission to talk with this service", but it isn't a big deal.

jbwharris commented 2 years ago

Thanks for the additional information and for looking into this. If I'm able to get an API key, I'd be happy to add support for Libre.fm. Just to be sure, you would want every scrobble that the app sends to Last.fm to also go to Libre.fm, correct?

Yes, it would be submitting the same scrobbles to both services.

jbwharris commented 2 years ago

I gave it go trying to setup Flutter, but I'm running into some errors that are over my head to figure out.

jbwharris commented 2 years ago

@nrubin29 I finally got a response about the Libre.fm API key. I was pointed to this thread about it.

https://github.com/web-scrobbler/web-scrobbler/issues/1421#issuecomment-334502398

nrubin29 commented 2 years ago

@jbwharris thanks for following up. Really weird that that's how the API works but 🤷‍♂️. I just released v1.5.1 which adds support for scrobbling to Libre.fm. It's available now on the web and it'll be available on iOS and Android once the update is approved. Check it out and let me know if it works, then feel free to close the issue.

jbwharris commented 2 years ago

@nrubin29 I was able to get it logging properly. It was my stupid. Can't wait to give it a try on iOS.

nrubin29 commented 2 years ago

@jbwharris Glad to hear it's working for you. I just released the update on iOS and Android. It should show up soon.

nrubin29 commented 2 years ago

I'll go ahead and close this issue since the feature has been implemented and launched. Feel free to reopen if needed.

icyphox commented 2 years ago

Hey, any chance you could add in support for Listenbrainz?

jbwharris commented 2 years ago

I know Web Scrobbler has support for ListenBrainz as well. So I'd figure the same code setup for submitting there would be in place, as it was with Libre.fm