Commit graph

3902 commits

Author SHA1 Message Date
Šarūnas Nejus
f816f894d3
Use default red/green for case differences 2025-09-13 11:24:56 +01:00
Šarūnas Nejus
0818505334
Fix diff coloring for added and removed text in field diffs
- Update default `text_diff_added` value: red -> green
- Use `text_diff_removed` and `text_diff_added` instead of `text_error`
  in UI
2025-09-13 11:24:55 +01:00
Šarūnas Nejus
e7c12988bc
Remove unused colors 2025-09-13 11:24:44 +01:00
J0J0 Todos
d24a85121b Changelog for #5977 lastgenre whitelist/tree 2025-09-13 09:30:20 +02:00
J0J0 Todos
856bde1efb Changelog for #5979 lastgenre move file loading 2025-09-10 07:36:47 +02:00
Sebastian Mohr
e51de5de91 Removed data source as listenbrainz is not an metadata source plugin.
closes #5975
2025-09-04 17:41:12 +02:00
Šarūnas Nejus
4cb667cbb3
Fix formatting issues 2025-09-04 12:49:48 +01:00
Šarūnas Nejus
f8a98ac518
Add index for API Reference 2025-09-04 12:49:48 +01:00
Šarūnas Nejus
33feb0348d
Define replacements for commonly used classes 2025-09-04 12:49:47 +01:00
Sebastian Mohr
09da8a2991
- Updated git blame ignore with new hashes
- run docstrfmt
2025-09-04 12:49:47 +01:00
J0J0 Todos
fddda507ea
docs: Reveal 3 nav levels in primary sidebar
and also allow a max level of 3 to expand.
2025-09-04 12:49:46 +01:00
J0J0 Todos
33f1a5d0be
docs: Split Further Reading chapter to files
to make it viewable in the primary sidebar instead of the secondary.
2025-09-04 12:49:46 +01:00
Sebastian Mohr
1c6921758c
Capitalization and some more minor adjustments. Updated docstrfmt. 2025-09-04 12:49:46 +01:00
Sebastian Mohr
db9a587492
Replaced named citations with number, seems to work for some reason. 2025-09-04 12:49:45 +01:00
Sebastian Mohr
4a8cabdaeb
Use rubric instead of list table. 2025-09-04 12:49:45 +01:00
Sebastian Mohr
dee906e1ae
Minor formatting issues. 2025-09-04 12:49:45 +01:00
Sebastian Mohr
037e59fe8f
Created autotagger file and enhanced the docs significantly. 2025-09-04 12:49:45 +01:00
Sebastian Mohr
676dc9c953
Replaced writing-plugins with basic-plugin-setup. 2025-09-04 12:49:44 +01:00
Sebastian Mohr
0dcd7caa9d
writing plugins label 2025-09-04 12:49:44 +01:00
Sebastian Mohr
83eda27051
Update docstrfmt 2025-09-04 12:49:44 +01:00
Sebastian Mohr
d6e3548d4a
Formatting commands 2025-09-04 12:49:43 +01:00
Sebastian Mohr
1dfd232270
further reading formatting and changed extending the autotagger to
conform to new metadatasource plugin.
2025-09-04 12:49:43 +01:00
Sebastian Mohr
6627a0740c
Changed events doc list to table. Added references to api. 2025-09-04 12:49:43 +01:00
Sebastian Mohr
35ea9a7011
Enhanced index, changed wording slightly 2025-09-04 12:49:43 +01:00
Sebastian Mohr
69b47b3071
A number of smaller additions. 2025-09-04 12:49:43 +01:00
Sebastian Mohr
07549ed896
Moved plugin docs into folder. 2025-09-04 12:49:42 +01:00
Šarūnas Nejus
a674fd3095
musicbrainz: Rename searchlimit config option to search_limit 2025-08-31 18:48:46 +01:00
Šarūnas Nejus
d00d51e0bf
Add configurable search_limit to Spotify and Deezer plugins 2025-08-31 18:48:46 +01:00
Šarūnas Nejus
9352a79e41
Replace percent formatting 2025-08-30 22:35:00 +01:00
Sebastian Mohr
279c828369 run docstrfmt 2025-08-26 13:41:11 +02:00
Sebastian Mohr
f81684e188 Moved construct search into SearchApiMetadataSource to dedupe some
deezer and spotify functionalities.
2025-08-26 13:41:11 +02:00
Šarūnas Nejus
e603c2f08e
Merge branch 'master' into chroma-timeout 2025-08-25 23:37:41 +01:00
Luccoli
535fcfdbe7 docs: update discogs.rst - add default of index_tracks configuration 2025-08-25 19:14:12 +01:00
Ryan Waskiewicz
6408b5e280
Add 'pretend' flag to update command example
Add `p` as an acceptable flag for the `update` command to match the long form section of the command's docs
2025-08-24 09:04:21 -04:00
J0J0 Todos
efa968175b Changelog for #5946 2025-08-24 09:20:36 +02:00
J0J0 Todos
a1efd2836a lastgenre: Clarify keep-existing precedence in docs 2025-08-24 09:20:36 +02:00
Sebastian Mohr
5c7d49e24e Quick docfmt. 2025-08-22 11:30:47 +02:00
Hendrik Boll
6dfde732b0 readme: add void linux 2025-08-22 11:29:35 +02:00
Šarūnas Nejus
c0675fefb8
Merge branch 'master' into multivalued-flexible-fields 2025-08-19 13:39:34 +01:00
Rebecca Turner
1786adfff1 chroma: set a default timeout of 10 seconds
TODO: Configurable timeouts :)
2025-08-10 23:14:20 -07:00
Šarūnas Nejus
ab5acaabb3
Reformat all docs using docstrfmt 2025-08-10 16:25:05 +01:00
Šarūnas Nejus
769dcdc88a
Docs: fix linting issues 2025-08-10 16:16:02 +01:00
Šarūnas Nejus
54b31d01e9
Use only plugins/disabled_plugins config in plugin loading 2025-08-09 15:11:58 +01:00
Šarūnas Nejus
52bdb58a46
Simplify plugin loading mechanism
Centralise plugin loading in `beets.plugins` and refactor the plugin
loading system to be more straightforward and eliminate complex mocking
in tests. Replace the two-stage class collection and instantiation
process with direct instance creation and storage.

Add plugins.PluginImportError and adjust plugin import tests to only
complain about plugin import issues.
2025-08-09 15:06:06 +01:00
Sebastian Mohr
c2d1bc3aaf
Add py.typed marker file to support PEP 561 typing (#5906)
Add `py.typed` marker file to support PEP 561 typing

This PR adds a `py.typed` marker file to the package directory to
indicate that the package includes inline type hints and is PEP 561
compliant.
2025-08-09 13:31:55 +02:00
Sebastian Mohr
3c6dab57e9 Changelog update. 2025-08-09 13:17:27 +02:00
Šarūnas Nejus
9e4559b8e9
Merge branch 'master' into discogs-404 2025-08-08 21:57:46 +01:00
Rebecca Turner
0430bd383a discogs: don't crash if a release is deleted 2025-08-07 20:25:09 -07:00
Sebastian Mohr
63eefa61b3 Update changelog. 2025-08-04 11:20:33 +02:00
Šarūnas Nejus
44af7b24e5
Merge branch 'master' into feature/add-artist-to-item-entry-template 2025-08-02 22:39:59 +01:00
Martin Atukunda
034e608a4f
Update changelog.rst
remove duplicate changelog entry
2025-08-02 14:21:37 +03:00
Šarūnas Nejus
c2a8651b68
Deprecate decargs 2025-08-02 10:42:51 +01:00
Šarūnas Nejus
ebc0709c40
Deprecate beets.autotag.Distance beets.autotag.current_metadata 2025-08-02 10:42:51 +01:00
Šarūnas Nejus
3dd18dc3be
Bring back and deprecate queries and types imports from beets.library 2025-08-02 10:42:51 +01:00
Martin Atukunda
dc789485be
Merge branch 'master' into feature/add-artist-to-item-entry-template 2025-07-31 13:19:07 +03:00
Damon McDougall
268075063f Use python3 print in plugins.rst 2025-07-29 10:06:30 +02:00
Martin Atukunda
5043dcc78d
Move change log note to the New features
After some guidance from @snejus this is the proper place to place the
change log entries, not inside the New features section of _released_
versions.
2025-07-18 00:31:08 +03:00
Martin Atukunda
4a7e474efc
Merge branch 'master' into feature/add-artist-to-item-entry-template 2025-07-18 00:25:42 +03:00
Maxr1998
55ef006b3e
Add changelog entry 2025-07-16 21:41:50 +02:00
Sebastian Mohr
0f085fb91b Updated changelog 2025-07-15 15:03:14 +02:00
Sebastian Mohr
5cd6a39a01 Edited changelog and fixed an issue with plugin loading. 2025-07-15 15:03:14 +02:00
Sebastian Mohr
29b77cfbd4 Added changelog entry. 2025-07-15 15:03:14 +02:00
Martin Atukunda
8126eaa0fa
Merge branch 'master' into feature/add-artist-to-item-entry-template 2025-07-15 13:58:25 +03:00
Martin Atukunda
d476af8ecd
Move change log note to the New features
After some guidance from @snejus this is the proper place to place the
change log entries, not inside the New features section of _released_
versions.
2025-07-15 13:55:49 +03:00
54562474
48d45b4df7 feat: mpdstats: add config option for played ratio threshold to determine if a
track was played or skipped.
2025-07-09 14:16:23 -06:00
Sebastian Mohr
e6016c125b Added changelog entry. 2025-07-08 11:38:12 +02:00
Nicolas Mémeint
eb497eee1a Only consider release collections in mbcollection plugin 2025-07-07 13:25:25 +02:00
Martin Atukunda
a64acf8aa2
Merge branch 'master' into feature/add-artist-to-item-entry-template 2025-07-07 09:35:15 +03:00
J0J0 Todos
257991c73d playlist: Changelog for #5829 2025-07-07 08:05:45 +02:00
Martin Atukunda
b96f7a5068
move changelog note to the Unreleased section 2025-07-07 08:34:12 +03:00
Martin Atukunda
8ea7346575
Merge branch 'master' into feature/add-artist-to-item-entry-template 2025-07-06 12:14:48 +03:00
J0J0 Todos
7c22cd635c duplicates: Add changelog for --remove option 2025-07-05 07:24:26 +02:00
J0J0 Todos
549847bfd8 duplicates: Add docs for --remove option 2025-07-05 07:22:28 +02:00
Noor
ac96b9b64e
Preserve line breaks for example cases in substitution plugin docs (#5846)
## Description

Adds line block markup to example substitutions in the plugin
documentation, so that each case is shown on a separate line:

> The replacement can be an expression utilising the matched regex,
allowing us to create more general rules. Say for example, we want to
sort all albums by multiple artists into the directory of the first
artist. We can thus capture everything before the first ,, `` &`` or ``
and``, and use this capture group in the output, discarding the rest of
the string.
> 
> ```yaml
> substitute:
>  ^(.*?)(,| &| and).*: \1
> ```
>
> This would handle all the below cases in a single rule:
>
>> Bob Dylan and The Band -> Bob Dylan
>> Neil Young & Crazy Horse -> Neil Young
>> James Yorkston, Nina Persson & The Second Hand Orchestra -> James
Yorkston
2025-07-02 18:40:37 +00:00
dhruvravii
dd6cb538ac
Fix: Spotify plugin unable to recognize Chinese and Japanese albums. (#5705)
Fixes an issue where each spotify query was converted to ascii before sending. Adds a 
new config option to enable legacy behaviour.

A file called japanese_track_request.json was made to mimic the Spotify
API response since I don't have the credentials. Entries in that will
need to be modified with the actual entries.

Co-authored-by: Sebastian Mohr <sebastian@mohrenclan.de>
Co-authored-by: Sebastian Mohr <39738318+semohr@users.noreply.github.com>
Co-authored-by: J0J0 Todos <2733783+JOJ0@users.noreply.github.com>
2025-07-01 11:08:54 +02:00
Nicolas Mémeint
4893cee5e5 Fix the MusicBrainz search not taking into account the album/recording aliases 2025-06-15 21:33:20 +01:00
Ben Stolovitz
2f98f11d57 fix local langdetect test failures
avoid linter error

avoid other linter error

fix format

changing deps (no lock!)

poetry lock?

lint & format

attempt 2 at poetry lock

crlf -> lf line endings

changelog!
2025-05-31 18:56:21 -04:00
Ian McCowan
0f76312f31
Fix duplicate database change event send on Library.add (#5561)
## Description

Fixes #5560. Also a couple other incidental changes / improvements:
* Add `EventType` that holds the actual string literals used for event
sending. With type checking, this can prevent subtle bugs resulting from
misspelled event names.
* Fix `HiddenFileTest` by using `bytestring_path()`

## To Do

- [x] ~Documentation.~
- [x] Changelog.
- [x] Tests.

---------

Co-authored-by: J0J0 Todos <jojo@peek-a-boo.at>
Co-authored-by: J0J0 Todos <2733783+JOJ0@users.noreply.github.com>
2025-05-30 13:41:29 +00:00
Uncorrupt3318
dd2f203090
Feat: Add replace plugin (#5644)
Adds replace plugin. The plugin allows the user to replace the audio
file of a song, while keeping the tags and file name.

Some music servers keep track of favourite songs via paths and tags. Now
there won't be a need to 'refavourite'. Plus, this skips the
import/merge steps.
2025-05-27 00:17:52 +02:00
Ben Stolovitz
da5ec00aaf
[Test] Fix path tests on windows (#5803)
## Description

Fixes #5802.

Today, tests fail on most Windows machines because we hard-code `D:` as
the root drive, but most machines use `C:`. This change uses the same
normalization function in the test assertion to ensure the drives match.

## To Do

- [ ] ~~Documentation.~~
- [x] Changelog.
- [x] Tests. (this is a tests change)

## What changed?

* Updated tests to generate the drive name via normalization, instead of
hard-coding `D:`.
* Updated the `Item::destination()` method to document the
`relative_to_libdir` param.

## How tested?

* [x] Tests pass locally.
2025-05-26 19:24:57 +02:00
Sebastian Mohr
9584216209
Streamlined auto api referencing for documentation (#5795)
## Description

The current developer documentation feels somewhat cluttered due to
inline auto-generated API references for certain classes. To improve
readability and maintainability, this PR introduces a more streamlined
approach that aligns better with best practices observed in other PyData
ecosystem documentation.

Specifically, this PR:
- Adds a dedicated `api/` folder to the documentation structure.
- Moves all auto-generated references (classes, methods, etc.) to this
folder.
- Enables clean, concise linking to API elements from the narrative
documentation—without interrupting human-written content with large
autogenerated blocks.

This separation makes the documentation easier to navigate and maintain,
while still providing full API reference coverage where needed.

- [x] Documentation
- [x] Changelog
2025-05-22 11:35:40 +02:00
wisp3rwind
4fdfb393db update changelog 2025-05-20 08:59:49 +02:00
Šarūnas Nejus
e151b4b49b
Implement track_for_id to allow fetching singletons by discogs id 2025-05-19 09:43:56 +01:00
Šarūnas Nejus
9242db04a5
discogs: add configurable search_limit 2025-05-19 09:42:06 +01:00
Šarūnas Nejus
e8e9369bc7
Remove unused extra_tags parameter 2025-05-19 09:18:06 +01:00
Šarūnas Nejus
6487893315
Synchronise docs with the actual supported extra_tags 2025-05-18 20:09:51 +01:00
Šarūnas Nejus
be74936134
Handle extra_tags the way they used to be handled 2025-05-18 20:09:50 +01:00
Martin Atukunda
ab7b7a2e29
docs(plugin/web): update changelog 2025-05-18 20:59:29 +03:00
Martin Atukunda
1714705875 doc: plugin/web: now shows notifications using Media Session API 2025-05-18 17:16:29 +01:00
Sebastian Mohr
a2e316d444 Merge remote-tracking branch 'upstream/master' into importer-restructure 2025-05-17 10:32:50 +02:00
Šarūnas Nejus
3f1d117078
Add musicbrainz to plugins docs 2025-05-17 03:32:00 +01:00
Š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
Sebastian Mohr
68acaa6470 Renamed all action occurrences with Action. 2025-05-13 13:01:46 +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
Emi Katagiri-Simpson
4a43191c31
BUG: Wrong path edited when running config -e
Previously: ALWAYS edited the default config path
Corrected: When the --config <path> option is used, that path is edited
2025-03-23 15:58:06 -04:00
Emi Katagiri-Simpson
7acf2b3acf
Dereference symlinks before hardlinking
(see #5676)
2025-03-22 23:15:45 -04: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
Š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
Šarūnas Nejus
27d66d4b36
Change zero documentation mentions of genre to genres (#5486)
I've spent 2 hours troubleshooting why none of my music had genre tag.
It was because the single `genre`, without `s` doesn't seem to cover any
good ganre tags... at least it didn't on my opus files

looking at the code:
7ecd86101e/mediafile.py (L1669-L2167)
i don't honestly know why anyone created the single `ganre` field in the
first place
2024-12-02 02:21:08 +00:00
Šarūnas Nejus
f5a02462b1
Fixup changelog rst formatting for this and prev version 2024-11-26 15:45:58 +00:00
Šarūnas Nejus
9c4d4d9632
Include test files, manual to sdist 2024-11-26 15:38:13 +00:00
InvisibleFunction
32e9e58a35 Fix SACD Imports 2024-11-22 22:33:09 -05:00
RollingStar
79d7d48fe0
ARM footnotes 2024-11-22 17:43:52 -05:00
RollingStar
5f4fe21237
Update docs/guides/main.rst
Co-authored-by: Šarūnas Nejus <snejus@protonmail.com>
2024-11-22 17:38:07 -05:00
Andrew Rogl
ec4b26f986 Update changelog 2024-11-22 18:07:18 +10:00
Andrew Rogl
f0f77aa741 Update related window files to match 3.8 2024-11-22 18:04:43 +10:00
Šarūnas Nejus
176661bbf8
Changelog notes need to go under Unreleased 2024-11-22 07:18:14 +00:00
Šarūnas Nejus
6444111cde
bitesize to good first issue: Update changelog.rst (#5477) 2024-11-22 05:05:39 +00:00
Šarūnas Nejus
65e935bee5
Perform a regex substitution in the substitute plugin (#5357)
This utilises regex substitution in the substitute plugin. The previous
approach only used regex to match the pattern, then replaced it with a
static string. This change allows more complex substitutions, where the
output depends on the input.

### Example use case
Say we want to keep only the first artist of a multi-artist credit, as
in the following list:
```
Neil Young & Crazy Horse -> Neil Young
Michael Hurley, The Holy Modal Rounders, Jeffrey Frederick & The Clamtones -> Michael Hurley
James Yorkston and the Athletes -> James Yorkston
````
This would previously have required three separate rules, one for each
resulting artist. By using a regex substitution, we can get the desired
behaviour in a single rule:
```yaml
substitute:
  ^(.*?)(,| &| and).*: \1
```
(Capture the text until the first `,` ` &` or ` and`, then use that
capture group as the output)

### Notes
I've kept the previous behaviour of only applying the first matching
rule, but I'm not 100% sure it's the ideal approach.
I can imagine both cases where you want to apply several rules in
sequence and cases where you want to stop after the first match.
2024-11-22 05:02:50 +00:00
snejus
bc16ed1817 Increment version to 2.1.0 2024-11-22 01:50:28 +00:00
Šarūnas Nejus
aa0db049a5
Release: fix bumping the version in the changelog 2024-11-22 01:32:15 +00:00
RollingStar
82e8171d4a
Update changelog.rst 2024-11-17 18:55:16 -05:00
Šarūnas Nejus
7e9f7fc8de
Improve ListenBrainz error handling and simplify playlist handling (#5480)
Fixes #5459
2024-11-13 14:11:53 +00:00
adamharder3
a98cf47c06
Update docs/changelog.rst
Co-authored-by: Šarūnas Nejus <snejus@protonmail.com>
2024-11-11 10:43:31 -05:00
Alok Saboo
24115167d3 Merge remote-tracking branch 'upstream/master' into lb_error 2024-11-10 20:23:34 -05:00
Adam Harder
8448d8b4be changelog 2024-11-06 23:27:18 -05:00
Mateusz Soszyński
f7a34f1703
turns out single genres wasnt enough yet 2024-10-27 03:47:35 +01:00
Mateusz Soszyński
56d183300e
change to genres 2024-10-27 03:41:41 +01:00
Joseph Bushell
2e6e1809e3 Update docs/changelog.rst
Co-authored-by: Šarūnas Nejus <snejus@protonmail.com>
2024-10-26 18:18:06 +01:00
Alok Saboo
c49de7afe6 Update changelog.rst 2024-10-25 10:53:26 -04:00
RollingStar
fdb678cd1a
bitesize to good first issue: Update changelog.rst 2024-10-20 11:49:41 -04:00
Nicholas Boyd Isacsson
ffdc3f73ab Revert configuration format changes 2024-10-14 22:54:38 +02:00
RollingStar
97b785e31c
ARM install instructions 2024-10-13 12:31:37 -04:00
Nicholas Boyd Isacsson
48c7435780 Fix code-blocks 2024-10-12 16:20:25 +02:00
Nicholas Boyd Isacsson
195644fc46 Refactor according to review comments 2024-10-12 15:34:05 +02:00
Šarūnas Nejus
d3955bac65
Update Tekstowo backend to fetch lyrics directly
- Refactored Tekstowo backend to fetch lyrics directly from song pages.
- Added `encode` method to convert artist and title to their URL format,
  where non-alphanumeric characters are replaced with underscores.
- Removed the now redundant search functionality and associated tests.
- Simplified `extract_lyrics` method to directly parse lyrics without
  any checks.
2024-10-12 02:14:18 +01:00