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

feat: Support scrobbling played songs to ListenBrainz #1843

Merged
merged 2 commits into from
Feb 2, 2025

Conversation

chme
Copy link
Collaborator

@chme chme commented Jan 26, 2025

This PR adds support for submitting "listens" (played songs) to ListenBrainz (https://listenbrainz.org).

ListenBrainz offers similar functionality as Last.fm, but the data is open (see their About page for their stated goals).

Integration of ListenBrainz in OwnTone would allow users to use ListenBrainz to keep a (public) listening history instead of using the proprietary Last.fm service.

This PR implements:

  • Support submitting listens (scrobble) to ListenBrainz.
  • Add JSON API endpoints to manage ListenBrainz auth token.

Note, that a minor refactoring was done in cc0d2ff.

I am opening this as draft, to see if there is interest in adding this functionality to OwnTone. And if yes, if the approach is OK.

Open topics to finalize the integration are:

  • Document new JSON API endpoints
  • Add ListenBrainz settings page in web interface

Copy link
Member

@ejurgensen ejurgensen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never heard about listenbrainz, but I think it we be fine to include. I added a few minor comments, but you are welcome to merge it when you think it's ready.

src/listenbrainz.c Outdated Show resolved Hide resolved
src/listenbrainz.c Outdated Show resolved Hide resolved
src/logger.c Outdated Show resolved Hide resolved
@ejurgensen
Copy link
Member

Looks good. Small note: The if(x) for keyval_clear(x) is redundant, keyval_clear is no-op if the pointer is null.

chme added 2 commits February 1, 2025 14:25
- Support submitting listens (scrobble) to ListenBrainz.
- Add JSON API endpoints to manage ListenBrainz auth token.
@chme chme force-pushed the feat/listenbrainz branch from 4680d3d to 7760554 Compare February 1, 2025 13:36
@chme chme marked this pull request as ready for review February 1, 2025 13:37
@chme
Copy link
Collaborator Author

chme commented Feb 1, 2025

Thanks for taking the time to look into this!
I did the last change you recommended (makes the code a bit more readable) and rebased on master. I will test it over the weekend and if I find no issues, will merge it.

@chme chme merged commit 991ed0e into owntone:master Feb 2, 2025
5 checks passed
@chme chme deleted the feat/listenbrainz branch February 2, 2025 13:59
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.

2 participants