fmbot-discord/fmbot

Support for Last.fm alternatives

EmeraldSnorlax opened this issue ยท 6 comments

What command would you like to see improved or added?
A way to interact with the bot using libre.fm, instead of last.fm

What exactly should it do?
The equivalent commands run for the user, but it requests data from libre.fm instead

Additional context
(In theory), this shouldn't be too hard as libre.fm's api is compatible with last.fm's.

th0mk commented

I've looked into this before, but it seems that libre.fm is not really maintained anymore. It would be a lot of work for me simply to support a site that not a lot of people use.

I do however want to support Last.fm alternatives in the future (such as wavy.fm and maybe Spotify). The current project architecture is a bit messy and built pretty specifically for Last.fm, so before doing this I want restructure the project in a way that allows us to easily implement Last.fm alternatives without too much work.

Once that is done I might look into adding Libre.fm support as well. Just don't expect it any time soon.

If you're still looking into this, another (more active) open-source alternative is ListenBrainz, by the MetaBrainz Foundation.

libre.fm is still being maintained, but at a deathly pace. Supposedly the devs are looking to overhaul the website and database.

th0mk commented

@AesaraB I learned about the ListenBrainz project a few days ago, it's looking pretty good so far. Started working on rewriting the bot to support multiple platforms, but its a lot of work. If I have any updates I'll share them here.

th0mk commented

Looked into adding Listenbrainz support. The platform seems very promising, the API looks quite solid but unfortunately there are some limitations.

Current observed limitations:

All API calls return a max of 100 results at a time

We cache a lot of user data in our database, like users their top artists and recent plays. Most of our commands use this cache in order not to spam the API of the data source of the user. We only need to request data when a user sets their username, and after that we can update it using recent listens. We update it using recent listens whenever someone uses a command, or every 2-3 days.

100 results would require us to spam requests to their API (with paginated request, not sure if they actually support that) to even build this data, let alone update it every few days.
For Last.fm this limit is set at 1000.

When asked on IRC, the developers said they didn't plan to change this.
As a possible alternative they offer data downloads.

This would require the following steps:

  • Every 2 weeks, download all listen data for every user on Listenbrainz
  • Every day, download the incremental data dump and update the stored data
  • Insert/update our database cache with this data dump
  • Update our database cache using recent listens (which would still spam calls since the limit is 100)

Some downsides/difficulties with this method are:

  • It's too much work for me
  • Data will always be somewhat outdated, which would offer a poor experience especially compared to Last.fm. Our users expect their data to be up to date, always.
  • Incremental data dumps don't include new users, only new listens
  • With the 17k users they currently already have the data is 38gb. Might be difficult to handle, even more when they get more users.

I'll look into it more, but don't think its really possible because of the reasons listed above.

Missing data/requests from API

  • No way to get a users playcount for a specific artist/album/track (quite an important one for us)
  • No easy way to get user signup / first listen date (although /listening-activity could possible work as an alternative)
  • No desktop auth flow (see Last.fm example, basically oauth without a web server) (there's a workaround for this, letting users manually enter their user token)

FWIW, ListenBrainz lets you download a JSON export of your account's listens. Would adding importing of ListenBrainz data for supporters be feasible, similar to how it's done already with Spotify? Could be useful for those who use both last.fm and ListenBrainz.