Commit graph

413 commits

Author SHA1 Message Date
Šarūnas Nejus
aa640e57b7
Rename track -> recording in tests for clarity 2026-02-01 16:06:25 +00:00
Šarūnas Nejus
78d7a94041
Simplify parsing recordings
This way we only ever handle full Recording objects.
2026-02-01 16:06:25 +00:00
Šarūnas Nejus
e0842c44db
Normalize dashes to underscores in musicbrainz data fields 2026-02-01 16:06:25 +00:00
Šarūnas Nejus
8f514eb6ab Replace/fix Release.type with Release.primary-type 2026-01-31 18:05:18 +00:00
Arne Beer
4d7b9cb14b fix(lastgenre): Canonicalize keep_existing fallback
Fixes a bug where existing tags were set to None, if they weren't whitelisted, but an whitelisted canonicalized parent existed up the tree.

In all other cases, the original genres are canonicalized and considered for the final genre, except in the keep_existing logic branch.
This PR fixes the issue and results in the expected behavior for this combination of options.

For the bug to trigger several conditions had to be met:

- Canonicalization is enabled and a whitelist is specified.
- `force` and `keep_existing` are set. Meaning, that Lastfm is queried for a genre, but the existing genres are still left around when none are found online.
- A release with a non-whitelisted genre exists, but that genre has a whitelisted genre parent up the tree.
- That very release has no genre on lastfm.

This is rather convoluted, but stay with me :D
What would happen is the following:

- `keep_genres` is set to the existing genres, as `force` and `keep_existing` is set.
- Genres for `track`/`album`/`artist` aren't found for this release, as they don't exist in lastfm.
- Then the `keep_existing` logic is entered.
  - The old logic only checks if the existing genres have an **exact** match for the whitelist. In contrast to all other code branches, we don't do the `_try_resolve_stage` in case there's no direct match, resulting in no match.
- We continue to the fallback logic, which returns the fallback (`None` in my case)

This patch results in one last try to resolve the existing genres when `keep_existing` is set, which includes canonicalization (if enabled).
2026-01-31 13:22:56 +01:00
Kirill A. Korinsky
48c954edf6 Nuked tests 2026-01-30 00:46:13 +00:00
Kirill A. Korinsky
47b1644110 Attemt to rework tests 2026-01-30 00:46:13 +00:00
Kirill A. Korinsky
78b6d537b6 Retries with 1, 2, 4, 8, 16, 32s backoff
At least it allows me to more or less use MusicBrainz
2026-01-30 00:46:13 +00:00
Sebastian Mohr
6c52252672
Readded licence. Removed last legacy occurrences of artist and
replaced them with `field`. Removed unnecessary default parameters where
applicable.
2026-01-30 00:30:21 +00:00
Šarūnas Nejus
2aa7575294
Replace random.Random with random module 2026-01-30 00:30:21 +00:00
Sebastian Mohr
bcb22e6c85
Overall refactor of random plugin. Added length property to albums. 2026-01-30 00:30:21 +00:00
Sebastian Mohr
34e0de3e1f
Added typehints and some more tests. 2026-01-30 00:30:20 +00:00
Šarūnas Nejus
146c462e97
Merge branch 'master' into handle-404-in-reimport 2026-01-23 02:08:45 +00:00
David Logie
8769f8f8f0 Gracefully handle 404s when importing from MusicBrainz.
A 404 error can be raised when fetching from MusicBrainz in the case of
re-importing an album that has since been deleted from MusicBrainz.
2026-01-22 12:20:04 +00:00
Serene
39f65f6b11
Merge branch 'master' into embedart-clear-improvements 2026-01-20 08:43:30 +10:00
Henry
ff95ce5d20 Remove utils, rework from_plugin method in ArtistState to from_config 2026-01-19 12:43:30 -08:00
Šarūnas Nejus
7d83a68bdd Ensure all fields in artist dicts in tests 2026-01-19 12:43:30 -08:00
Šarūnas Nejus
b3183a73e0 Simplify building artist 2026-01-19 12:43:30 -08:00
Šarūnas Nejus
59e7c59172 Move building logic to dataclasses 2026-01-19 12:43:30 -08:00
Henry Oberholtzer
2d406a3ca5 Add comments, clean up types. 2026-01-19 12:43:30 -08:00
Henry
459fd39768 Fix behavior when ANV does not exist 2026-01-19 12:43:30 -08:00
Henry Oberholtzer
08a2c248b9 Fix handling of commas and semicolons in artist join 2026-01-19 12:43:30 -08:00
Henry
f0aef6e213 Cleanup for #6177, #6068 2026-01-19 12:43:27 -08:00
Henry
1d6e05709e Fix #6068 - Multivalue fields are now supported & tested. 2026-01-19 12:41:36 -08:00
Henry
9efe87101c Fix #6177, remove derived types, refactor coalesce tracks 2026-01-19 12:40:42 -08:00
Šarūnas Nejus
1c20e4bd4e
Address RUF012 2026-01-13 20:55:40 +00:00
Šarūnas Nejus
c52656fb0a
Enable RUF rules 2026-01-13 20:55:40 +00:00
Šarūnas Nejus
b964d8b7eb
Configure future-annotations 2026-01-13 20:55:40 +00:00
David Logie
3ea4bb7941 Fix bug in fetching preferred release event.
With the changes to how data is fetched from MusicBrainz, empty releases
are now `None` instead of an empty dict.
2026-01-13 13:16:09 +00:00
Henry Oberholtzer
f7b05cb7db ftintitle: fix changelog conflict 2026-01-08 12:20:25 -08:00
Aidan Epstein
b53aff9b15 Fix fetchart colors broken by 67e668d81f 2026-01-07 10:36:08 -08:00
Serene
c125918b9f
Merge branch 'master' into embedart-clear-improvements 2026-01-07 19:06:11 +10:00
Eric Masseran
3c34fd25f3 Merge branch 'master' into embedart-clear-improvements
* master: (37 commits)
  importsource: Test skip, Test reimport-skip
  Fix initial importsource plugin #4748 changelog
  importsource: fix potential prevent_suggest_removal crash
  Ensure that inc are joined with a plus
  Add retries for connection errors
  Add Usage block to RequestHandler
  Refactor HTTP request handling with RequestHandler base class
  Make musicbrainzngs dependency optional and requests required
  musicbrainz: remove error handling
  musicbrainz: access the custom server directly, if configured
  musicbrainz: browse directly
  musicbrainz: search directly
  musicbrainz: lookup recordings directly
  musicbrainz: lookup release directly
  Move pseudo release lookup under the plugin
  Add missing blame ignore revs from musicbrainz plugin
  Define MusicBrainzAPI class with rate limiting
  Move TimeoutSession under beetsplug._utils
  expand tests to include check for track artists
  remove changes for lastgenre as there was an existing PR for that work
  ...
2026-01-06 22:43:47 +01:00
Šarūnas Nejus
55b9c1c145
Retry on server errors too 2026-01-06 09:54:02 +00:00
Šarūnas Nejus
b49d71cb69
mbcollection: slight refactor 2026-01-06 09:54:02 +00:00
Šarūnas Nejus
92352574aa
Migrate mbcollection to use MusicBrainzAPI 2026-01-06 09:54:02 +00:00
Šarūnas Nejus
143cd70e2f
mbcollection: Add tests 2026-01-06 00:51:51 +00:00
Šarūnas Nejus
9349ad7551
Migrate missing to use MusicBrainzAPI 2026-01-06 00:51:50 +00:00
Šarūnas Nejus
d346daf48e
missing: add tests for --album flag 2026-01-06 00:51:24 +00:00
Šarūnas Nejus
a33371b6ef
Migrate parentwork to use MusicBrainzAPI 2026-01-06 00:27:36 +00:00
Šarūnas Nejus
741f5c4be1
parentwork: simplify work retrieval and tests 2026-01-06 00:27:36 +00:00
Šarūnas Nejus
36964e433e
Migrate listenbrainz plugin to use our MusicBrainzAPI implementation 2026-01-06 00:27:36 +00:00
Šarūnas Nejus
af96c3244e
Add a minimal test for listenbrainz 2026-01-06 00:26:42 +00:00
Šarūnas Nejus
523fa6ceaf
Move MusicBrainzAPI to a shared util 2026-01-06 00:26:41 +00:00
Trey Turner
714c9705c3 Merge branch 'master' into feat/ftintitle/insert_featured_artist_before_variant_clauses 2026-01-01 15:40:37 -06:00
Trey Turner
b14755df88 fix(ftintitle): remaining opportunities for improvement 2026-01-01 15:39:17 -06:00
J0J0 Todos
d72307a16f lastgenre: Adapt test_get_genre function signatures 2025-12-30 20:57:10 +01:00
Danny Trunk
9ddddf4c39 fetchart: Add support for configurable fallback cover art 2025-12-30 13:45:03 +01:00
Šarūnas Nejus
f9c3aae4ed
Musicbrainz: fix original release id access for a pseudo releae 2025-12-29 17:05:32 +00:00
Šarūnas Nejus
c807effeda
Define a shared fixture for config 2025-12-27 14:30:35 +00:00