Commit Graph
893 Commits
Author SHA1 Message Date
Alok Saboo 826aaeb4b3 Address reviewer comments 2026-04-18 21:07:48 -04:00
Alok Saboo bd6c7378a9 Merge branch 'master' into spotify_batch 2026-04-18 18:32:50 -04:00
Šarūnas Nejus 34517120b9 Add a single data-driven recording test 2026-04-18 19:29:33 +01:00
Šarūnas Nejus c27b69e030 Reorganise tests 2026-04-18 17:31:50 +01:00
Šarūnas Nejus cffb4d28fe Remove redundant artist credit test 2026-04-18 17:31:50 +01:00
Šarūnas Nejus 652f74b8f4 Simplify test get date 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 7d2ffd0309 Simplify pseudo release lookup 2026-04-18 17:31:49 +01:00
Šarūnas Nejus a5189a0014 Test album criteria completely 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 4ada3b5e50 Refactor and test fetching complete recording data 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 6b8c0974bc Test pregap track 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 595aee27ad Simplify media tests 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 76c55cc74c Test URL relations parsing 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 92078ec756 Move test_parse_release under TestParse 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 8c35f45d60 Test parsing label infos fully 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 245f45eba4 Extend artist credits parsing coverage 2026-04-18 17:31:49 +01:00
Šarūnas Nejus ffd98a9f79 Simplify aliases tests 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 4bc5498663 Simplify genres tests 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 0f486f9117 Simplify preferred_alias tests 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 93dd413a70 Collapse data tracks tests into a single test 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 93b0cfde48 Collapse many tests into a single data-driven test 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 7e52bea0f5 Fix typing issues in tests 2026-04-18 17:31:49 +01:00
Šarūnas Nejus a5368a16f4 Make use of ReleaseFactory 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 39c515ce75 Introduce ReleaseFactory 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 817b90fb6f Refactor medium parsing 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 1965c0746c Refactor parsing medium track 2026-04-18 17:31:49 +01:00
Šarūnas Nejus bca79cbbe5 Use RecordingFactory in tests 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 0d15952c7a Enforce asin, disambiguation, fix status 2026-04-18 17:31:49 +01:00
Šarūnas Nejus f611ae6968 Refactor parsing language and script 2026-04-18 17:31:49 +01:00
Šarūnas Nejus bff84bbd06 Refactor parsing label info 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 7cafb250e6 Refactor parsing genre 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 0b0f715121 Use ReleaseGroupFactory 2026-04-18 17:31:49 +01:00
Šarūnas Nejus befcf6a63b Refactor date parsing 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 5b32661f17 Refactor _preferred_release_event 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 9ec85d1ba2 Use artist_relation_factory 2026-04-18 17:31:49 +01:00
Šarūnas Nejus c5519de8d0 Use ArtistFactory 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 486cd99540 Remove _artist_ids 2026-04-18 17:31:49 +01:00
Šarūnas Nejus 0ed87af0b9 Use ArtistCreditFactory for test artist_credit construction 2026-04-18 17:31:48 +01:00
Šarūnas Nejus d7fd707ca5 Simplify multi artist credit parsing 2026-04-18 17:31:48 +01:00
Šarūnas Nejus 9b7e486930 Simplify aliases parsing 2026-04-18 17:31:48 +01:00
Šarūnas Nejus 0bc0a3d3ac Ensure correct data shape in recordings tests 2026-04-18 17:31:32 +01:00
Šarūnas Nejus 176667b826 Rename track -> recording in tests for clarity 2026-04-18 17:31:32 +01:00
Šarūnas Nejus 163b94d464 lyrics: add keep_synced option to not overwrite synced lyrics 2026-04-17 09:19:15 +01:00
Šarūnas Nejus fb72e11f33 Add tests 2026-04-16 09:02:29 +01:00
Šarūnas Nejus 1434979ba0 Fetch remixers, composers, arrangers and lyricists from Discogs 2026-04-16 09:02:07 +01:00
Christopher Larson 5bc11ea736 inline: make the album/item available directly
There have been multiple requests, in the past, for the ability to use
plugin fields in inline fields. This has not previously been available.
From what I can tell, it was intentionally left unavailable due to
performance concerns.

The way the item fields are made available to the inline python code
means that all fields are looked up, whether they're actually used by
the code or not. Doing that for all computed fields would be a
performance concern.

I don't believe there's a good way to postpone the field computation, as
python eval and compile requires that globals be a dictionary, not a
mapping. Instead, we can make available the album or item model object
to the code directly, and let the code access the fields it needs via
that object, resulting in postponing the computation of the fields until
they're actually accessed.

This is a simple approach that makes the computed and plugin fields
available to inline python, which allows for more code reuse, as well as
more options for shifting logic out of templates and into python code.
The object is available as `db_obj`.

Examples:

    item_fields:
      test_file_size: db_obj.filesize

    album_fields:
      test_album_path: db_obj.path
      # If the missing plugin is enabled
      test_album_missing: db_obj.missing

Signed-off-by: Christopher Larson <kergoth@gmail.com>
2026-04-15 11:59:19 -07:00
Šarūnas Nejus 9d64f00a77 Merge branch 'master' into fix/mbpseudo-raw-data 2026-04-15 00:26:05 +01:00
Martin Caspersen 0ff0fc8110 Merge branch 'beetbox:master' into fix/mbpseudo-raw-data 2026-04-15 01:05:13 +02:00
Andrew Yang 4f3e8907c4 test(chroma): consolidate gating tests into a single class
Per @snejus review feedback on #6532: merge TestChromaWithoutMusicBrainz
and TestChromaWithMusicBrainz into a single TestChromaCandidates class
with the motivating comment moved into its docstring. Test method names
now encode the 'without' / 'with' variant.
2026-04-15 00:03:23 +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