Commit graph

13088 commits

Author SHA1 Message Date
Šarūnas Nejus
01e2eb4665
Add default config yaml to each data source docs 2025-10-10 20:36:33 +01:00
Šarūnas Nejus
203c2176d9
Update data_source_penalty docs 2025-10-10 20:36:33 +01:00
Šarūnas Nejus
e6084cd3ee
Set default data_source_penalty to 0.0 2025-10-10 20:36:33 +01:00
Šarūnas Nejus
60e0efb8ea
Make naming consistent with the field name 2025-10-10 20:36:33 +01:00
Šarūnas Nejus
6e5af90abb
Rename source_weight -> data_source_mismatch_penalty 2025-10-10 20:36:33 +01:00
Šarūnas Nejus
c2ab93a946
Remove redundant source_weight defaults 2025-10-10 20:36:33 +01:00
Šarūnas Nejus
fe98841e72
Refresh flexible MusicBrainz metadata on reimport (#6064)
Fixes #6036

- [x] Changelog. (Add an entry to `docs/changelog.rst` to the bottom of
one of the lists near the top of the document.)
2025-10-09 09:58:55 +01:00
Alok Saboo
92a2233e0d remove releasegroup_id 2025-10-08 09:59:07 -04:00
Alok Saboo
79494b809d Merge remote-tracking branch 'upstream/master' into mb_fix 2025-10-07 20:01:27 -04:00
Alok Saboo
87874952fa Refactor reimport fresh fields: consolidate REIMPORT_FRESH_FIELDS_ITEM and REIMPORT_FRESH_FIELDS_ALBUM definitions 2025-10-07 19:56:39 -04:00
Šarūnas Nejus
d4a0c02ca3
fromfilename plugin: proposed fix for #5218, some improvements (#5311)
### b5216a0 is a proposed fix for #5218

We don't assume anymore that if the pattern lacks the "artist" group it
also has the "title" group (this was causing the "title" KeyError, when
the pattern containg only the `?P<track>` group is used).
Instead, we check for existence of "title" before assigning
"title_field", otherwise we let the last pattern (which will always
match) to assign it. The only slight drawback is that files like
"01.mp3" will also get "01" as title (besides the "1" track number),
instead of having no title, but I guess that is not going to cause any
major problem in the rest of the import procedure (e.g. track matching
after a search). On the other hand, I guess allowing a file to have no
title would require a substantial rewriting of the plugin, since the
empty string is in BAD_TITLE_PATTERNS.

### 0966042 adds a log message about the pattern being tried
This is useful while debugging changes to the regexps in PATTERNS.
I used loglevel "debug" for this message, should we use "debug" also for
other messages (currently using level "info")?

### e6b7735 refactors the regexps in PATTERNS

I reviewed the regexps (especially after the changes I made some time
ago in 84cf336) and tried to make them cleaner.
- Allow " - " and "-" as separator between track/artist/title fields:
that should cover two common filename conventions: using spaces (e.g.
`01 - Artist Name - Title of the song`) or not using spaces (e.g.
`01-artist_name-title_of_the_song`). Some regexp groups are non-greedy,
to avoid capturing unwanted leading/trailing spaces in artist/titles; we
could think about some other enhancements, e.g. automatically converting
underscores to spaces in artist/title names, but I guess the main use of
the plugin is not to produce a perfectly formatted title, but a
sufficient meaningful one to be used as reference in the following
stages of the update procedure.
- Allow `?P<tag>` groups by making them optional in the first two
patterns (instead of having two versions of the pattern, with or without
tag). BTW I'm not sure what these groups are about: we optionally check
for them in the plugin, but we never use them to assign any metadata.
- Allow optional "." after the track number
- In the third pattern: also allow "_" as separator (e.g. for file names
like `01_some_tack.mp3`)
2025-10-07 23:39:48 +01:00
Alok Saboo
6c06f2a77e Merge remote-tracking branch 'upstream/master' into mb_fix 2025-10-07 18:08:00 -04:00
Alok Saboo
c59aff9e27 Added the MusicBrainz flex fields directly to the importer 2025-10-07 18:02:04 -04:00
Alok Saboo
c5f5ffc027 Added releasegroup_id to _MB_REIMPORT_FRESH_FIELDS_ITEM list 2025-10-06 10:55:49 -04:00
J0J0 Todos
152cafbf69 fromfilename: Fix tiny changelog formatting issue 2025-10-06 11:35:55 +02:00
J0J0 Todos
a642609faa
Merge branch 'master' into ffnp 2025-10-06 11:06:10 +02:00
Sebastian Mohr
08d9f34df5
Discogs: artist name variation support + artist credit support. (#6050)
Implements #3354, updates #6040. This PR also improves typehints for the discogs plugin.

The name variations provided by Discogs can now be used by the
auto-tagger through 3 config options.
By default, the plugin will write the variation to the tag
`artist_credit`, but through three config options can also write it
to the album artist tag, the track's artist tag, or any combination of
the three.

This PR contains a small addition on #6040, letting the string used to
join featured artists be customized.

The new configuration options available, and their defaults, are as
follows:

```yaml
discogs:
  featured_string: "Feat."
  anv:
    artist_credit: True
    album_artist: False
    artist: False
```
2025-10-05 12:54:31 +02:00
henry
90120e451d
Merge branch 'master' into discogs-anv-support 2025-10-04 12:00:51 -07: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
J0J0 Todos
347802afea
fix spacing for "finding tags for" prompt (#6067) 2025-10-04 01:06:56 +02: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
MinchinWeb
033e613016 fix spacing for "finding tags for" prompt 2025-10-03 14:48:56 -06:00
Alok Saboo
20820fdb14 update imports 2025-10-02 08:31:30 -04:00
Alok Saboo
93c8950bf4 Extends the importer’s “fresh on reimport” lists so album flex metadata from new releases replaces stale values 2025-10-02 08:24:01 -04:00
Sebastian Mohr
e12020abb8
Spotify: Store track attributes even if audio features are missing (#6062)
Fixes #6061
2025-10-02 12:05:43 +02:00
Alok Saboo
b66b2b51b5 Remove potentially expensive item.get() calls 2025-10-01 17:48:41 -04:00
Alok Saboo
7a097bb4b6 lint 2025-10-01 17:47:26 -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
f6ca68319d
Add git commit suffix to __version__ for development installs (#5967)
Make it obvious when beets is installed from from a non
major version. When installed locally this adds a git hash suffix and
the distance to the last release.

closes #4448
2025-10-01 12:58:57 +02: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
fcebe8123a Expand documentation 2025-09-30 20:01:35 -07: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
b8ae222dc4 Mention tests in changelog entry. 2025-09-30 16:04:59 +02:00
Vrihub
638afc3d2c Refactor tests using pytest 2025-09-30 15:54:33 +02:00
Vrihub
80ffa4879d Improve regexp and module docstring 2025-09-30 15:46:26 +02:00
Sebastian Mohr
b06f3f6aa6
Improved beets/logging.py typing (#6032)
This PR enhances `beets/logging.py` with improved typing and tests:

* `getLogger` now returns the precise logger type (`BeetsLogger` or
`RootLogger`).
* Tests use `pytest` and `parametrize` for more concise and readable
coverage.
2025-09-30 13:47:08 +02:00
Sebastian Mohr
89c2e10680 Removed typealias, worked locally with mypy but does seem to cause
issues with the ci. Also python 3.9 requires unions here...
2025-09-30 13:39:49 +02:00
Sebastian Mohr
837295e250 Added typehints from typeshed and removed default argument. 2025-09-30 13:37:51 +02:00
Sebastian Mohr
caebf185f1 Removed unused ParamSpec and added a consistency check in the tests. 2025-09-30 13:37:51 +02:00
Sebastian Mohr
b2fc007480 Fixed plugin typehints: use actual logger class. 2025-09-30 13:37:51 +02:00
Sebastian Mohr
f637e5efbb Added overload to getLogger function. Added changelog entry
and added myself to codeowners file.
2025-09-30 13:37:51 +02:00
Sebastian Mohr
461bc049a0 Enhanced custom logger typing and logging tests 2025-09-30 13:37:51 +02:00
Šarūnas Nejus
689ec1022f
Fix plugin loading (#6039)
Fixes #6033

This PR addresses a bug where plugin loading failed when plugins
imported other `BeetsPlugin` classes, namely `chroma` and `bpsync`.

- Add module path filtering to ensure only classes from the target
plugin module are considered, preventing conflicts when plugins import
other `BeetsPlugin` classes
2025-09-29 11:47:16 +01:00
Šarūnas Nejus
7954671c73
Mock DummyPlugin properly 2025-09-29 11:39:16 +01:00
Šarūnas Nejus
c34b2a00a4
Fix plugin loading 2025-09-29 11:39:15 +01:00