Commit Graph
87 Commits
Author SHA1 Message Date
Šarūnas Nejus 0b5a5b0350 typing: fix missing types in plugins 2026-08-31 11:27:12 +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 f37306b0cc typing: remove redundant types 2026-08-18 23:20:39 +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 648f24cbc2 Enable and fix flake8-builtins 2026-06-09 00:14:06 +01: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
Carson Jones be722b564e Use va_name config for all artist fields on VA releases
When importing compilations, albumartist_sort, albumartists_sort,
albumartist_credit, albumartists_credit, and albumartists were
hardcoded to "Various Artists" instead of using the user-configured
va_name setting. This also fixes the same issue in the beatport plugin.

Fixes #6316
2026-03-12 23:00:32 -04:00
Szymon Tarasiński b008488b84 refactor: Use deprecate_for_user for beatport/bpsync deprecation warnings 2026-03-08 17:10:29 +00:00
Szymon Tarasiński efa1f370b7 Deprecate beatport and bpsync plugins
Beatport has retired the API these plugins rely on, making them
non-functional. Add deprecation warnings and update documentation
to reflect the current state.

Fixes #3862
2026-03-08 17:10:29 +00:00
Šarūnas Nejus 10d13992e6 Dedupe genres parsing in beatport 2026-02-27 18:36:04 +00:00
dunkla 9224c9c960 Use compact generator expression in Beatport (ref https://github.com/beetbox/beets/pull/6169#issuecomment-3716893013) 2026-02-27 18:24:54 +00:00
dunkla 36a30b3c65 Implement automatic database-level genre migration
- Add Library._make_table() override to automatically migrate genres when database schema is updated
- Migration splits comma/semicolon/slash-separated genre strings into genres list
- Writes changes to both database and media files with progress reporting
- Remove lazy migration from correct_list_fields() - now handled at database level
- Remove migration-specific tests (migration is now automatic, not lazy)
- Update changelog to reflect automatic migration behavior

Related PR review comment changes:
- Replace _is_valid with _filter_valid method in lastgenre plugin
- Use unique_list and remove genre field from Beatport plugin
- Simplify LastGenre tests - remove separator logic
- Document separator deprecation in lastgenre plugin
- Add deprecation warning for genre parameter in Info.__init__()
2026-02-27 18:24:54 +00:00
Johann Fot 70bf57baf6 Add native support for multiple genres per album/track
Simplify multi-genre implementation based on maintainer feedback (PR #6169).

Changes:
- Remove multi_value_genres and genre_separator config options
- Replace complex sync_genre_fields() with ensure_first_value('genre', 'genres')
- Update all plugins (Beatport, MusicBrainz, LastGenre) to always write genres as lists
- Add automatic migration for comma/semicolon/slash-separated genre strings
- Add 'beet migrate genres' command for explicit batch migration with --pretend flag
- Update all tests to reflect simplified approach (44 tests passing)
- Update documentation

Implementation aligns with maintainer vision of always using multi-value genres
internally with automatic backward-compatible sync to the genre field via
ensure_first_value(), eliminating configuration complexity.

Migration strategy avoids problems from #5540:
- Automatic lazy migration on item access (no reimport/mbsync needed)
- Optional batch migration command for user control
- No endless rewrite loops due to proper field synchronization
2026-02-23 05:11:36 +00:00
Šarūnas Nejus d486885af3 pyupgrade Python 3.10 2025-11-08 12:09:52 +00:00
Šarūnas Nejus c2ab93a946 Remove redundant source_weight defaults 2025-10-10 20:36:33 +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
Šarūnas Nejus 1c16b2b308 Replace string concatenation (' + ')
- Join hardcoded strings
- Replace concatenated variables with f-strings
2025-08-30 23:10:15 +01:00
Šarūnas Nejus 4a361bd501 Replace format calls with f-strings 2025-08-30 18:42:26 +01:00
Sebastian Mohr 1d33580b68 Renamed class method to _extract_id. 2025-07-15 15:03:14 +02:00
Sebastian Mohr 3eadf17e8f Opt in beatport plugin. Also enhanced type hints and minor cleanup for
the beatport plugin.
2025-07-15 15:03:14 +02:00
Šarūnas Nejus e8e9369bc7 Remove unused extra_tags parameter 2025-05-19 09:18:06 +01:00
Šarūnas Nejus b520981c9c plugins: restructure id extraction 2025-05-17 14:57:34 +01:00
Šarūnas Nejus 85a17ee503 Reformat the codebase 2024-09-21 11:57:48 +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
J0J0 Todos 5bf4e3d92f Dedicated flex attrs for Deezer, Beatport album ID
- Similar to what the Spotify plugin does, on imports we save to a field
  `..._album_id` (spotify_album_id, deezer_album_id, beatport_album_id)
- It would be good to submit such a change to the 3rd-party plugins beetcamp
  and beatport4 as well (beatport_album_id, bandcamp_album_id).
- We might need to investigate why none of these
  flex attr fields get populated to the beets album level (`beet info -a`,
  album_attributes db table), it is only available at the item level (`beet
  info`, item_attributes db table). This should be tackled in a future
  issue/PR.
2023-03-26 13:20:07 +02:00
J0J0 Todos f36c55f730 Refactor Beatport plugin to use _get_id
from MetadataSourcePlugin and save beatport_id_regex in id_extractors module.
This streamlines the Beatport release ID extraction magic with plugins Deezer
and Spotify.
2023-03-08 18:12:31 +01:00
Andrew Rogl ee4268dabb Remove unused imports
Fix imports
Fix formatting
2021-08-26 20:59:48 +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
Andrew Rogl f306591a99 add the extra_tags option to all required plugins 2020-03-28 17:36:02 +10:00
Rahul Ahuja 5e6b8f5264 DRY album/track distances 2019-10-03 22:04:30 -07:00
Rahul Ahuja 14b8f30ead Appease flake8 2019-10-03 19:13:40 -07:00
Rahul Ahuja f14137fcc2 Add BPSyncPlugin 2019-10-03 18:04:12 -07:00
Rahul Ahuja 3ffaaa1f37 Default bpm to None 2019-09-28 11:37:58 -07:00
Rahul Ahuja 7b9ebcbf2f Properly guard against None key 2019-09-27 17:48:28 -07:00
Rahul Ahuja 13792bd8ab Always set musical_key 2019-09-27 17:33:49 -07:00
Rahul Ahuja 4bc057fd5e Exclude invalid musical keys 2019-09-27 17:11:47 -07:00
temrix dfb6fc3f5b Test for presence and non-emptiness in one go. 2019-09-21 21:14:11 +02:00
temrix 9a4175dcd0 Return value directly. 2019-09-21 21:13:41 +02:00
temrix f98010ad23 Add 'look before you leap' defensive code. 2019-09-21 16:09:08 +02:00
temrix b4edc1f832 Add bpm, musical_key and genre to plugin. 2019-09-19 00:29:43 +02:00
FichteFoll 728203e15a beets.io now supports HTTPS
See https://github.com/beetbox/beets/pull/3297.
2019-06-06 15:34:15 +02:00
FichteFoll 670046dd9a Build https URLS for beatport releases
I'm not sure where these are used, but the website supports https and
the API url already uses https, so this should be a safe call and not
require a util.SNI_SUPPORTED check.
2019-06-05 22:55:12 +02:00
Carl Suster 6382c364e2 confit: replace with confuse in plugins 2019-06-01 10:03:41 +10:00
Adrian Sampson 6ee824fb0f Fix #3184: AttributeError in error handler 2019-03-14 09:53:32 -04:00
Jakub Wilk d3664ad5db Fix misuse of flags in re.sub() calls
The 4th argument of re.sub() is maximum number of substitutions,
not flags.
2017-04-15 14:44:19 +02:00