suaviloquence / mopidy-listenbrainz

Mopidy extension for recording played tracks and getting recommendations to Listenbrainz, a libre alternative to Last.fm
https://mopidy.com/ext/listenbrainz/
Apache License 2.0
3 stars 1 forks source link

Support import of ListenBrainz recommendations playlists #1

Closed orontee closed 6 months ago

orontee commented 8 months ago

Proposal

The proposed branch adds support for playlists returned by the playlists created for endpoint (recommendations playlists) from ListenBrainz API.

AFAICT the returned playlists are made of suggestions taken from previously listened tracks.

Implementation

The playlist descriptions are fetched by the existing Mopidy frontend during setup. Mopidy-Local database is then searched for matching tracks and Mopidy playlists are created using a trivial Mopidy backend dedicated to those playlists management.

The playlist import must be enabled using a new configuration key import_playlists (default to false).

Playlists are periodically updated (each week, on monday).

Possible improvements

Test

python -m pip install --upgrade --break-system-packages git+https://github.com/orontee/mopidy-listenbrainz.git@feature/playlists

Tried with both Argos and Iris.

image

image

orontee commented 8 months ago

Something is wrong with current implementation because .m3u8 files are created; It looks like the created playlists are handled by Mopidy-M3U and not the introduced backend...

UPDATE: Fixed an import exception with Mopidy 3.4.2, also missing name while creating playlists, and finally missing tracks.

suaviloquence commented 6 months ago

Thanks for the PR! Sorry for being so late, for some reason github did not notify me about it.

orontee commented 6 months ago

FYI, there's a regression in Iris, https://github.com/jaedb/Iris/issues/953

orontee commented 6 months ago

It looks good but I can't test it super well because I don't have the songs in my local backend. If you wanted to add configuration (here, in another PR) for that it would be awesome but I can still merge this one without it.

Good point. I'll do it here, next week seems reasonable.

suaviloquence commented 6 months ago

Also feel free to take credit and link yourself in the credits section of README.rst for your awesome work!

suaviloquence commented 6 months ago

🎉