Commit graph

4231 commits

Author SHA1 Message Date
Šarūnas Nejus
001dddcf2f
Ensure that inc are joined with a plus
See this line in https://musicbrainz.org/doc/MusicBrainz_API#Lookups

> To include more than one subquery in a single request, separate the arguments to inc= with a + (plus sign), like inc=recordings+labels.
2025-12-20 01:35:52 +00:00
Šarūnas Nejus
3cbc3f0b2b
Add retries for connection errors 2025-12-20 01:35:52 +00:00
Šarūnas Nejus
8de7efa6c6
Add Usage block to RequestHandler 2025-12-20 01:35:52 +00:00
Šarūnas Nejus
137a49e1e6
Refactor HTTP request handling with RequestHandler base class
Introduce a new RequestHandler base class to introduce a shared session,
centralize HTTP request management and error handling across plugins.

Key changes:
- Add RequestHandler base class with a shared/cached session
- Convert TimeoutSession to use SingletonMeta for proper resource
  management
- Create LyricsRequestHandler subclass with lyrics-specific error
  handling
- Update MusicBrainzAPI to inherit from RequestHandler
2025-12-20 01:35:52 +00:00
Šarūnas Nejus
10ebd98ca5
musicbrainz: remove error handling 2025-12-20 01:35:52 +00:00
Šarūnas Nejus
ca0b3171cc
musicbrainz: access the custom server directly, if configured 2025-12-20 01:35:51 +00:00
Šarūnas Nejus
6b034da147
musicbrainz: browse directly 2025-12-20 01:35:51 +00:00
Šarūnas Nejus
abad03c1cb
musicbrainz: search directly 2025-12-20 01:35:51 +00:00
Šarūnas Nejus
d70e591738
musicbrainz: lookup recordings directly 2025-12-20 01:35:51 +00:00
Šarūnas Nejus
2a63e13617
musicbrainz: lookup release directly 2025-12-20 01:35:51 +00:00
Šarūnas Nejus
7fdb458524
Move pseudo release lookup under the plugin 2025-12-20 01:35:51 +00:00
Šarūnas Nejus
a866347345
Define MusicBrainzAPI class with rate limiting 2025-12-20 01:35:51 +00:00
Šarūnas Nejus
fda3bbaea5
Move TimeoutSession under beetsplug._utils 2025-12-20 01:35:51 +00:00
Henry Oberholtzer
ac0b6ec5e4 Merge branch 'Nedra1998-improved-multiartist' 2025-12-19 12:18:03 -08:00
Arden Rasmussen
a7170fae45 expand tests to include check for track artists 2025-12-18 16:23:58 -08:00
Arden Rasmussen
9cbbad19f8 remove changes for lastgenre as there was an existing PR for that work 2025-12-17 15:57:23 -08:00
Arden Rasmussen
01e0aeb662 address linter and ai comments from pr 2025-12-17 12:20:05 -08:00
Arden Rasmussen
963a9692cc added tests for multi-artist spotify and lastgenre changes 2025-12-17 11:54:12 -08:00
Arden Rasmussen
62256adf4e support multiple artists for spotify and improve multiartist support for lastgenre 2025-12-17 10:52:50 -08:00
Henry
d7b9ccab3b Titlecase Plugin Improvements: Add preserving all lowercase and all upper case strings; Fix spelling of 'separator' in config, docs and code; Move most of the logging for the plugin to debug to keep log cleaner. 2025-12-16 18:56:39 -08:00
Alok Saboo
515f9b6154
Merge branch 'master' into smartplaylist 2025-12-09 13:35:21 -05:00
Guy Bloom
2bd77b9895
Fix convert --format with never_convert_lossy_files (#6171)
## Description

Fixes #5625 

When `convert.never_convert_lossy_files` is enabled, `beet convert` was
ignoring the explicit `--format` option and just copying the lossy files
without
transcoding them. For example:

- `beet convert format:mp3 --format opus`

would still produce MP3 files instead of OPUS.

Change:

- Allows to override options `never_convert_lossy_files`, `max_bitrate`
or `no_convert` for `beet convert` as well as trying to convert to the
same format as existing already with a new option `--force`. That way,
for example lossy files selected by the query are transcoded to the
requested format anyway.
- Keeps existing behavior for automatic conversion on import (no CLI
override there).
- Adds tests to cover checking whether `--force` correctly overrides
settings or CLI options.
- Documents the behavior in the convert plugin docs

Co-authored-by: J0J0 Todos <jojo@peek-a-boo.at>
2025-12-03 22:48:41 +01:00
Alok Saboo
7cf6d7594e Merge remote-tracking branch 'upstream/master' into smartplaylist 2025-12-02 09:31:20 -05:00
Alok Saboo
20d9b6a136 Fix URL-encoding path conversion 2025-12-02 09:27:24 -05:00
Alok Saboo
b7541bedbd Annotated handlers to accept a Library instead of Any and added typed playlist helpers 2025-12-02 09:10:06 -05:00
Alok Saboo
715b2a97e7 Merge remote-tracking branch 'upstream/master' into smartplaylist 2025-12-02 09:02:15 -05:00
Šarūnas Nejus
05430f312c
Move PromptChoice to beets.util module
And update imports that have been raising the deprecation warning.
2025-12-02 01:51:14 +00:00
Šarūnas Nejus
5a3ecf6842
Add deprecate_for_user function 2025-11-30 07:02:46 +00:00
Sebastian Mohr
5cc7dcfce7 Sometimes it is time to let go of old things:
This removes old references and docs for the old gmusic plugin.
2025-11-27 21:58:29 +01:00
Alok Saboo
6bfe7cfbc9 refactor(smartplaylist): Improve type safety in query building 2025-11-26 13:47:18 -05:00
Alok Saboo
002a051d06 fix(smartplaylist): Resolve mypy type errors and update tests 2025-11-26 13:44:29 -05:00
Alok Saboo
b9de8f9aab Remove duplication in matches method 2025-11-26 13:39:02 -05:00
Alok Saboo
028401ac28 lint 2025-11-26 13:33:07 -05:00
Alok Saboo
1f3f3fa377 Merge remote-tracking branch 'upstream/master' into smartplaylist 2025-11-26 13:30:14 -05:00
Alok Saboo
67d6e7dd62 feat(types): Add type hints to smartplaylist.py 2025-11-26 13:27:44 -05:00
Gabriel Push
eb11537328
Merge branch 'master' into gabepush-test-fix 2025-11-25 18:16:08 -05:00
Alok Saboo
d5502208eb Merge remote-tracking branch 'upstream/master' into smartplaylist 2025-11-23 14:10:09 -05:00
henry
b902352139
New Plugin: Titlecase (#6133)
This plugin aims to address the shortcomings of the %title function, as
brought up in issues #152, #3298 and an initial look to improvement with
#3411. It supplies a new string format command, `%titlecase` which
doesn't interfere with any prior expected behavior of the `%title`
format command.

It also adds the ability to apply titlecase logic to metadata fields
that a user selects, which is useful if you, like me, are looking for
stylistic consistency and the minor stylistic differences between
Musizbrainz, Discogs, Deezer etc, with title case are slightly
infuriating.

This will add an optional dependency of
[titlecase](https://pypi.org/project/titlecase/), which allows the
titlecase core logic to be externally maintained.

If there's not enough draw to have this as a core plugin, I can also
spin this into an independent one, but it seemed like a recurring theme
that the %title string format didn't really behave as expected, and I
wanted my metadata to match too.

- [x] Documentation. (If you've added a new command-line flag, for
example, find the appropriate page under `docs/` to describe it.)
- [x] Changelog. (Add an entry to `docs/changelog.rst` to the bottom of
one of the lists near the top of the document.)
- [x] Tests. - Not 100% coverage, but didn't see a lot of other plugins
with testing for import stages.
2025-11-23 10:34:05 -08:00
Alok Saboo
71f4cc1814 Remove duplicate tracks 2025-11-23 09:59:34 -05:00
Alok Saboo
ebec90e8ac Merge remote-tracking branch 'upstream/master' into smartplaylist 2025-11-23 09:54:38 -05:00
Alok Saboo
f00bf83f05 lint 2025-11-23 09:52:26 -05:00
Alok Saboo
0511c4f202 cleanup 2025-11-23 09:50:53 -05:00
Alok Saboo
ec95c8df25 preserve the order in which queries were specified in the configuration 2025-11-23 09:45:12 -05:00
asardaes
9c37f94171 Add album template value in ftintitle plugin 2025-11-21 18:31:59 +01:00
Gabriel Push
c0ca045c20
Merge branch 'master' into gabepush-test-fix 2025-11-20 16:15:59 -05:00
Gabriel Push
aced802c56 Fix recursion in inline plugin when item_fields shadow DB fields (#6115) 2025-11-20 15:57:22 -05:00
Ognyan Moore
aa2dc9005f
Catch ValueError when setting gst required version
pytest.importskip is used to catch the case when beetsplug.bpd cannot be
imported. On macOS, the gi module was able to be imported, but when
trying to specify `gi.require_version`, a ValueError is raised about
Gst being unavailable. pytest does not catch this ValueError during
importskip as it is not an ImportError, and thus the test suite errors
during the test collection phase.

With this change, we catch the ValueError, and re-raise it as an
ImportError and pytest gracefully skips those tests.
2025-11-19 14:43:30 +03:00
Théophile Bastian
189fedb008 Web plugin: add type hint for g.lib 2025-11-15 21:02:43 +01:00
Théophile Bastian
666c412b0e plugins/web: fix endpoints /…/values/…
Following #4709 and #5447, the web plugin used single-quotes (ie. string
litteral) in the SQL query for table columns. Thus, for instance, the query
`GET /item/values/albumartist` would return the litteral "albumartist"
instead of a list of unique album artists.
2025-11-15 21:02:38 +01:00
Aidan Epstein
d7636fb0c3 Apply suggestions from code review
Co-authored-by: Šarūnas Nejus <snejus@protonmail.com>
2025-11-11 13:18:51 -08:00