Commit Graph
111 Commits
Author SHA1 Message Date
Šarūnas Nejus e4256b5232 Fix chroma original_year type 2026-09-01 10:55:55 +01:00
Šarūnas Nejus 4e1fdf0bf3 typing: fix annotations in metadata source plugins 2026-08-31 10:48:16 +01:00
Šarūnas Nejus 21e045795d typing: add annotations to metadata source plugins 2026-08-31 10:48:16 +01:00
Šarūnas Nejus 914441da16 typing: fix command handlers types 2026-08-21 20:56:38 +01:00
Šarūnas Nejus 6241139600 typing: define explicit optparse.Values for each command 2026-08-19 23:57:05 +01:00
Šarūnas Nejus 14eabc6060 typing: add types to command handlers 2026-08-19 23:57:01 +01:00
Šarūnas Nejus 12553051af typing: fix typing in plugins 2026-08-18 10:46:33 +01:00
Šarūnas Nejus 5039c8f6cf typing: add types to event handlers 2026-08-18 10:46:33 +01:00
Sebastian Mohr 54a2bd20e1 Removed This file is part of beets... headers. 2026-06-29 11:20:15 +02:00
Šarūnas Nejus d53ee774a9 Enable and fix flake8-return 2026-06-09 00:14:06 +01:00
Šarūnas Nejus 29580d2f00 Import everything from parent beets.autotag 2026-06-02 08:57:35 +01:00
Sebastian Mohr adfb73b66d Run ruff format 2026-05-20 16:53:06 +02:00
Šarūnas Nejus 30ab81eb5b Extract UserError from beets.ui to a new beets.exceptions module.
Update all references in core, plugins, and tests to import UserError
from the new location. This centralizes exception handling and improves
code organization.
2026-05-16 11:18:51 +01:00
Šarūnas Nejus d4f7f9ffd5 Fix types 2026-05-14 14:54:40 +01:00
Andrew Yang e446554211 chroma: address review feedback
- Use @cached_property named `mb` (per snejus/semohr) instead of a
  helper method, reducing the diff relative to the original code
- Move changelog entry to the Unreleased section (per snejus)
- Refactor tests to use PluginMixin from beets.test.helper (per
  semohr) instead of manually managing beets.plugins._instances
2026-04-15 00:03:23 +01:00
Andrew Yang 692ef4a923 chroma: gate candidates on the musicbrainz plugin being enabled
The chroma plugin uses Acoustid fingerprinting, which returns MusicBrainz
release and recording IDs. It then unconditionally resolved those IDs
through a privately instantiated MusicBrainzPlugin, so MusicBrainz-sourced
candidates appeared during tagging even when the user had not enabled the
musicbrainz plugin.

Replace the direct MusicBrainzPlugin() instantiation with a lookup through
the metadata-source registry via get_metadata_source("musicbrainz"). When
that returns None, short-circuit both candidates() and item_candidates()
to return empty. This also fixes an incidental issue where the private
instance bypassed any plugin that swaps the musicbrainz plugin at runtime
(e.g. mbpseudo).

Acoustid fingerprinting itself is unaffected — acoustid_id and
acoustid_fingerprint item fields are still populated as before.

Fixes #6212
2026-04-15 00:03:23 +01:00
ShimmerGlass 1242f42b37 feat(chroma): add chromasearch command
This command lets user search the database by chromaprint fingerprint
similarity.
Database item fingerprints are computed on the fly if needed.
This is useful for example to check if an unknown / untagged audio file
already exists in the database.
2026-04-04 15:03:42 +02:00
Šarūnas Nejus b964d8b7eb Configure future-annotations 2026-01-13 20:55:40 +00:00
Šarūnas Nejus d486885af3 pyupgrade Python 3.10 2025-11-08 12:09:52 +00:00
Šarūnas Nejus b3d434f58f Delegate attribute access to logging 2025-08-30 23:10:21 +01:00
Šarūnas Nejus e334e81d40 Use item.filepath instead of displayable_path in logging 2025-08-30 23:10:21 +01:00
Šarūnas Nejus d93ddf8dd4 Do not use explicit indices for logging args when not needed 2025-08-30 23:10:21 +01:00
Rebecca Turner 1786adfff1 chroma: set a default timeout of 10 seconds
TODO: Configurable timeouts :)
2025-08-10 23:14:20 -07:00
Sebastian Mohr f70e5ec758 split imports 2025-07-16 12:07:49 +02:00
Sebastian Mohr 47f8fbe629 Plugin should call super init. 2025-07-16 11:48:34 +02:00
Sebastian Mohr 0c6b383b06 Track info should not be imported from metadata_plugin. 2025-07-16 11:43:17 +02:00
Sebastian Mohr a770cfb669 Opt in chroma plugin. 2025-07-15 15:03:14 +02:00
Šarūnas Nejus 7cada1c9f8 Remove no-op decargs 2025-07-08 11:37:33 +01:00
Šarūnas Nejus adbd50b237 Move distance to a separate module 2025-05-31 19:17:43 +01:00
Šarūnas Nejus e8e9369bc7 Remove unused extra_tags parameter 2025-05-19 09:18:06 +01:00
Šarūnas Nejus 2fcb48d7a4 Remove ...for_mbid methods and simplify the rest 2025-05-17 03:31:57 +01:00
Serene-Arc a6e5201ff3 Apply formatting tools to all files
This is 'the big one', which touches every file so that it all conforms
to the given standard.
2023-10-22 09:53:18 +10:00
Andrew Rogl 1ec87a3bdd pyupgrade beetsplug and tests
All tests working
More tidy up to be done
2021-08-26 19:12:51 +10:00
John Hamelink 77ce69fe77 Fixes #3834:
This PR fixes a bug (#3834) where tracks which have already been fingerprinted do not return to be used by `beet submit` (part of the Chroma plugin). This results in  submission errors, as the fingerprint is omitted from the resultant payload sent to acoustID.
2021-01-19 22:05:34 +00:00
PotcFdk 2039f26f96 Update file metadata after generating fingerprintsthrough the submit command. 2020-08-26 13:36:40 +02:00
Andrew Rogl f306591a99 add the extra_tags option to all required plugins 2020-03-28 17:36:02 +10:00
Carl Suster 6382c364e2 confit: replace with confuse in plugins 2019-06-01 10:03:41 +10:00
Jan Holthuis d2521d9256 Fix acoustid_fingerprint type confusion
Since pyacoustid returns the fingerprint as bytes (and thus causes the
database to store a bytes/BLOB object), but the tag value is a string,
the acoustid_fingerprint tag always causes file change when using beet's
"write" command, even if the actual value didn't change.

Issue #2942 describes the problem.

This commit fixes that issue for newly imported/fingerprinted files. However,
you still need to change the type of all acoustid_fingerprint fields
that are already present in the database:

    $ sqlite3 beets.db
    SQLite version 3.26.0 2018-12-01 12:34:55
    Enter ".help" for usage hints.
    sqlite> UPDATE items SET acoustid_fingerprint = CAST(acoustid_fingerprint AS TEXT);
2018-12-19 10:30:50 +01:00
Derek King 549c115752 Return tuple of numbers instead of string for release_key 2018-09-01 04:10:29 +10:00
Derek King 7a8f980323 chroma: Allow releases to be sorted by date/country
Uses
match:preferred:countries/original_year:
config options to determine whether the releases should be sorted by their respective fields.
The behaviour is the same as before when the default config is used.
2018-08-31 00:39:47 +10:00
Adrian Sampson 015aee3662 Fix #2671: missing syspath on acoustid call 2017-08-26 11:18:27 -04:00
Johnny Robeson fcbfce3984 replace deprecated log.warn() with log.warning() 2016-08-09 00:33:38 -04:00
Adrian Sampson 5efd5b21c5 Use new as_str method
Instead of `get(six.text_type)`, which was a surprisingly large portion of our
uses of six.
2016-06-25 19:16:14 -07:00
Adrian Sampson e16cc58cb9 Walk back some six.iter* uses
In places where it doesn't much matter whether we use an iterator or the old
Python 2 list way, using the six name just hurts legibility.
2016-06-25 18:29:55 -07:00
Johnny Robeson edb1cbc5fc replace iter{items|values} with six.iter{items|values} 2016-06-24 05:53:55 -04:00
Johnny Robeson e8afcbe7ec replace unicode with six.text_type 2016-06-24 05:53:49 -04:00
Adrian Sampson e54c7eec3d Standardize __future__ imports without parentheses
Since the list is short enough now, we don't need parentheses for the line
wrap. This is a little less ugly.
2016-02-28 15:03:51 -08:00
Peter Kessen 40900aa1cb Removed unicode_literals from plugins
* bucket
* chroma
* convert
* discogs
2016-02-20 12:10:01 +01:00
Jack Wilsdon 12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00:00
Peter Kessen 3eb8008b11 added encoding as comment in files
added line like
# -*- coding: utf-8 -*-
to all files with correct license in header
2015-11-19 18:41:01 +01:00