fmbot-discord / fmbot

.fmbot is a social Discord bot that provides music statistics for you and your friends.
https://fmbot.xyz/
Other
301 stars 44 forks source link

Support for Last.fm alternatives #122

Open EmeraldSnorlax opened 3 years ago

EmeraldSnorlax commented 3 years ago

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 3 years ago

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.

AesaraB commented 3 years ago

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 3 years ago

@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 2 years ago

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:

Some downsides/difficulties with this method are:

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

Missing data/requests from API

Viktini commented 1 year ago

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.

felipemarins commented 1 month ago

A year ago, the limit for max items per request was increased to 1000 (which is the same as Last.fm, according to what th0mk said). Does this change anything in relation to a possible implementation of this feature request?

Reference: https://github.com/metabrainz/listenbrainz-server/pull/2572