Commit Graph

4754 Commits

Author SHA1 Message Date
Šarūnas Nejus
471d7f3791 Replace queryparse functions with ModelQuery helpers
- Move query and sort construction into `ModelQuery` classmethods and parse
  tokenized input once.
- Switch call sites to consume `parse_query(...).query` and
  `parse_query(...).sort` instead of tuple unpacking.
- Remove legacy `dbcore` re-exports and obsolete helper functions in
  `queryparse`.
- Update query/sort tests to match the new parsing behavior and simplified
  query object shapes.
2026-07-13 18:43:22 +01:00
Šarūnas Nejus
5cb0fadbcf Rename query_from_strings -> build_and_query 2026-07-13 18:43:22 +01:00
Šarūnas Nejus
20e6ec222c Centralize field query construction in query classes
- Move field alias handling, shared-table qualification, and path pattern
  normalization into FieldQuery.from_model with a query-specific
  normalize_pattern hook.
- Update query parsing and plugin call sites to construct queries through
  query_cls.from_model and remove redundant model-level field query helpers.
  This keeps model entrypoints focused on orchestration and colocates
  transformation behavior with the query types that own it.
2026-07-13 18:43:22 +01:00
Šarūnas Nejus
c953dbd9b9 Define QueryByField 2026-07-13 18:43:22 +01:00
Šarūnas Nejus
2b7be8175c Replace parse_query_string, parse_query_parts by ModelQuery.parse
- Add ModelQuery in dbcore.queryparse and expose LibModel.parse_query as
  the single parsing entrypoint for string and sequence query inputs.
- Route library fetch, path format matching, and plugin query parsing
  through the model-level API, and deprecate
  beets.library.parse_query_string and parse_query_parts.
- Update tests to cover invalid query parsing via ModelQuery and align
  smartplaylist sort assertions with parsed sort behavior.
2026-07-13 18:43:22 +01:00
Šarūnas Nejus
c13141ebf5 Use model default_sort for library query defaults
- Replace default sort helpers with LibModel.default_sort as a shared,
  config-driven sort helper for Item and Album.
- Route Library._fetch through get_results with parsed query sort, explicit sort,
  or model default_sort fallback.
2026-07-13 18:43:22 +01:00
Šarūnas Nejus
0e796d46c1 Move prefixes to where they are used 2026-07-13 18:39:40 +01:00
Alok Saboo
3ce00617e9 switch the logic ot strip item-only fixed fields 2026-07-13 12:29:55 -04:00
Alok Saboo
7f45f51690 Merge branch 'master' into edit 2026-07-12 20:39:16 -04:00
Šarūnas Nejus
d9a1bde1c9 Add --no-keep-synced CLI option to lyrics
- Allow manual lyrics fetches to override keep_synced configuration for a single
  run.
2026-07-13 01:14:41 +01:00
Alok Saboo
aeaab7320d Merge branch 'master' into edit 2026-07-12 20:14:33 -04:00
Alok Saboo
210ca09637 ignore item-only fields configured in albumfields 2026-07-12 20:14:11 -04:00
Šarūnas Nejus
8020c07acf Track instrumental lyrics metadata
- Leave lyrics text empty when a backend reports an instrumental track and
  persist that state in lyrics_instrumental.
2026-07-13 01:07:59 +01:00
Alok Saboo
f91ba3a315 Merge branch 'master' into edit 2026-07-12 09:12:02 -04:00
Alok Saboo
55199bf365 harden edit-plugin id matching against duplicate ids and header reordering 2026-07-10 17:52:55 -04:00
Ross Williams
6afc0f282a test: add importer test for fetchart plugin
Test whether fetchart is run during the import phase and, specifically,
whether the `fetch_for_asis` setting is honored. Mock boundary is
between `FetchArtPlugin` and `ArtSource`, an already-existing internal
API boundary.
2026-07-10 22:19:44 +01:00
Ross Williams
c3de685484 Add fetch_for_asis setting to FetchArt plugin
Enable fetching art for imports even when as-is is selected as the
metadata source. Allows for the case when files with good metadata
but without album art are being imported (e.g. digital download store).

Signed-off-by: Ross Williams <ross@ross-williams.net>
2026-07-10 22:15:32 +01:00
Alok Saboo
094e38e002 Merge remote-tracking branch 'upstream/master' into edit
# Conflicts:
#	docs/changelog.rst
2026-07-10 16:31:13 -04:00
Alok Saboo
855434792c refactor code to remove duplication 2026-07-10 08:27:24 -04:00
Alok Saboo
c30dd28238 address reviewer comment; match track to items by id 2026-07-10 08:27:24 -04:00
Alok Saboo
ad3497c606 Update beetsplug/edit.py
Co-authored-by: Šarūnas Nejus <snejus@protonmail.com>
2026-07-10 08:27:24 -04:00
Alok Saboo
64df331deb added type hints 2026-07-10 08:27:24 -04:00
Alok Saboo
bf94ae66ef sync branch 2026-07-10 08:27:23 -04:00
Trey Turner
617bfd6a92 fix(ftintitle): remove singleton handling as out of scope 2026-07-08 21:53:00 -05:00
Trey Turner
b88390fc32 refactor(ftintitle): abstract ft_in_info into ft_in_title 2026-07-08 21:52:52 -05:00
Trey Turner
a1533350fd refactor(ftintitle): abstract update_item_metadata and update_info_metadata into update_metadata 2026-07-08 21:10:48 -05:00
Trey Turner
98f20aab78 fix(ftintitle): remove and inline _strip_featured_from_field 2026-07-08 21:10:48 -05:00
Trey Turner
9abe96355b fix(ftintitle): defer inclusion of artist_credit, review cleanup 2026-07-08 21:10:48 -05:00
Trey Turner
b6ef2dc119 fix(ftintitle): use Item type and type featured field 2026-07-08 21:10:48 -05:00
Trey Turner
0a8cd49e3d fix(ftintitle): rename to _strip_featured_from_field 2026-07-08 21:10:48 -05:00
Trey Turner
1160d31cfa feat(ftintitle): hook metadata events, fixing mbsync 2026-07-08 21:10:47 -05:00
Temitope S Olugbemi
65a01c2c2a fix(importfeeds): keep import going when a symlink can't be created
When `formats` includes `link`, importfeeds creates a symlink per imported
item. A failed symlink (lacking privilege on Windows, a read-only directory, or
a filesystem without symlink support) raised beets.util.FilesystemError out of
the import pipeline and aborted the whole `beet import` run, even though the
tracks were already imported.

Catch FilesystemError around the link() call, log a per-item warning, and
continue with the remaining items. Add regression tests for the
warn-and-continue behaviour, that only FilesystemError is caught, and that a
successful link still creates the symlink. Add a changelog entry.

Fixes #840.
2026-07-03 10:26:17 -07:00
Sebastian Mohr
54a2bd20e1 Removed This file is part of beets... headers. 2026-06-29 11:20:15 +02:00
Alok Saboo
60d60eacfb Merge branch 'master' into tidal-coverart 2026-06-27 10:11:11 -04:00
Šarūnas Nejus
609f83e338 tidal: Add missing return types in TidalPlugin 2026-06-27 09:20:38 +01:00
Šarūnas Nejus
3171334f4d Add docs 2026-06-27 09:03:36 +01:00
Šarūnas Nejus
ccccdef8b8 Extract shared Tidal attributes type
- Factor common album and track Tidal fields into a shared
  MediaAttributes TypedDict.
- Use the shared type in parser helpers that only need common Tidal
  metadata.
2026-06-27 09:03:36 +01:00
Sebastian Mohr
4e6e49d9c2 Removed a return. Still a bit complicated but
I don't think there is a way to further optimize.
2026-06-24 14:13:57 -04:00
Alok Saboo
01b12dca3b rename CoverArt types to Artwork to match Tidal API 2026-06-24 14:10:11 -04:00
Alok Saboo
26d90bbcfa make cover_art_by_id required and remove broken fallback URL 2026-06-24 14:10:10 -04:00
Alok Saboo
d26cfdedbc fix cover art types and parsing to match API response 2026-06-24 14:03:58 -04:00
Alok Saboo
28fa210422 tidal: fix mypy docref and dict access
- Fix mypy: avoid {} default in relationships.get() that creates Never type

- Fix doc build: use :doc:\etchart\ instead of :doc:\plugins/fetchart\ from within plugins/ directory
2026-06-24 14:03:58 -04:00
Alok Saboo
23d4edc4d7 tidal: fix mypy errors in cover art parsing
- Make CoverArtAttributes.url NotRequired

- Use direct index access on TypedDict instead of .get() to avoid mypy Never-type inference
2026-06-24 14:03:58 -04:00
Alok Saboo
659ee7df0b add cover art support 2026-06-24 14:03:56 -04:00
Šarūnas Nejus
f0105bef73 Add missing types to beets.util.pipeline 2026-06-24 16:53:34 +01:00
Šarūnas Nejus
8fe9c2e576 Set albumtypes instead of albumtype 2026-06-24 16:44:10 +01:00
Šarūnas Nejus
368d2c0a6d Normalize albumtype 2026-06-24 16:44:10 +01:00
Pierre Ayoub
c941a6b5c9 refactor(convert): Use cached_property for refresh option
- Fix snejus comment from 2026-06-23
2026-06-24 13:01:00 +02:00
Pierre Ayoub
1cc28d21fe refactor(convert): Merge redundant checks 2026-06-24 13:00:59 +02:00
Pierre Ayoub
9afdda5774 style(convert): Simplify logic
This is a suggestion from ruff linting: get rid of the redundant `else`
after the `return`.
2026-06-24 13:00:59 +02:00