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

Allow the user to control how chroma does the fingerprinting #5172

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions beetsplug/chroma.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def acoustid_match(log, path):
_matches, _fingerprints, and _acoustids dictionaries accordingly.
"""
try:
duration, fp = acoustid.fingerprint_file(util.syspath(path))
duration, fp = acoustid.fingerprint_file(util.syspath(path), force_fpcalc=self.config["forceFpcalc"])
except acoustid.FingerprintGenerationError as exc:
log.error(
"fingerprinting of {0} failed: {1}",
Expand Down Expand Up @@ -174,6 +174,7 @@ def __init__(self):
self.config.add(
{
"auto": True,
"forceFpcalc": False,
}
)
config["acoustid"]["apikey"].redact = True
Expand Down Expand Up @@ -342,7 +343,7 @@ def fingerprint_item(log, item, write=False):
else:
log.info("{0}: fingerprinting", util.displayable_path(item.path))
try:
_, fp = acoustid.fingerprint_file(util.syspath(item.path))
_, fp = acoustid.fingerprint_file(util.syspath(item.path), force_fpcalc=self.config["forceFpcalc"])
item.acoustid_fingerprint = fp.decode()
if write:
log.info(
Expand Down
3 changes: 1 addition & 2 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ New features:
* Sorted the default configuration file into categories.
:bug:`4987`
* :doc:`/plugins/convert`: Don't treat WAVE (`.wav`) files as lossy anymore
when using the `never_convert_lossy_files` option. They will get transcoded
like the other lossless formats.
* :doc:`plugins/chroma`: Add the ability to force the use of the fpcalc cli tool instead of the library.

Bug fixes:

Expand Down
12 changes: 9 additions & 3 deletions docs/plugins/chroma.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,18 @@ written to files' metadata.
Configuration
-------------

There is one configuration option in the ``chroma:`` section, ``auto``, which
controls whether to fingerprint files during the import process. To disable
fingerprint-based autotagging, set it to ``no``, like so::
To control whether to fingerprint files during the import process use
the ``auto`` option. To disable fingerprint-based autotagging, set it to
``no``.

When both the library and the ``fpcalc`` binary tool are available chroma defaults
to the library. To force the use of ``fpcalc`` use the ``forceFpcalc`` option.

chroma:
# Don't run during the import
auto: no
# Use fpcalc even if the library is available
forceFpcalc: yes

Submitting Fingerprints
-----------------------
Expand Down