Commit graph

4194 commits

Author SHA1 Message Date
Michael Krieger
dc13308784 Remove tests. Update docs. Remove unnecessary return
Remove tests.  Update docs.  Remove unnecessary return.
2025-10-14 03:17:34 +01:00
Michael Krieger
b1c87cd98c Change parameter name, add return, add tests
Change the parameter name to omit_single_disc (vs previously zero_disc_if_single_disc)

Add return of 'fields_set' so that, if triggered by the command line `beets zero`, it will still effect the item.write.

Added tests.
2025-10-14 03:17:34 +01:00
Michael Krieger
5fc15bcfa4 Misc formatting changes 2025-10-14 03:17:34 +01:00
Michael Krieger
33b350a612 Adds a zero_disc_if_single_disc to the zero plugin
Adds a zero_disc_number_if_single_disc boolean to the zero plugin for writing to files. Adds the logic that, if disctotal is set and there is only one disc in disctotal, that the disc is not set.

This keeps tags cleaner, only using disc on multi-disc albums. The disctotal is not touched, particularly as this is not usually displayed in most clients.

The field is removed only for writing the tags, but the disc number is maintained in the database to avoid breaking anything that may depend on a disc number or avoid possible loops or failed logic.
2025-10-14 03:17:34 +01:00
Ember Light
b95a17d8d3 remove feat from custom_feat_words 2025-10-12 22:40:27 +02:00
Ember Light
51c971f089 Fix sourcery-ai comments 2025-10-12 21:38:13 +02:00
Ember Light
37a5f9cb15 Add custom feat words 2025-10-12 20:47:51 +02:00
Šarūnas Nejus
c2ab93a946
Remove redundant source_weight defaults 2025-10-10 20:36:33 +01:00
Martin Atukunda
545213421b
feat(plugin/web): support for nexttrack keypress 2025-10-09 20:11:19 +03:00
J0J0 Todos
a642609faa
Merge branch 'master' into ffnp 2025-10-06 11:06:10 +02:00
Henry
ed73903deb type corrections 2025-10-04 11:59:15 -07:00
Henry
2a80bdef2e Added type hints to all functions 2025-10-04 11:03:17 -07:00
Henry
a909dddd16 adding typechecks, need to fix the medium discrepancy 2025-10-03 18:52:37 -07:00
Henry
267428f0a4 Merge branch 'master' of github.com:henry-oberholtzer/beets into discogs-anv-support 2025-10-03 15:05:48 -07:00
Henry
b9a840a2a3 Update all functions with types 2025-10-03 15:01:34 -07:00
Henry
f5acdec2b1 Update configuration format. 2025-10-03 14:44:22 -07:00
Alok Saboo
b66b2b51b5 Remove potentially expensive item.get() calls 2025-10-01 17:48:41 -04:00
Alok Saboo
70a4d0462d Persist spotify track attributes even if audio features are missing 2025-10-01 17:15:13 -04:00
Sebastian Mohr
4782e96599
Move vfs.py to beetsplug._utils package to avoid polluting core namespace (#6017)
This PR moves the `vfs.py` module, which is only used by plugins, to
avoid polluting the main beets namespace. Also exposes the `vfs` and
`art` module from beets with a deprecation warning.
2025-10-01 12:28:18 +02:00
Henry
9371ab81ec Merge remote-tracking branch 'origin' into discogs-anv-support 2025-09-30 19:23:23 -07:00
Vrihub
5f9800ec43
Merge branch 'master' into ffnp 2025-09-30 17:41:13 +02:00
Vrihub
80ffa4879d Improve regexp and module docstring 2025-09-30 15:46:26 +02:00
Sebastian Mohr
b2fc007480 Fixed plugin typehints: use actual logger class. 2025-09-30 13:37:51 +02:00
Henry
abc8c2d5d8 resolve overriding method type error 2025-09-27 15:05:14 -07:00
Henry
9efe728f47 type checking, tuple unpacking fix in various artists 2025-09-27 14:49:56 -07:00
Henry
b1903417f4 Add artist credit support, artist name variation support, more flexible featured credit. 2025-09-27 14:29:25 -07:00
Henry
dd57c0da2d improve flexibility of use of anv on artist tracks 2025-09-27 10:42:29 -07:00
Henry
1e677d57c1 Updates to documentation 2025-09-26 21:37:18 -07:00
Henry
0ec6689395 test updates, one case still failing 2025-09-26 17:56:25 -07:00
Henry
5a43d6add4 Testing and implemented anv method, also added Featuring customizable string 2025-09-26 16:01:33 -07:00
Henry
533aa6379b Test working, need to implement anv now 2025-09-25 22:38:02 -07:00
Henry
b61306ea0d Fixes, test improvement, rebase to master 2025-09-25 08:39:38 -07:00
Henry
43f2d423fa testing, updated changelog 2025-09-25 08:19:46 -07:00
Henry
876c57c8b3 Featured artists extracted and appended, need to see if join needs to be variable 2025-09-25 08:19:46 -07:00
Henry
5c03672874 Test written, beginning fix 2025-09-25 08:19:46 -07:00
Finn
29f55f9911
Merge branch 'master' into metadata_option 2025-09-24 22:02:28 -04:00
Finn
61b632f2b4 Add option to not write metadata 2025-09-24 21:52:57 -04:00
Šarūnas Nejus
787d9b4a40
Merge branch 'master' into discogs-disambiguation-fix 2025-09-22 21:50:34 +01:00
Trey Turner
f0a6059685 feat(FtInTitle): support tracks by artists != album artist 2025-09-21 22:27:11 +01:00
henry
e577df0f25
Merge branch 'master' into discogs-disambiguation-fix 2025-09-21 09:34:12 -07:00
Sebastian Mohr
34114fe915 New import location for art.py 2025-09-21 08:01:48 -07:00
Sebastian Mohr
3fd49a7de8 Moved arts.py file into beetsplug namespace as it is not used in core. 2025-09-21 08:01:48 -07:00
Alok Saboo
c7ee0e326c Add prefix to log messages for genre fetching in LastGenrePlugin 2025-09-21 07:07:14 +02:00
Alok Saboo
0be4cecf82 Update beetsplug/lastgenre/__init__.py
Co-authored-by: Šarūnas Nejus <snejus@protonmail.com>
2025-09-21 07:07:14 +02:00
Alok Saboo
5e6dd674a9 Update beetsplug/lastgenre/__init__.py
Co-authored-by: Šarūnas Nejus <snejus@protonmail.com>
2025-09-21 07:07:14 +02:00
Alok Saboo
84986dc42d Enhance lastgenre plugin: add item.try_write() for write operations and improve documentation clarity 2025-09-21 07:07:14 +02:00
Alok Saboo
a57ef2cb3b Add --pretend option to lastgenre plugin for previewing genre changes 2025-09-21 07:07:14 +02:00
Sebastian Mohr
a796d6d799 New import location for art.py 2025-09-20 14:01:38 +02:00
Sebastian Mohr
28aee0fde4 Moved arts.py file into beetsplug namespace as it is not used in core. 2025-09-20 14:01:38 +02:00
Henry
8a21bacd14 Add type check 2025-09-19 21:00:37 -07:00
Henry
dda265dc77 Disambiguation fix implemented & tested 2025-09-19 20:46:07 -07:00
Henry Oberholtzer
24fbc566f6 initial changes, changelog adjusted, TODO: test for various artists and update docs 2025-09-20 01:58:56 +02:00
Sebastian Mohr
efbfc23931 Removed config options and fixed a bug with beet spotify command 2025-09-19 17:20:51 +02:00
Sebastian Mohr
c7ba399dd1 fix incorrect matches when album is missing or empty
closes #5189
2025-09-19 17:20:51 +02:00
Rebecca Turner
a302b6d9c2 fromfilename: Don't crash if title is missing
Prevents this crash:

```
$ beet import ~/Music/Music/_/[1405]/00.mp3
Traceback (most recent call last):
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/bin/.beet-wrapped", line 9, in <module>
    sys.exit(main())
             ~~~~^^
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/ui/__init__.py", line 1859, in main
    _raw_main(args)
    ~~~~~~~~~^^^^^^
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/ui/__init__.py", line 1838, in _raw_main
    subcommand.func(lib, suboptions, subargs)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/ui/commands.py", line 1390, in import_func
    import_files(lib, byte_paths, query)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/ui/commands.py", line 1330, in import_files
    session.run()
    ~~~~~~~~~~~^^
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/importer/session.py", line 234, in run
    pl.run_parallel(QUEUE_SIZE)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/util/pipeline.py", line 471, in run_parallel
    raise exc_info[1].with_traceback(exc_info[2])
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/util/pipeline.py", line 336, in run
    out = self.coro.send(msg)
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/util/pipeline.py", line 219, in coro
    func(*(args + (task,)))
    ~~~~^^^^^^^^^^^^^^^^^^^
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/importer/stages.py", line 141, in lookup_candidates
    plugins.send("import_task_start", session=session, task=task)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/plugins.py", line 505, in send
    result = handler(**arguments)
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beets/plugins.py", line 200, in wrapper
    return func(*args, **kwargs)
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beetsplug/fromfilename.py", line 165, in filename_task
    apply_matches(d, self._log)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/nix/store/lfv9ns20hz2bg6d44js378vcxjfm9261-beets-2.3.1/lib/python3.13/site-packages/beetsplug/fromfilename.py", line 124, in apply_matches
    item.title = str(d[item][title_field])
                     ~~~~~~~^^^^^^^^^^^^^
KeyError: 'title'
```
2025-09-18 14:57:48 +02:00
Vrihub
c30f9603eb Fix format and lint errors 2025-09-16 17:31:42 +02:00
Vrihub
6b1c3bc582 Merge remote-tracking branch 'upstream/master' into ffnp 2025-09-16 16:01:25 +02:00
J0J0 Todos
e59521e375 lastgenre: tree/whitelist: Remove experimental
experimental, even though a tag last.fm very often returns (in top 20
tag charts!), it is too broad of a term to be pinned downed with any
particular genre, thus can't really be used for canonicalization.
2025-09-13 09:29:43 +02:00
J0J0 Todos
a98ba061e8 lastgenre: tree/whitelist: UK/Breakbeat Hardcore
Also changes decided during PR discussions and more research.
2025-09-13 09:29:43 +02:00
J0J0 Todos
9f442dcf75 lastgenre: tree/whitelist: Contributor feedback
that came up in the pull request comments and other discussions.
2025-09-13 09:29:43 +02:00
J0J0 Todos
4949f44e82 lastgenre: tree/whitlist: Jojo's essential fixes
Fixes to the beets default tree and whitlist files I collected over the
years; Includes Tags last.fm returns quite often; Also the
chart.getTopTags API endpoint was checked to make sure the top 100
charts are included in beets default tree and whitelist.
2025-09-13 09:29:43 +02:00
J0J0 Todos
7a5cfa8f46 lastgerne: Update wl/tree load methods docstrings 2025-09-10 07:36:47 +02:00
J0J0 Todos
d2caed3971 lastgenre: Also log which whitelist file is loading 2025-09-10 07:36:47 +02:00
J0J0 Todos
6601cbf8c0 lastgenre: canonical/whitelist setting None load default files 2025-09-10 07:36:47 +02:00
J0J0 Todos
6bc30eaf18 lastgenre: Add docstrings to file load methods 2025-09-10 07:36:47 +02:00
J0J0 Todos
6da72beeb0 lastgenre: Add expanduser to whitelist/tree load 2025-09-10 07:36:47 +02:00
J0J0 Todos
81d342b79f lastgenre: Simplify default tree loading 2025-09-10 07:36:47 +02:00
J0J0 Todos
c54a54682f lastgenre: Use pathlib and simplify whitelist load
- Read the whole file using Path().read_text()
- Strip whitespace and lower() transform

Drawbacks:

- Normalization gets lost (normpath did that)
2025-09-10 07:36:47 +02:00
J0J0 Todos
fbd90b0507 lastgenre: Use pathlib for opening tree file
instead of syspath(normpath())

Co-authored-by: Šarūnas Nejus <snejus@protonmail.com>
2025-09-10 07:36:47 +02:00
J0J0 Todos
0cdb1224b9 lastgenre: Fix c14n load log msg format 2025-09-10 07:36:47 +02:00
J0J0 Todos
bbde63d87e lastgenre: Accept AI suggested use open() for tree file
instead of codecs.open(), which most probably is a relict of beets' Python2/3 compatibility area.

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-09-10 07:36:47 +02:00
J0J0 Todos
a98fa054fe lastgenre: Fix failing CI tests by using syspath
when loading c14n file.
2025-09-10 07:36:47 +02:00
J0J0 Todos
5ff88b46cf lastgenre: Fix another mypy error in c14n load
(that was only happening in CI and not by local poe check-types)
2025-09-10 07:36:47 +02:00
J0J0 Todos
8ae29e42bf lastgenre: Fix mypy errors in file load methods 2025-09-10 07:36:47 +02:00
J0J0 Todos
6ed17912b4 lastgenre: Fix _load_whitelist return type bytes 2025-09-10 07:36:47 +02:00
J0J0 Todos
bf903fc27d lastgenre: Move file loading to helpers
and add return types.
2025-09-10 07:36:47 +02:00
Sebastian Mohr
e51de5de91 Removed data source as listenbrainz is not an metadata source plugin.
closes #5975
2025-09-04 17:41:12 +02:00
Šarūnas Nejus
17bc11034f
Limit search query results using request parameters 2025-09-01 04:36:54 +01:00
Šarūnas Nejus
20497d3d9b
Dedupe search_limit config option init 2025-09-01 04:10:53 +01:00
Šarūnas Nejus
a674fd3095
musicbrainz: Rename searchlimit config option to search_limit 2025-08-31 18:48:46 +01:00
Šarūnas Nejus
d00d51e0bf
Add configurable search_limit to Spotify and Deezer plugins 2025-08-31 18:48:46 +01:00
Šarūnas Nejus
44fda7ca0a
lyrics: use another beatles song for Lyricsmode
Lady Madonna apparently is gone from this website. ¯\_(ツ)_/¯
2025-08-30 23:10:22 +01: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
d6b6ac3387
Replace logging f-strings with arguments 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
Šarūnas Nejus
2fccf64efe
Do not use backslashes to deal with long strings 2025-08-30 23:10:20 +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
a7c83d91e9
Replace slightly more advanced attempts to use format calls 2025-08-30 22:35:00 +01:00
Šarūnas Nejus
9352a79e41
Replace percent formatting 2025-08-30 22:35:00 +01:00
Šarūnas Nejus
4a361bd501
Replace format calls with f-strings 2025-08-30 18:42:26 +01:00
Sebastian Mohr
1c0484c4ba renamed keywords to query_string, shortened query construct expression,
removed legacy isinstance check
2025-08-26 13:41:11 +02:00
Sebastian Mohr
f81684e188 Moved construct search into SearchApiMetadataSource to dedupe some
deezer and spotify functionalities.
2025-08-26 13:41:11 +02:00
Šarūnas Nejus
e603c2f08e
Merge branch 'master' into chroma-timeout 2025-08-25 23:37:41 +01:00
J0J0 Todos
0dcf7fdc23 lastgenre: Remove leftover/unused REPLACE constant 2025-08-24 09:20:36 +02:00
J0J0 Todos
05a1a95ee9 lastgenre: Dedup combine/resolve/label/format code 2025-08-24 09:20:36 +02:00
J0J0 Todos
d8e90d8e54 lastgenre: Resolve combined genres in each stage
To ensure proper fallback to the next stage, in each stage we do a full
combine/resolve/log.

Also we directly return if have satisfied results. As a bonus this
improves readability.

Some duplicate code on the label magic though...
2025-08-24 09:20:36 +02:00
J0J0 Todos
fa8b5d7495 lastgenre: Fix canonicalization of non-valid genres
- Remove "early whitelist check", since it breaks canonicalization of
  actually unwanted genres (not whitelisted) resolving "up" to parent
  genres.
- Remove the filter_valid_genres method entirely and get back to inline
  list comprehensions. The caveat is that None genres are not catched
  that way (see below, should be one of the last functions that finally
  returns lists only)
- Along the way, fix _last_lookup's rearly return to empty list instead
  of None.
2025-08-24 09:20:36 +02:00
Rebecca Turner
1786adfff1 chroma: set a default timeout of 10 seconds
TODO: Configurable timeouts :)
2025-08-10 23:14:20 -07:00
Šarūnas Nejus
54b31d01e9
Use only plugins/disabled_plugins config in plugin loading 2025-08-09 15:11:58 +01:00