Commit graph

13262 commits

Author SHA1 Message Date
Henry
327d237d9e Merge branch 'master' into titlecase 2025-11-22 00:38:51 -08:00
Henry
a6055f52e7 fix lock file 2025-11-22 00:38:31 -08:00
Henry
83c16cbb5d Rewrite tests, add cached_property decorators, add seperator feature 2025-11-22 00:16:33 -08:00
Sebastian Mohr
d446e10fb0
Add album template value in ftintitle plugin (#6164)
## Description

I was hoping to use the functionality from `ftintitle` to set the path's
album artist as the main artist, but that wasn't possible, so I added a
template value `album_artist_no_feat`.
2025-11-21 18:42:06 +01:00
Sebastian Mohr
ba18ee2f14 Added comment for deprecation in 3.0.0. 2025-11-21 18:31:59 +01:00
asardaes
be0b71043c Revert "Remove class variables for template fields and funcs"
This reverts commit a7033fe63b.
2025-11-21 18:31:59 +01:00
asardaes
23a19e9409 Remove class variables for template fields and funcs 2025-11-21 18:31:59 +01:00
asardaes
2eff2d25f5 Improve typing for template fields and funcs 2025-11-21 18:31:59 +01:00
asardaes
9c37f94171 Add album template value in ftintitle plugin 2025-11-21 18:31:59 +01:00
Sebastian Mohr
f79c125d15
Catch ValueError when beetsplug.bpd cannot be imported (#6170)
Catch ValueError when setting gst required version

`pytest.importorskip` is used to catch the case when beetsplug.bpd cannot
be imported. On macOS, the `gi` module was able to be imported, but when
trying to specify `gi.require_version`, a `ValueError` is raised about
Gst being unavailable. pytest does not catch this `ValueError` during
`importskip` as it is not an `ImportError`, and thus the test suite
errors during the test collection phase.

With this change, we catch the ValueError, and re-raise it as an
`ImportError` and pytest gracefully skips those tests.

Fixes #3324
2025-11-19 12:49:07 +01:00
Ognyan Moore
aa2dc9005f
Catch ValueError when setting gst required version
pytest.importskip is used to catch the case when beetsplug.bpd cannot be
imported. On macOS, the gi module was able to be imported, but when
trying to specify `gi.require_version`, a ValueError is raised about
Gst being unavailable. pytest does not catch this ValueError during
importskip as it is not an ImportError, and thus the test suite errors
during the test collection phase.

With this change, we catch the ValueError, and re-raise it as an
ImportError and pytest gracefully skips those tests.
2025-11-19 14:43:30 +03:00
Sebastian Mohr
88ca0ce1fb
Plugins/web: fix endpoints /…/values/… (#6158)
Following #4709 and #5447, the web plugin used single-quotes (ie. string
litteral) in the SQL query for table columns.

Thus, for instance, the query `GET /item/values/albumartist` would
return the litteral "albumartist" instead of a list of unique album
artists.

This prevents the Mopidy beets integration from working, returning the
single artist "albumartist".
2025-11-17 10:21:31 +01:00
Henry
df1ef40790 only apply & log change if there's a difference 2025-11-16 21:03:25 -08:00
Henry
dcac9bac02 Add word boundary support, fix The artist behavior 2025-11-16 17:57:59 -08:00
Henry
30919010b9 fix type issues 2025-11-15 16:17:29 -08:00
Henry
b3e6aef02f merge with master 2025-11-15 16:12:24 -08:00
Henry
c8876dde8e fix The artist behavior with artists with 'the' string in the name 2025-11-15 16:08:48 -08:00
Théophile Bastian
189fedb008 Web plugin: add type hint for g.lib 2025-11-15 21:02:43 +01:00
Théophile Bastian
666c412b0e plugins/web: fix endpoints /…/values/…
Following #4709 and #5447, the web plugin used single-quotes (ie. string
litteral) in the SQL query for table columns. Thus, for instance, the query
`GET /item/values/albumartist` would return the litteral "albumartist"
instead of a list of unique album artists.
2025-11-15 21:02:38 +01:00
Henry
a6bda748ce Added support for pre-tag selection stage 2025-11-14 19:08:14 -08:00
Sebastian Mohr
07445fdd07
Fix import --from-logfile (#6161)
Fixes "none of the paths are importable" error that was accidentally
introduced in 4260162d4

4260162d44 (diff-e324b20657a7d6b43b8b7aeb5754b96774f5062294b5ba7f1e3062845e9e7044R1382-R1390)
2025-11-13 19:32:19 +01:00
J0J0 Todos
97bc0b3b8c Changelog for #6161 2025-11-13 19:26:18 +01:00
J0J0 Todos
2ef77852b7 Fix import --from-logfile
Fixes "none of the paths are importable" error with any valid import log
file that was accidentally introduced in commit 4260162d4
2025-11-13 19:26:18 +01:00
Šarūnas Nejus
e326aafac0
Allow selecting either tags or genres in the includes, defaulting to genres (#5874)
Genres is a filtered list based on what musicbrainz considers a genre,
tags are all the user-submitted tags. [1]

1.
https://musicbrainz.org/doc/MusicBrainz_API#:~:text=Since%20genres%20are,!).
2025-11-12 21:40:02 +00:00
Aidan Epstein
672bf0bf41 Add tests. 2025-11-11 17:08:46 -08:00
Aidan Epstein
d7636fb0c3 Apply suggestions from code review
Co-authored-by: Šarūnas Nejus <snejus@protonmail.com>
2025-11-11 13:18:51 -08:00
Aidan Epstein
9e7d5debdc Allow selecting either tags or genres in the includes, defaulting to genres
Genres is a filtered list based on what musicbrainz considers a genre,
tags are all the user-submitted tags. [1]

1. https://musicbrainz.org/doc/MusicBrainz_API#:~:text=Since%20genres%20are,!).

Also apply suggestions from code review

Co-authored-by: Šarūnas Nejus <snejus@protonmail.com>
2025-11-11 20:01:37 +00:00
Sebastian Mohr
f3da80e512
FIX: Dereference symlinks before hardlinking (#5684)
When creating a hardlink, either during import or `beet convert`, if the
origin of the hardlink was a symlink, that symlink used to be directly
copied. This could create broken symlinks if the origin symlink was
relative, and in either case, probably wasn't the user's desired
behavior.

This change de-references all symlinks before creating a hardlink, such
that the end result is a normal file with the same inode as the original
file. See #5676 for more discussion about the original issue.

Fixes #5676
2025-11-11 17:07:47 +01:00
Emi Katagiri-Simpson
29a5b06f67
Merge remote-tracking branch 'upstream/master' into dereference-symlinks-while-hardlinking 2025-11-11 07:58:10 -05:00
Šarūnas Nejus
3a72d85c5e
Drop support for Python 3.9 (#6144)
Drop support for Python 3.9 and pyupgrade the codebase.

Dependency upgrades:

<img width="644" height="1017" alt="image"
src="https://github.com/user-attachments/assets/e5be110b-66fb-4373-8413-e09a56ba54bc"
/>
2025-11-11 04:09:46 +00:00
Šarūnas Nejus
bef249e616
Fix format-docs command 2025-11-11 04:03:52 +00:00
Henry Oberholtzer
c89d0c1637 add replace 2025-11-09 17:06:23 -08:00
Henry Oberholtzer
5628232bc4 add the_artist 2025-11-08 17:33:54 -08:00
Šarūnas Nejus
881549e83c
Enable all pyupgrade lint rules 2025-11-08 12:09:52 +00:00
Šarūnas Nejus
ffa70acad9
Ignore pyupgrade blame 2025-11-08 12:09:52 +00:00
Šarūnas Nejus
d486885af3
pyupgrade Python 3.10 2025-11-08 12:09:52 +00:00
Šarūnas Nejus
dc33932871
Update python version references 2025-11-08 12:09:52 +00:00
Šarūnas Nejus
a7830bebae
Update python requirement and dependencies 2025-11-08 11:55:20 +00:00
Šarūnas Nejus
d64efbb6c1
Upgrade deps before upgrade 2025-11-08 11:55:20 +00:00
Emi Katagiri-Simpson
b405d2fded
Migrate os calls to pathlib calls in hardlink util function
See discussion here: https://github.com/beetbox/beets/pull/5684#discussion_r2502432781
2025-11-07 15:05:56 -05:00
henry
29b9958626
BUG: Wrong path edited when running config -e (#5685)
As per #5652, `beet --config <path> config -e` edited the default config
path, even though that's not the config that would be used by beets.

It seems like this was the result of a deliberate short-circuit in
[`_raw_main()`](c2de6feada/beets/ui/__init__.py (L1832)).
The short-circuit prevents malformed configs from causing a crash before
opening the editor, but also prevents the setup function from loading
the custom config at all.

The solution used here is to just expose the CLI options to
`edit_config()`, so that it can use the custom config path if its set. I
also suspect that the branch in
[`config_func()`](c2de6feada/beets/ui/commands.py (L2354))
which is getting short circuited is actually unreachable, but I left it
in with a note just in case.

Fixes #5652

## To Do

- [x] ~~Documentation~~ (N/A)
- [X] Changelog
- [X] Tests
2025-11-07 11:51:26 -08:00
henry
81f10729e1
Merge branch 'master' into edit-custom-config 2025-11-07 11:40:50 -08:00
Sebastian Mohr
7cca07d2c3
Accept lyrics source as a string (#6149)
## Description

Fixes #5962.

The fix was shared in the issue. Now it uses ```as_str_seq``` similarly
to other plugins.
2025-11-07 10:40:35 +01:00
Ratiq Narwal
26a8e164d5 Remove newline character between list points 2025-11-06 18:10:48 -08:00
Ratiq Narwal
f77c03ed90 Remove unnecessary space 2025-11-06 17:58:25 -08:00
Ratiq Narwal
60ad6dc503 Fix changelog formatting 2025-11-06 17:41:21 -08:00
Emi Katagiri-Simpson
0e74605efd
Merge remote-tracking branch 'upstream/master' into dereference-symlinks-while-hardlinking 2025-11-06 20:30:40 -05:00
Ratiq Narwal
a7becf8490 Improve changelog 2025-11-06 17:29:33 -08:00
Ratiq Narwal
e9afe069bc Accept lyrics source as a string 2025-11-06 17:19:27 -08:00
Emi Katagiri-Simpson
86a74970f9
Merge remote-tracking branch 'upstream/master' into HEAD 2025-11-06 20:11:57 -05:00