Conversation
|
|
||
| return ( | ||
| ConfigEntry( | ||
| key="api_key", |
There was a problem hiding this comment.
is an api key required ?
we can also check if we can get an API key for our application, maybe through sponsorship etc.
There was a problem hiding this comment.
Yes you do but they are easy to get individually
| @@ -0,0 +1,11 @@ | |||
| { | |||
| "type": "music", | |||
| "domain": "lastfm_recommendations", | |||
There was a problem hiding this comment.
I'm not sure if I like the fact that we now have 2 lastfm providers.
We could potentially make this one the main provider and have the scrobbler depend on it or simply combine the 2 functions
There was a problem hiding this comment.
I looked at that but the recommendations feature is only available for music providers whereas the scrobbler is currently a plugin. Also you need your own API key and session key to scrobble but only an API key to pull info. So it gets a bit messy?
There was a problem hiding this comment.
ah ok that is clear.
in that case I'm leaning towards making this a metadata provider and add support for recommendations from metadata modules to the core models because this is more a metadata provider than a music provider as it doesnt provide music on its own. Then suddenly also having similar tracks for filesystem items comes into reach meaning you can have radio mode for filesystem tracks
There was a problem hiding this comment.
Agree that it is unusual to call this a music providers. Let me know what direction to head in
There was a problem hiding this comment.
give me a few days so I can overthink the best approach
There was a problem hiding this comment.
I asked Claude to come up with a proposal for a local radio mode and this is the result. Seems good to me? https://github.com/music-assistant/server/blob/claude/plan-lastfm-recommendations-lZsFl/RADIO_MODE_LOCAL_PLAN.md
There was a problem hiding this comment.
Yes but with one comment is that its all contained in the provider alone and we just add the get_similar_tracks etc. to the metadata model so we can utlize this for any metadata provider - for example one day I like to add an AI one
There was a problem hiding this comment.
@marcelveldt is it confirmed to be as a metadata provider? I'm currently working on adding local file support to https://github.com/NeptuneHub/AudioMuse-AI with the plan to then use that as a radio feature for MA local files. I was looking at OzGrav's work for inspiration in how to implement it.
There was a problem hiding this comment.
Yes let's do this as metadata provider but we need a few small adjustments in core. I'll try to do so tomorrow or Tuesday but ping me if I forget
3208e61 to
39c8072
Compare
A new music provider that generates recommendation folders using the Last.fm API.
Recommendations are resolved to playable items via streaming providers (Spotify, etc).
## Recommendation Rows
The provider generates up to 9 recommendation folders, each configurable via toggle:
### Personalized (based on user's MA library play counts)
- **Discover Similar Artists**: Top 5 most-played artists → 3 similar each → dedupe → first 10
- **Discover Similar Tracks**: Top 5 most-played tracks → 3 similar each → dedupe → first 10
### Global Charts (Last.fm worldwide data)
- **Global Top Artists**: Request 15 → resolve → dedupe → first 10
- **Global Top Tracks**: Request 15 → resolve → dedupe → first 10
### Genre-based (requires Last.fm username)
- **Discover {Genre} Artists**: User's top tag → 30 artists → filter library → top 3 + random 12 → resolve → first 10
- **Discover {Genre} Albums**: User's top tag → 30 albums → filter library → top 3 + random 12 → resolve → first 10
- **Discover {Genre} Tracks**: User's top tag → 30 tracks → filter library → top 3 + random 12 → resolve → first 10
### Geographic (configurable country)
- **Top Artists in {Country}**: Request 15 → resolve → dedupe → first 10
- **Top Tracks in {Country}**: Request 15 → resolve → dedupe → first 10
## Resolution Pipeline
1. Last.fm API returns artist/track/album names with optional MusicBrainz IDs (MBIDs)
2. For tracks: MBID → MusicBrainz API → ISRC lookup
3. Search streaming providers by ISRC (preferred) or name+artist fallback
4. Results cached at two levels: in-memory (session) and persistent (90 days)
## Key Features
- All recommendation rows are disabled by default (user enables what they want)
- Configurable refresh interval (default 6 hours)
- 15-second startup delay to allow streaming providers to load first
- Genre rows use "top 3 + random sample" strategy with daily seed for variety
- Library items filtered from genre recommendations to surface new music
- Clear cache button in settings for manual refresh
- Config changes take effect immediately on provider reload
39c8072 to
301d2fa
Compare
A new music provider that generates recommendation folders using the Last.fm API. Recommendations are resolved to playable items via streaming providers (Spotify, etc).
Recommendation Rows
The provider generates up to 9 recommendation folders, each configurable via toggle:
Personalized (based on user's MA library play counts)
Global Charts (Last.fm worldwide data)
Genre-based (requires Last.fm username)
Geographic (configurable country)
Resolution Pipeline
Key Features