Commit Graph
820 Commits
Author SHA1 Message Date
Š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
Alok Saboo 01c2943e76 remove redundant test 2026-07-13 12:37:07 -04:00
Alok Saboo 3ce00617e9 switch the logic ot strip item-only fixed fields 2026-07-13 12:29:55 -04:00
Alok Saboo 58fb167750 Merge branch 'master' into edit 2026-07-13 08:47:53 -04:00
Ross Williams c2fc7a8a57 test: fix requests_mock setup in test_art.py
`requests_mock` was configured with a fallback matcher to return an
exception on any request. The intent was to have tests fail if any
requests are attempted in tests without matching mocks. This is the
default behavior of `requests_mock`, so no fallback matcher is
necessary. The side-effect of the fallback matcher, removed by this
commit, was that 1) the `NoMockAddress` exception was raised to the
function under test rather than to the test harness and 2) the
`NoMockAddress` exception was not able to be constructed because the
`exc` parameter to `requests_mock.register_uri` does not support
exceptions that require arguments. This behavior is visible in the
following log snippet, taken from an incorrectly-passing test:

```
DEBUG    beets.fetchart:logging.py:163 downloading image: https://images.amazon.com/images/P/xxxx.01.LZZZZZZZ.jpg
DEBUG    requests_mock.adapter:adapter.py:256 GET https://images.amazon.com/images/P/xxxx.01.LZZZZZZZ.jpg 200
DEBUG    beets.fetchart:logging.py:163 not a supported image: text/html
DEBUG    beets.fetchart:logging.py:163 downloading image: https://images.amazon.com/images/P/xxxx.02.LZZZZZZZ.jpg
DEBUG    beets.fetchart:logging.py:163 error fetching art: NoMockAddress.__init__() missing 1 required positional argument: 'request'
```

The test that emitted these logs passed because the `FetchArt` plugin is
written to handle exceptions raised by art sources, skipping and logging
an error. For the exception to cause a failing test, the default
behavior of `requests_mock` of raising an exception to the test harness
when no matching mock requests can be found must be allowed.

Signed-off-by: Ross Williams <ross@ross-williams.net>
2026-07-13 13:21:32 +01: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 77405266eb test: convert test_fetchart to TestHelper
Signed-off-by: Ross Williams <ross@ross-williams.net>
2026-07-10 22:15:39 +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 bf94ae66ef sync branch 2026-07-10 08:27:23 -04:00
Trey Turner 5d2280013a test(ftintitle): remove mostly redundant test_trackinfo_received_preserves_collaborative_artist_credit 2026-07-08 22:02:12 -05:00
Trey Turner 617bfd6a92 fix(ftintitle): remove singleton handling as out of scope 2026-07-08 21:53:00 -05:00
Trey Turner 6132297fa1 test(ftintitle): remove item_data["artist"] assertion from artist_credit test 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 5738a8a0f1 test(ftintitle): remove artist_credit tests 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 61f8c94e7f fix(hooks): remove cached property invalidation 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
Šarūnas Nejus 230bf19c7f Remove redundant test logic exposed by full coverage
- Removing the coverage omit configuration exposed unused branches, helpers, and
  fixtures across the test suite.
- Delete that redundant logic and simplify affected tests while preserving their
  behavior.
2026-07-07 15:57:35 +01:00
Šarūnas Nejus 7cf8896597 Make the global config fixture function-scoped 2026-07-03 21:21:19 +01:00
Šarūnas Nejus 7c8924d8c9 Cache config.source in ConfigMixin for test speedup 2026-07-03 21:21:19 +01: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
Šarūnas Nejus aef9c64cb0 Move DummyIMBackend to fixtures 2026-06-30 21:48:40 +01:00
Šarūnas Nejus 900543baca Move test modules under folders that they belong to 2026-06-30 21:48:40 +01:00
Sebastian Mohr 54a2bd20e1 Removed This file is part of beets... headers. 2026-06-29 11:20:15 +02:00
Alok Saboo a0f092ff14 fix test_parse_artwork_url placement into TestStaticHelpers class 2026-06-24 14:10:11 -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 659ee7df0b add cover art support 2026-06-24 14:03:56 -04: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
Šarūnas Nejus fca1aafdd0 Remove misplaced implementation test
Two issues with this one:
1. It tests implementation.
2. It was part of `TidalPluginTest` base class, so it ran multiple times
   in every class that used this mixin:

   $ pytest -vv test/plugins/test_tidal.py | grep flex_field_types
   test/plugins/test_tidal.py::TidalPluginTest::test_flex_field_types_are_scoped_correctly PASSED
   test/plugins/test_tidal.py::TestAlbumParsing::test_flex_field_types_are_scoped_correctly PASSED
   test/plugins/test_tidal.py::TestTrackParsing::test_flex_field_types_are_scoped_correctly PASSED
   test/plugins/test_tidal.py::TestTrackForID::test_flex_field_types_are_scoped_correctly PASSED
   test/plugins/test_tidal.py::TestTracksForIDs::test_flex_field_types_are_scoped_correctly PASSED
   test/plugins/test_tidal.py::TestAlbumForID::test_flex_field_types_are_scoped_correctly PASSED
   test/plugins/test_tidal.py::TestAlbumsForIDs::test_flex_field_types_are_scoped_correctly PASSED
   test/plugins/test_tidal.py::TestCandidates::test_flex_field_types_are_scoped_correctly PASSED
   test/plugins/test_tidal.py::TestItemCandidates::test_flex_field_types_are_scoped_correctly PASSED
   test/plugins/test_tidal.py::TestTidalsync::test_flex_field_types_are_scoped_correctly PASSED
2026-06-24 16:44:10 +01:00
Šarūnas Nejus 499e8dc8cb Use a single data-driven test for parsing 2026-06-24 16:44:10 +01:00
Sebastian Cao 755ca6f139 convert: skip missing album art instead of crashing 2026-06-24 16:45:23 +08:00
Šarūnas Nejus faad463521 Merge branch 'master' into rest-directory-config 2026-06-23 10:02:32 +01:00
Pieter Lenaerts ec4286d4cf Merge remote-tracking branch 'upstream/master' 2026-06-23 06:59:28 +02:00
Blake Hakkila 9e693fbfa4 Removed no output test and simplified assert logic 2026-06-22 12:18:55 -07:00
Blake Hakkila ecad4811c6 Merge branch 'master' into rest-directory-config 2026-06-20 17:20:18 -07:00
Blake Hakkila dc07242840 Simplified tests by removing path variations, kept edge case test for user home path in config 2026-06-20 17:18:54 -07:00
Sebastian Mohr 579c79b1ab Removed plugin: prefix from logging specific tests. 2026-06-20 13:28:47 +02:00
Blake Hakkila a7aeb6db92 Fixed tests to remove confuse testing and add mock for RestFiles 2026-06-19 15:42:10 -07:00