Commit graph

3636 commits

Author SHA1 Message Date
Š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
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
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
J0J0 Todos
6161b449f6 Apply config-sanity-check suggestion in docs 2025-01-24 11:43:10 +01:00
Ashleigh
1ae4677d93 Added a quick checkpoint to ensure the config file is set up correctly prior to users importing their music library 2025-01-24 11:43:10 +01:00
J0J0 Todos
346071c04a Add missing changelog for #4982 2025-01-24 10:44:18 +01:00
J0J0 Todos
9d4653f92f Final lastgenre docstring nitpicks
and a tiny docs fix.
2025-01-23 09:04:06 +01:00
J0J0 Todos
4e8948d7ca Rework new & refine existing lastgenre docs chapters
and describe according to new defaults: force and keep_existing
DISABLED, ensuring failsafe operation out of the box.
2025-01-21 17:04:03 +01:00
J0J0 Todos
a49f12b110 Final lastgenre docs changes 2025-01-21 17:04:02 +01:00
J0J0 Todos
998f2f8984 Rewrite docs for keep_allowed/existing change 2025-01-21 17:04:02 +01:00
J0J0 Todos
40760a0621 Docs for lastgenre keep_allowed/force
Keep both options' "Configuration" chapter texts as compact as possible,
while linking to a new chapter that describes all 4 possible
combinations in detail.
2025-01-21 17:04:02 +01:00
Šarūnas Nejus
618c3a21a6
Try to GET LRCLib lyrics before searching 2025-01-19 18:39:54 +00:00
Šarūnas Nejus
30379bca38
Update lyrics.sources configuration to prioritize lrclib 2025-01-19 15:19:44 +00:00
Šarūnas Nejus
8d4a569291
Fix fetching lyrics from lrclib
Adjust the base URL to perform a '/search' instead of attempting to
'/get' specific lyrics where we're unlikely to find lyrics for the
specific combination of album, artist, track names and the duration (see
https://lrclib.net/docs).

Since we receive an array of matching lyrics candidates, rank them by
their duration similarity to the item's duration, and whether they
contain synced lyrics.
2025-01-19 15:19:41 +00:00
Šarūnas Nejus
0a12d07a94
Do not attempt to fetch lyrics with empty data
Modified `search_pairs` function in `lyrics.py` to:

* Firstly strip each of `artist`, `artist_sort` and `title` fields
* Only generate alternatives if both `artist` and `title` are not empty
* Ensure that `artist_sort` is not empty and not equal to artist (ignoring
  case) before appending it to the artists

Extended tests to cover the changes.
2025-01-19 01:48:04 +00:00
Šarūnas Nejus
b9bc2cbc04
lyrics: isolate test configuration
(#5102) Refactor lyrics tests which depended on local developer beets
configuration.
2025-01-19 01:33:14 +00:00
Šarūnas Nejus
d22c497dc0
Use table-qualified names in any field query
In order to include the table name for fields in this query, use the
`field_query` method.

Since `AnyFieldQuery` is just an `OrQuery` under the hood, remove it and
construct `OrQuery` explicitly instead.
2025-01-19 01:09:11 +00:00
Šarūnas Nejus
a1e85727f5
Enable colors in the docs 2025-01-19 00:30:47 +00:00
Šarūnas Nejus
64b3481235
Take into account Sphinx updates in docs and release script 2025-01-12 04:50:45 +00:00
J0J0 Todos
55c0f7ad4c Changelog for PR #5582 2025-01-08 08:41:57 +01:00
valrus
723e928d79 Add changelog item 2024-12-29 08:08:25 -08:00
valrus
1af9df2b40 add another benefit of item_types 2024-12-29 08:04:50 -08:00
Šarūnas Nejus
420117b598
Track assignment: replace munkres with lapjv
See the following comparison between several implementations to solve
this problem: https://github.com/berhane/LAP-solvers
2024-12-27 10:16:28 +00:00
Šarūnas Nejus
550a9a82b1
Fix mb_artistid, mb_albumartistid, albumtype diff issue 2024-12-14 21:39:47 +00:00
Šarūnas Nejus
7be8f9c97a
Update CI config, minimum ruff version, docs and add changelog note 2024-12-10 06:10:03 +00:00