Git Product home page Git Product logo

foo_listenbrainz2's Introduction

ListenBrainz 2

A foobar2000 component to submit the music you listened to to ListenBrainz or another ListenBrainz compatible scrobble server (for example Maloja).

This component was originally written by marc2k3. This repository is an attempt to preserve the source code of this excellent component and hopefully to revive the development.

Minimum requirements

Windows 7 and foobar2000 v1.5 or later. This component is compatible with foobar2000 v2.0, both 32 and 64 bit.

Download & Installation

Download the component archive (.fb2k-component) from the release page. Follow the instructions How to install a component in the Foobar2000 Wiki.

What is ListenBrainz?

ListenBrainz keeps track of music you listen to and provides you with insights into your listening habits. For details see:

https://listenbrainz.org

Why foo_listenbrainz2?

There is already a component with the original name here: foo_listenbrainz

In contrast to the above version foo_listenbrainz2 does not block the main thread and does not freeze the UI when submitting. Also, this version submits artist/recording MBIDs if present in your files. This makes artist/title links on your recent listens page clickable and will lead you to the respective pages on musicbrainz.org

Preferences

Enter your ListenBrainz token and check the other options under File > Preferences > Tools > ListenBrainz 2.

Preferences

By default the component submits to the ListenBrainz server using the endpoint https://api.listenbrainz.org/1/submit-listens.

If you use another ListenBrainz compatible server, also adjust the URL and use a token provided by your server. Make sure to append /submit-listens to the standard API URL of your server. Otherwise you will get 500 response errors. For Maloja servers the API URL is in the form of https://{hostname}/apis/listenbrainz/1/submit-listens.

Now just listen to your music and watch the Console for server responses and/or check your recent listens page.

For convenience, submissions can be enabled/disabled via the main Playback menu. This option is only available after your token has been set. You can also configure a filter for tracks to never be submitted.

Submissions

The following conditions must be met for a track to be submitted:

  • The track must be at least 5 seconds long. Anything shorter or unknown will be ignored.
  • Like Last.fm, you must listen to at least half the track or 4 minutes - whichever comes first.
  • The submission must be enabled when the track begins AND at the time of submission during playback.
  • The track must contain ARTIST and TITLE tags as a bare minimum. Any tracks without them are silently ignored.

These additional tags are sent if present:

  • ALBUM ARTIST
  • ALBUM
  • DATE
  • TRACKNUMBER
  • TOTALTRACKS
  • DISCNUMBER
  • TOTALDISCS
  • ISRC
  • MUSICBRAINZ_ARTISTID / MUSICBRAINZ ARTIST ID
  • MUSICBRAINZ_TRACKID / MUSICBRAINZ TRACK ID
  • MUSICBRAINZ_ALBUMID / MUSICBRAINZ ALBUM ID
  • MUSICBRAINZ_RELEASEGROUPID / MUSICBRAINZ RELEASE GROUP ID
  • MUSICBRAINZ_RELEASETRACKID / MUSICBRAINZ RELEASE TRACK ID
  • MUSICBRAINZ_WORKID / MUSICBRAINZ WORK ID
  • The track's duration in milliseconds

Note that foobar2000 does not support reading track id (recording) tags that are written to MP3s as UFID by MusicBrainz Picard.

By default details about the media player ("foobar2000" and version) and the submission client ("foo_listenbrainz2" and component version) will be submitted as well. If you dislike this behavior you can disable it in the preferences.

Multi-value tag handling

  • For artist/work MBIDs, all values are sent.
  • By default, only the first value of any multi-value ARTIST tag is sent. This can be changed in the preferences so all values are sent as a comma separated string. Before this option was added in v1.1.3, only the first value was sent.
  • For all other tags, only the first value is sent.

Caching of failed submissions

This happens automatically so you don't need to do anything to trigger it. If you're offline or ListenBrainz is down, the Console will report each time a listen is cached and the next time you submit a successful listen, an attempt will be made to submit all cached entries.

Limitations

  • Currently there is no support for streams or tracks of an unknown length.
  • foobar2000 does not support reading track id (recording) tags that are written to MP3s as UFID by MusicBrainz Picard.

License

foo_listenbrainz2 is published under the MIT license. See LICENSE.txt for details.

foo_listenbrainz2's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

foo_listenbrainz2's Issues

FR: Submit tracks (add listens) without requiring to play to them

Sometimes I notice wrongly tagged listen submissions on my ListenBrainz history feed and decide to delete them. Instead of having to re-listen to all the fixed tracks (typically a release), it would be useful to be able to select the tracks I want to resubmit and have them submitted with custom inserted_at and listened_at values.

Resubmit 4 tracks now (a mix of over and under 4 minute track lengths):

track#4 (10:00): Both *_ats = now - (-4:00 + 100% of track#4)
track#3 (2:00): Both *_ats = track#4's listened_at - 4:00 - 50% of track#3
track#2 (5:00): Both *_ats = track#3's listened_at - 50% of track#3 - 50% of track#2
track#1 (9:00): Both *_ats = track#2's listened_at - 50% of track#2 - (-4:00 + 100% of track#1)

(example calculation may change depending on #17)

To customise the submission times, allow choosing between "now" or some past time (in milliseconds would be easiest to implement but not so human-friendly, but also not impossible to work with). See ListenBrainz' Add listens button (the reason why this isn't sufficient for manual resubmissions is that what is added won't reflect the metadata of local files, or include media_player etc).

If this feature could be abused, a limit could be put on how often these manual submissions can be made: Total time of previously manually submitted tracks must have passed since the last manual submission before making another (i.e. 26 minutes based on the example above). But, I don't see why a limit should be introduced since I don't think ListenBrainz' own Add listens feature has one either.

Thanks.

Submit tracks only if in whitelisted playlists

I have a playlist called Listen which I always enable "Submit to ListenBrainz" before I start listening to it. I also disable it after I'm done so that other playlists don't submit anything. It would be cool if I could whitelist my Listen playlist.

How I see this working is: If "Submit to ListenBrainz" is enabled, submit any given track (assuming it's not skipped by the skip query or "media library track only" enabled). If submitting is disabled, don't submit anything. So far, this is as normal. If a playlist is whitelisted, only submit tracks from that playlist when "Submit to ListenBrainz" is enabled (taking into account the the skip logic). The hypothetical "whitelisted playlists only" option should be able to be toggled off via the settings without needing to remove all its listed playlists.

Thanks.

Import listens from file / Export listens to file

The current API allows to export/import listens from/to the server, using JSON. Also the web.

BUT the current web doesn't allow to import listens/feedback from a given JSON file.

  • Exporting directly from foobar2000 would be great for backup purposes.
  • Importing the JSON files should take into consideration duplication (essentially all but 'inserted_at' and 'listening_from' which may differ) . i.e. importing should first retrieve all user's listens, then compare both JSON's and finally send to the server only the ones not found.

Although I'm in the process of creating SMP scripts to integrate LB features within foobar (right now the playlist management is done), thought this one would be a natural addition to the plugin.

add: a test connection

feat request: add a test connection button or a return state label when you are fully connected to listenbrainz

Import listens from Foobar2000 playback statistics

This one is a bit more tricky. Currently foobar2000 stores play-count statistics for tracks, although no timestamps.
Timestamps are available with foo_enhanced_playcount though.

Following the same rationale than my other enhancement proposal, it would be great to be able to export/sync Foobar2000 listens to ListenBrainz. i.e. those not already sent. In some cases users may have installed foo_listenbrainz2 at a later point, so many listens would be lost. This could fill the hole retroactively.

  • Deduplication is required. Comparing the current listens JSON by the user against the local stamps. Since half the track must be listened to, it's more or less trivial to compute a match with JSON timestamp = local timestamp +/- half length (and the tags).
  • Some tricks could be added here (like checking the plugin installation time, and only comparing listens before it). But I think it would be best to compare all values to ensure all values are synced on any use-case.
  • This is thought as a sync option. i.e. will only add new values, and only if they are not already on the server. A one time action for most users.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.