Commit graph

12983 commits

Author SHA1 Message Date
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
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
Šarūnas Nejus
4e865a6def
Discogs featured artist fix (#6040)
Fixes #6038 - Appends featured artists in the extraartists field to the
artist tag, similar to the MusicBrainz plugin. Works well with ftintitle
for consistency as well.

## To Do

May need adjustment for common artist delimiters used - but appears to
match the MusicBrainz standard at the moment.
2025-09-27 18:59:32 +01:00
Henry
85201a4e17 merge with master branch 2025-09-27 08:04:53 -07:00
Šarūnas Nejus
bc9d34ed98
Fix for Spotify Candidate Lookup. Changed query from double to single quotes. (#6049)
I noticed that spotify did not return any candidates for some of my
examples, but adding the search id manually would give a very good
match. I debugged it a bit and it seems like spotify does not like
double quotes we used for the search query.

Using single quotes fixed it for me.

Note that this does not seem to be documented in the [spotify api
documentation](https://developer.spotify.com/documentation/web-api/reference/search)

The example I used:

```
# Query with double quotes, which does not return any candidates
# Searching Spotify for 'album:"Flamethrower" artist:"Circadian, Cody Frost"'
https://api.spotify.com/v1/search?offset=0&limit=50&query=album%3A%22Flamethrower%22%20artist%3A%22Circadian%2C%20Cody%20Frost%22&type=album


# New Query
# Searching Spotify for 'album:'Flamethrower' artist:'Circadian, Cody Frost''
https://api.spotify.com/v1/search?offset=0&limit=5&query=album%3A%27Flamethrower%27%20artist%3A%27Circadian%2C%20Cody%20Frost%27&type=album
```
2025-09-27 13:34:20 +01:00
pSpitzner
cc0024e089 Spotify tests are now consistent with quote change 2025-09-27 13:22:41 +02:00
pSpitzner
a0a0a094d3 Changed query from double to single quotes. 2025-09-27 13:06:12 +02:00
Henry
751919e9f9 merge with upstream 2025-09-25 08:47:27 -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
Šarūnas Nejus
64c94f61b7
Metadata option (#6041)
My usecase needs the `convert` to not write tags so I can write my own
APEv2 tags. This PR adds a write_metadata option to disable the
`convert` plugin writing metadata to the converted files.
2025-09-25 03:34:58 +01:00
Multipixelone
699e0a1272 fixup! add documentation for write_metadata option 2025-09-24 22:11:47 -04:00
Finn
29f55f9911
Merge branch 'master' into metadata_option 2025-09-24 22:02:28 -04:00
Multipixelone
98170f6c04 add documentation for write_metadata option 2025-09-24 21:52:57 -04:00
Finn
61b632f2b4 Add option to not write metadata 2025-09-24 21:52:57 -04:00
Henry
6aba11d4a0 testing, updated changelog 2025-09-23 11:05:48 -07:00
Henry
2bf411e77d Featured artists extracted and appended, need to see if join needs to be variable 2025-09-23 10:11:13 -07:00
Henry
84e52e1b4a Test written, beginning fix 2025-09-22 20:49:53 -07:00
Šarūnas Nejus
5e0e898429
Discogs Label Disambiguation Fix + config option. (#6035)
Fixes #5366 . 

Adds removal of disambiguation from label names, in addition this PR
moves the Discogs disambiguation function out of the
MetadataSourcePlugin, and puts it in the Discogs plugin, keeping the
parent class more generic.

A config option has been added to allow disabling Discogs disambiguation
removal. Tests and docs are written for the feature, and shows no side
effects in other plugins that rely on the MetadataSourcePlugin.
2025-09-22 21:55:47 +01:00
Šarūnas Nejus
787d9b4a40
Merge branch 'master' into discogs-disambiguation-fix 2025-09-22 21:50:34 +01:00
Henry Oberholtzer
8e644157e8 Refactor tests, adjust changelog, move config option to new features. 2025-09-22 19:47:50 +02:00
Šarūnas Nejus
a12ca093cb
feat(FtInTitle): Support tracks by artists != album artist (#5943)
I have different expectations around this [FtInTitle test
case](fcc9341360/test/plugins/test_ftintitle.py (L147-L151)),
which represents a song on an album by a **guest artist featuring a
third artist**:

```
{
    "artist": "Alice ft. Carol",
    "album_artist": "Bob",
    "feat_part": None,
},
```

If this were Alice's album, the plugin would process the track, moving
`Carol` to the `feat_part` and changing the `artist` to `Alice`. But
because it's Bob's album, nothing happens. I don't want `Alice ft.
Carol` as an artist on Bob's album any more than I want it on Alice's
though 😭

This may be a bit of a corner case but it does happen reasonably often
in the wild:

```
Album: Flying Lotus - ASH (OST) (2025)
Track 26: Kuedo feat. Miguel Atwood-Ferguson - WHAT'S WRONG PEACH?
```

More commonly, this case applies to __compilation albums which use
`Various Artists` as an albumartist__.

Processing doesn't occur on these tracks in the current implementation
because of how
[`find_feat_part()`](fcc9341360/beetsplug/ftintitle.py (L57-L82))
kicks off:

```
# Look for the album artist in the artist field. If it's not present, give up.
albumartist_split = artist.split(albumartist, 1)
if len(albumartist_split) <= 1:
    return None
```

As best I can tell, the code is setup this way to enable parsing of more
complex cases , like a song by `Hall & Oates` on an Oates album, which
is pretty clever. But giving up in cases where albumartist isn't in the
artist field seems premature when a reasonable parsing method exists
that doesn't require it.

So this PR proposes modifications to code and tests that enables
FtInTitle to process items whose artist doesn't contain the albumartist.
It seems like what someone loading a `FtInTitle` plugin would want by
default, but if that's a contentious take then I'm happy to put it
behind a config flag.

Thanks for your consideration!
2025-09-21 22:33:19 +01:00
Trey Turner
042b5d64eb test(ftintitle): fix flake, massage mypy 2025-09-21 22:27:11 +01:00
Trey Turner
6ad7c5489c test(ftintitle): parameterize tests 2025-09-21 22:27:11 +01:00
Trey Turner
f0a6059685 feat(FtInTitle): support tracks by artists != album artist 2025-09-21 22:27:11 +01:00
Šarūnas Nejus
159f43cf46
Update missing plugin configuration options and formatting details (#6025)
Missing plugin documentation was not right. The `format` option does not
work. Updated it to reflect the use of global album and item format.
2025-09-21 19:54:05 +01:00
Alok Saboo
de4494a5b1 lint 2025-09-21 19:46:31 +01:00
Alok Saboo
76c049938c Update missing plugin configuration options and formatting details 2025-09-21 19:46:31 +01:00
henry
e577df0f25
Merge branch 'master' into discogs-disambiguation-fix 2025-09-21 09:34:12 -07:00
Henry
92579b30d8 Reformat docs 2025-09-21 09:25:30 -07:00
Henry
ba46724c7f Fix changelog conflict 2025-09-21 08:07:33 -07:00
Sebastian Mohr
c991b14e7d fix test by changing patch 2025-09-21 08:04:51 -07:00
Sebastian Mohr
f4691c85e9 Added changelog and git blame ignore rev 2025-09-21 08:04:11 -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