Commit Graph
3630 Commits
Author SHA1 Message Date
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
AllenandŠarūnas Nejus 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-milojevicandŠarūnas Nejus 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
Šarūnas Nejus 71eb1bca68 Release: create tag right after commit version update 2024-12-10 05:51:13 +00:00
Šarūnas Nejus ed3a53f2fe Exclude plugin tests, include all files from MANIFEST.in 2024-12-10 05:51:09 +00:00
Edgars Supe 09360259cc lyrics: Fallback to plain lyrics if synced not available 2024-12-07 19:08:37 +02:00
RollingStar 40987902df Update main.rst 2024-12-04 19:56:57 -05:00
RollingStar eafae03560 Merge branch 'beetbox:master' into arm-info 2024-12-04 19:56:26 -05:00
snejus f92c0ec8b1 Increment version to 2.2.0 2024-12-02 06:56:49 +00:00