Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial version of the Listenbrainz plugin #5058

Merged
merged 73 commits into from
Mar 1, 2024
Merged

Conversation

arsaboo
Copy link
Contributor

@arsaboo arsaboo commented Dec 20, 2023

Description

Fixes #1719

I added a basic version of the LB plugin that imports the play history. It uses the same process used in the Lastimport plugin to update playcounts.

There are few additional functions that I added here to import playlists created by Listenbrainz. These playlists can then be imported in other programs such as Plex.

To Do

  • Documentation. (If you've added a new command-line flag, for example, find the appropriate page under docs/ to describe it.)
  • Changelog. (Add an entry to docs/changelog.rst to the bottom of one of the lists near the top of the document.)

@arsaboo arsaboo closed this Dec 21, 2023
@arsaboo arsaboo reopened this Dec 21, 2023
@sampsyo
Copy link
Member

sampsyo commented Dec 22, 2023

Awesome! This already looks fantastic! No objection to merging right away if you think this is at a usable initial state.

I also noticed this contains a few changes to the last.fm plugin. Was that intentional? I didn't review them carefully, although they seem credible. If they fix bugs in the plugin, maybe that deserves a changelog entry of its own.

@arsaboo
Copy link
Contributor Author

arsaboo commented Dec 22, 2023

@sampsyo Yes, I have tested it, and it is ready to be merged.

I made minor changes to the process_tracks function in lastimport to improve error handling and reuse the same function. I am not entirely happy with the process_tracks function as it does a poor job of matching (e.g., right now, it only matches 3 of the 25 tracks even though they are all in my library). It may be due to the fact that I am using Spotify as the tag source. I do want to create a better matching function, but that can be done in a separate PR.

Sometimes, there are other playlists that are created (e.g., Top Missed Recordings of 2023, Top Discoveries of 2023). Right now, I am excluding these. We may want to address them separately.
@sampsyo
Copy link
Member

sampsyo commented Dec 23, 2023

Sounds good! Would you mind summarizing the changes to lastimport in their own changelog entry? Then this is clearly good to go!

@Kernald
Copy link
Contributor

Kernald commented Jan 8, 2024

Correct me if I'm wrong, but this seems to be fetching the whole ListenBrainz history on each run - could we leverage min_ts somehow to avoid that maybe?

@arsaboo
Copy link
Contributor Author

arsaboo commented Jan 8, 2024

Yes, all the elements could (and should) be configured. We still need to carefully think about how to use them (which is why I called this PR initial version 😉). I honestly don't use the play_count information, but I am sure someone will find it useful and update the code to use those variables (heck, even I may do it at some point if no one gets to it).

The current code has been reviewed and approved by @sampsyo, so I would not change it. Once this PR is merged, we can create a feature request for additional configurations and discuss the best approach to implement the same.

@Serene-Arc
Copy link
Contributor

I'll merge this then, since it's been approved. I should note that I have attempted my own tool for listenbrainz here, though it is implemented in Rust instead of Python. I still have to reach out to the listenbrainz team to try and get the song matching working as well as it can. Right now I can get it to about 90%+ but still not 100%.

@Serene-Arc Serene-Arc merged commit 35e8eb9 into beetbox:master Mar 1, 2024
13 checks passed
@arsaboo
Copy link
Contributor Author

arsaboo commented Apr 13, 2024

@Serene-Arc I will try to extend this plugin to include playlist uploads. The song-matching issue could be on LB's end...see a related issue.

@arsaboo arsaboo deleted the lb branch April 13, 2024 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ListenBrainz plugin
5 participants