Commit graph

3658 commits

Author SHA1 Message Date
Šarūnas Nejus
e981fb1aea
Deprecate musicbrainz.enabled configuration 2025-05-17 03:32:00 +01:00
Šarūnas Nejus
874fb3da7b
Add changelog note about musicbrainz 2025-05-17 03:32:00 +01:00
Šarūnas Nejus
7ff73d9747
musicbrainz: set default config in the code 2025-05-17 03:31:59 +01:00
Šarūnas Nejus
736d7d5fd0
Make musicbrainz docs follow the typical style 2025-05-17 03:31:59 +01:00
Šarūnas Nejus
df56bfeec9
Move musicbrainz docs to a separate file 2025-05-17 03:31:59 +01:00
snejus
d487d675b9 Increment version to 2.3.1 2025-05-14 09:53:19 +00:00
Šarūnas Nejus
28781e9077
Pin Poetry version <2 2025-05-14 10:42:07 +01:00
Gavin Tronset
b92a1b3d98
Add beets-filetote to community plugins docs (#5779)
Add link to community plugin
[`beets-filetote`](https://github.com/gtronset/beets-filetote).

This plugin is the spiritual successor to
[beets-copyartifacts](https://github.com/adammillerio/beets-copyartifacts)
(`beets-copyartifacts3` was last updated 3 years ago) and
[beets-extrafiles](https://github.com/Holzhaus/beets-extrafiles) (last
updated 5 years ago).

Given the updates and changes in beets and how outdated those plugins
are, does it make sense to keep `beets-copyartifacts` in the community
plugins list?

---------

Co-authored-by: Sebastian Mohr <39738318+semohr@users.noreply.github.com>
2025-05-13 18:48:43 +02:00
Šarūnas Nejus
de09c3217a
Do not 'legalize' paths by removing everything following a dot
TIL that `with_suffix` does not simply append the suffix to the filename
- it instead replaces the old/current suffix. Or whatever seems to
look like a suffix, in our case, unfortunately...
2025-05-12 09:14:24 +01:00
jwynn6
677204238c
Update pathformat.rst (#5754)
Added explainer about escaping closing braces `$}`
2025-05-11 00:55:55 +00:00
snejus
250b0da900 Increment version to 2.3.0 2025-05-07 22:34:25 +00:00
Aidan Epstein
ecdff785f7
Only output verbose details for parentwork plugin when running explicitly (#5135)
Fixes #4120.
2025-05-04 09:34:37 +02:00
Sebastian Mohr
f878e4da3e
Merge branch 'master' into typehints-plugins 2025-04-15 11:52:08 +02:00
Sebastian Mohr
7e61027366 Added suggestions from code review 2025-04-15 11:49:24 +02:00
Sebastian Mohr
b4a634a443
Allow to pickle db models by removing the current connection. (#5641)
## Description

This might be a quick one, depending on how you feel about it... It
allows you to pickle DB model objects. I don't think this is used
directly in Beets, but it might be useful in general. For instance, we
encountered an issue where we wanted to quickly pickle an Item or Album.
This sometimes worked and other times failed, which seemed quite
inconsistent.

Some DB model methods and properties have the side effect of attaching
an SQLite connection to self (._db), which prevents serialization. The
fix is quite straightforward, so I thought we might want to integrate
this into beets directly.

## To Do

- [x] Changelog
- [x] Tests
2025-04-15 11:43:36 +02:00
Peter Dolan
447cc82e04
Do not write unchanged items to the library in FtInTitle (#5718)
FtInTitle performs a library store operation for every item it
processes, whether or not the item has changed. By limiting the
`item.store()` call to only those cases when the item has changed, the
plugin’s performance when processing an entire library improves by two
to three orders of magnitude.
2025-04-14 18:22:41 +00:00
Šarūnas Nejus
d1d681c1ff
mbsync: support other data sources 2025-04-14 02:28:43 +01:00
Šarūnas Nejus
441cd36e8a
missing: clarify that only musicbrainz backend supports missing albums for artist
And give this functionality a small refactor.
2025-04-14 02:28:43 +01:00
Šarūnas Nejus
4c1f217ce0
missing: support non-musicbrainz data sources 2025-04-14 02:28:42 +01:00
Šarūnas Nejus
f4de44f610 Add plugin prefix in changelog note 2025-04-14 02:19:10 +01:00
Skia
225c21b90f plugins/thumbnails: fix FFI with GIO on s390x
Using the correct function signature for g_file_new_for_path fixes the
tests on s390x.
I do not have the full story on why this failed consistently only on
s390x, but I guess the big endian might have something to play with
this.

Here is how the tests were failing:
```
169s ___________________________ ThumbnailsTest.test_uri ____________________________
169s
169s self = <test.plugins.test_thumbnails.ThumbnailsTest testMethod=test_uri>
169s
169s     def test_uri(self):
169s         gio = GioURI()
169s         if not gio.available:
169s             self.skipTest("GIO library not found")
169s
169s >       assert gio.uri("/foo") == "file:///"  # silent fail
169s E       AssertionError: assert '' == 'file:///'
169s E
169s E         - file:///
169s
169s test/plugins/test_thumbnails.py:268: AssertionError
```
You can see a full log here [1] and a history of consistent failure
here [2]. Both links are bound to expire at some point, sorry future
archeologist 🤷.

[1]: https://autopkgtest.ubuntu.com/results/autopkgtest-plucky/plucky/s390x/b/beets/20250403_162414_5d1da@/log.gz#S5
[2]: https://autopkgtest.ubuntu.com/packages/beets/plucky/s390x
2025-04-14 02:19:10 +01:00
Sebastian Mohr
5a79c6f23e
Merge branch 'master' into typehints-plugins 2025-04-10 11:05:30 +02:00
J0J0 Todos
a79dd3849a lastgenre: Better describe fallback option in docs 2025-04-09 22:52:07 +02:00
J0J0 Todos
13f1bec437 lastgenre: Improve force option definition in docs 2025-04-09 22:52:07 +02:00
J0J0 Todos
68202f3498 lastgenre: Document extended_debug setting 2025-04-09 22:52:07 +02:00
J0J0 Todos
a3ce7c4d70 lastgenre: Format a docs paragraph as "notes box"
unrelated fix in this PR...
2025-04-09 22:52:07 +02:00
Sebastian Mohr
559b87ee56 Updated changelog.
Also edited my previous changelog entry to streamline
typehint entries a bit.
2025-04-08 18:29:54 +02:00
Sebastian Mohr
753bdd9106 Added typehints for _instance, _classes and for class attributes. 2025-04-08 18:15:08 +02:00
racehd
0f2b8b794a Fix Broken link for Arch Linux package 2025-04-08 15:33:43 +02:00
Bob Cotton
670a3bcd17
Add beets-id3extract to community plugins (#5660)
Add link to community plugin beets-id3extract
2025-03-12 07:14:38 +00:00
Allen
b7521f9a0b
fix: plugins/listenbrainz: Fix UnboundLocalError in cases where 'mbid' is not defined (#5651)
Fix ocurrence of `UnboundLocalError` in plugins/listenbrainz >
`get_tracks_from_listens()` when `mbid` is not available.
Removed a print statment.
Fix link to config.yaml.
Fix link to Listenbrainz "get the token" documentation.

Co-authored-by: Šarūnas Nejus <snejus@protonmail.com>
2025-03-12 07:08:53 +00:00
Jack Wilsdon
5c1817c780 Fix IMBackend#compare on ImageMagick 7.1.1-44 2025-02-27 01:03:16 +00:00
Pierre Ayoub
5c8f1c1ee5
Fix convert plugin attempting to process a non-media file (#5261)
## Description

My library is managed using Beets for organization and
[git-annex](https://git-annex.branchable.com/) as storage backend.
Therefore when using this system, while my library files always exists
on my filesystem, some files may be empty (without content). In this
case, when I'm running the `convert` plugin, I don't wants it to process
files which are empty (same apply for any Beets plugin). Hence, I added
a check that the file is readable as a `MediaFile` before doing any
process.

Before this fix, trying to encode an empty file would have lead to an
error while leaving `convert` doing its side-effects **and** `convert`
would also copy empty files to destination for files that doesn't need
to be re-encoded.

In my case, this is empty files, but the problem can be anything else
(depending on the storage backend) and/or corrupted files. Conclusion, I
think **checking that the file is readable is always recommended before
proceeding to heavy operation** like this.
2025-02-20 16:23:14 +00:00
Šarūnas Nejus
7893766e4c
Improve flags structure and add tests 2025-02-20 03:47:04 +00:00
Šarūnas Nejus
c95156adcd
Refactor writing rest files 2025-02-20 03:47:04 +00:00
Šarūnas Nejus
d7201062a8
Resurrect translation functionality 2025-02-20 03:47:04 +00:00
Sebastian Mohr
918fd863f3
Merge branch 'master' into importer-typehints-and-refactor 2025-02-17 23:02:00 +01:00
Sebastian Mohr
115b502353
Merge branch 'master' into importer-typehints-and-refactor 2025-02-17 21:33:57 +01:00
J0J0 Todos
2286511ebe
Merge branch 'master' into smartplaylist-attr-url-encoding 2025-02-17 21:16:09 +01:00
Šarūnas Nejus
5a9c769f5c
Link to specific bug report/feature request templates in docs 2025-02-16 23:41:00 +00:00
Sebastian Mohr
10e52c68c9
Merge branch 'master' into importer-typehints-and-refactor 2025-02-10 11:43:05 +01:00
seth-milojevic
6205e19b74
Update docs/changelog.rst
Co-authored-by: Šarūnas Nejus <snejus@protonmail.com>
2025-02-08 12:41:37 -05:00
seth-milojevic
12fa3432a9 Close file descriptor generated from tempfile.mkstemp()
Without explicitly closing this file descriptor, the temp file would be kept open until the program exited and could not be deleted by the fetchart plugin.
2025-02-08 01:03:20 -05:00
Sebastian Mohr
12b21c48e9 Changelog addition 2025-02-07 16:55:26 +01:00
Max Goltzsche
5d96509cfe
smartplaylist: change encoding of additional field
URL-encode additional item `fields` within generated EXTM3U playlists instead of JSON-encoding them.
This is because JSON-encoding additional fields/attributes made it difficult to parse the `EXTINF` line but using URL-encoding for these values makes parsing easy (because URL-encoded values cannot contain commas, quotation marks and spaces).

I introduced the generation of additional EXTM3U item fields earlier this year and I want to correct that now.

**Design/definition background:**
Unfortunately, I didn't find a clear definition of how additional playlist item attributes should be encoded - apparently there is none.
Given that item URIs within an M3U playlist can be URL-encoded already, defining the values of additional attributes to be URL-encoded is consistent design.
I didn't find examples of additional EXTM3U item attributes in the web where the attribute value contains a comma, space or quotation mark but examples that specified numeric IDs and URLs as attribute values.
Because the URL attribute examples I found didn't contain URL-encoded characters and because it is more readable and unproblematic for parsing, I've let the attribute URL encoding treat `:` and `/` as safe characters.

**Breaking change:**
While this is a breaking change in theory, in practice it is not since afaik all integrations of the smartplaylist plugin's additional EXTM3U item attribute generation feature (beets-webm3u) work with simple attribute values such as the item ID (numeric) whose formatting/encoding is not affected when changing from JSON to URL-encoding.
In other words the change is backward-compatible with the beets-webm3u plugin (which I'll adjust correspondingly after this beets PR was merged).
2025-02-01 01:14:27 +01:00
Šarūnas Nejus
89f1ef4d2f
Add documentation links 2025-01-30 12:20:11 +00:00
Šarūnas Nejus
916d40f86f
Remove outdated namespace package definition and update docs
See https://realpython.com/python-namespace-package.

This setup is backwards-compatible, so plugins using the old
pkgutil-based setup will continue working fine.

This setup has an advantage where external plugins will now be able to
import modules from 'beetsplug' package for typing purposes. Previously,
mypy could not resolve these modules due to presence of `__init__.py`.
2025-01-30 12:20:11 +00:00
Šarūnas Nejus
745c5eb9f0
Genius: refactor and simplify 2025-01-27 10:56:52 +00:00
Šarūnas Nejus
c40db1034a
Make lyrics plugin documentation slightly more clear 2025-01-27 08:50:49 +00:00
Šarūnas Nejus
2ff57505d8
Apply dist_thresh to Genius and Google backends
This commit introduces a distance threshold mechanism for the Genius and
Google backends.

- Create a new `SearchBackend` base class with a method `check_match`
  that performs checking.
- Start using undocumented `dist_thresh` configuration option for good,
  and mention it in the docs. This controls the maximum allowable
  distance for matching artist and title names.

These changes aim to improve the accuracy of lyrics matching, especially
when there are slight variations in artist or title names, see #4791.
2025-01-27 08:50:48 +00:00