Commit graph

502 commits

Author SHA1 Message Date
Šarūnas Nejus
2d776a8a22
Add ability to set temporary music dir context for ipfs 2026-03-23 19:32:55 +00:00
Šarūnas Nejus
5eee28bb5c
Fix paths for Windows 2026-03-23 19:32:54 +00:00
Šarūnas Nejus
f500d434db
Use context to share music_dir 2026-03-23 09:40:08 +00:00
Šarūnas Nejus
5fad834ad2
Ensure we use Distance to initialise Match objects 2026-03-22 19:23:53 +00:00
Šarūnas Nejus
79787cfd97
tagging: fix list albumartists field 2026-03-22 19:23:52 +00:00
kelamg
989fc665c9 Improve test 2026-03-22 01:46:50 +00:00
kelamg
2e70472748 Remove + chars 2026-03-22 01:46:50 +00:00
kelamg
2f83c0869e Fix integration test 2026-03-22 01:46:50 +00:00
kelamg
b3bcb78349 Fix indentation 2026-03-22 01:46:50 +00:00
jochem
55b6fbe77d copied more generic implementation from snejus, and updated the tests and docs accordingly 2026-03-22 01:46:50 +00:00
kelamg
9a735df125 Fix formatting 2026-03-22 01:46:50 +00:00
kelamg
ec4def9e91 Refactor exclusion tests to pytest 2026-03-22 01:46:50 +00:00
jochem
2f9ee89b2a Added feature to exclude albums/songs during importing when auto is enabled, as requested in issue #3523. Also added corresponding tests and documentation. 2026-03-22 01:46:50 +00:00
J0J0 Todos
af8cbc179c lastgenre: Adapt test to canon helpers move 2026-03-17 06:52:30 +01:00
J0J0 Todos
ffc6f23407 lastgenre: Adapt test to last.fm client separation 2026-03-17 06:52:30 +01:00
Andrejs Mivreniks
f9f4af874b feat(play): Add -R/--randomize option to play plugin 2026-03-16 20:33:23 +02:00
Brock Grassy
d21470042a Address comments 2026-03-16 06:52:35 +00:00
Brock Grassy
e36c09d69d Fix lint 2026-03-16 06:52:35 +00:00
Brock Grassy
2c60c3eb49 Address comments and add new test case 2026-03-16 06:52:35 +00:00
Brock Grassy
c51f68be15 Fix rebase in tests 2026-03-16 06:52:35 +00:00
Brock Grassy
a3b7cfa1b3 Add IOMixin to fix failures 2026-03-16 06:52:35 +00:00
Brock Grassy
6b62380b62 Change missing plugin to allow for filtering albums by release type 2026-03-16 06:52:35 +00:00
Pierre Ayoub
49cb2f5544 chore(test_smartplaylist): Add future TODO about Mocks usage 2026-03-13 19:17:56 +00:00
Pierre Ayoub
1393cd0ae7 fix(test_smartplaylist.py): mypy type error as commit 002a051d0 2026-03-13 19:17:56 +00:00
Pierre Ayoub
523e504f5e fix(test_smartplaylist): Adapt to changes from commit d01727019
The aforementioned commits introduced a nmuber of changes since I
implemented this test:
- The syntax `self.assertExists(m3u_filepath)` was an old and now invalid
  way of checking existence of a path using assertion, change to `assert
  m3u_filepath.exists()` which now use string instead of bytes
- Use of `Path()` and strings instead of `path.join` and bytes for
  handling directory path
2026-03-13 19:17:56 +00:00
Pierre Ayoub
f5a08712b1 chore(test): Lint test_smartplaylist.py 2026-03-13 19:17:56 +00:00
Pierre Ayoub
e80fa746af chore(test): Format test_smartplaylist.py 2026-03-13 19:17:56 +00:00
Pierre Ayoub
2dcd8f4066 fix(test): Linting issues in smartplaylist 2026-03-13 19:17:56 +00:00
Pierre Ayoub
760271c456 chore(test): format with poe 2026-03-13 19:17:56 +00:00
Pierre Ayoub
ad2529adb0 test(plugins): write dest_regen test for smartplaylist
Test functions inspired from `test_playlist_update_output_extm3u()` in
`test_smartplaylist.py`.
Test successfully passed using:
`poetry run pytest test/plugins/test_smartplaylist.py`
2026-03-13 19:17:56 +00:00
john doe
acda1755c0 Update test/plugins/test_discogs.py
Co-authored-by: Šarūnas Nejus <snejus@protonmail.com>
2026-03-13 00:25:39 +00:00
Jack
59b636ac8c CI: install discogs extra so discogs tests run; remove skip logic 2026-03-13 00:25:39 +00:00
Jack
da32d64599 Fix module-level skip: use pytest.skip(allow_module_level=True) for discogs 2026-03-13 00:25:39 +00:00
Jack
04e5d0083d CI: skip discogs tests when discogs_client missing, guard empty items, reset config in test 2026-03-13 00:25:39 +00:00
jdoe29103
809744e8f4 Fix test class structure: move DGSearchQueryTest after DGAlbumInfoTest 2026-03-13 00:25:39 +00:00
jdoe29103
0d8d3bfadf Add discogs.extra_tags and updated documentation 2026-03-13 00:25:39 +00:00
Eric Masseran
548bd9bab6 Merge remote-tracking branch 'official/master' into use-aliases-for-track-album
* official/master: (54 commits)
  Require data_source in album_for_id and track_for_id functions
  Invoke album_matched hook from AlbumMatch.__post_init__
  Refactor match_by_id
  Take data source into account when deciding duplicate candidates
  Return album candidates from multiple sources when matching by IDs
  Add a test to reproduce the issue
  Move assignment tests to test/autotag/test_match.py
  Pulled latest changelog and added my entry to 'Unreleased > Bug fixes' section.
  Moved changelog note to top, under Unreleased.
  This PR improves the regex detection used for the drive_sep_replace default.
  This PR improves the regex detection used for the drive_sep_replace default.
  refactor: Use deprecate_for_user for beatport/bpsync deprecation warnings
  Fix docs: use single-line deprecated directive compatible with docstrfmt
  Fix docs formatting for beatport and bpsync rst files
  Deprecate beatport and bpsync plugins
  Update changelog.rst
  try to fix fish plugin
  Make get_search_query_with_filters abstract
  Document new methods
  Document shared metadata search plugin workflow
  ...
2026-03-10 08:52:31 +01:00
Eric Masseran
efd2b090b5 Copilot feedback 2026-03-10 08:52:08 +01:00
Šarūnas Nejus
35361a63b6
Require data_source in album_for_id and track_for_id functions
These functions now accept both an ID and data_source parameter,
enabling plugins like mbsync and missing to retrieve metadata from the
correct source.

Update mbsync and missing plugins to use the restored functions with
explicit data_source parameters. Add data_source validation to prevent
lookups when the source is not specified.

Add get_metadata_source helper function to retrieve plugins by their
data_source name, cached for performance.
2026-03-10 00:56:35 +00:00
Šarūnas Nejus
9b63985989
Migrate MusicBrainz to shared search hooks
Move MusicBrainzPlugin to SearchApiMetadataSourcePlugin hooks.

Keep entity mapping and criteria in provider-specific hooks.

Update typing and tests for the candidate search path.
2026-03-08 09:00:14 +00:00
Šarūnas Nejus
b683cb6540
Extend requires_import marker with force_ci option
Add force_ci kwarg to requires_import pytest marker to allow tests
to run unconditionally in CI (GitHub Actions), even if the module
is not detected locally. Refactor autobpm test to use this instead
of manual env-checking at module level.
2026-03-08 08:19:55 +00:00
Šarūnas Nejus
a7325e7483
Skip langdetect-dependent tests when package is not installed
Add a `requires_import` pytest marker and `is_importable` fixture to
conditionally skip or adjust assertions based on whether optional
dependencies are available. Apply this to `langdetect`-dependent
language detection tests in lyrics and migration test suites.
2026-03-08 08:19:55 +00:00
Šarūnas Nejus
05a822dd5c
Move Lyrics class under beets.util as it is used by migrations 2026-03-06 10:57:08 +00:00
Šarūnas Nejus
7d30efa82c
Migrate lyrics metadata to flex fields on library open
- Add `LyricsMetadataInFlexFieldsMigration` to extract legacy source
  URLs and language metadata from lyrics text into flex attributes
- Add `Lyrics.from_legacy_text` to parse legacy lyrics format
- Move `with_row_factory` context manager up to base `Migration` class
- Rename `migrate_table` to `migrate_model` and pass model class
  instead of table name string. This is so that the migration can access
  both `_table` and `_flex_table` attributes.
- Make `langdetect` import optional in `Lyrics.__post_init__`: users may
  not have have the dependency installed, and we do not want the
  migration to fail because of that.
- Move `BACKEND_BY_NAME` to module level for use outside plugin class
2026-03-06 10:57:08 +00:00
Šarūnas Nejus
7df14e1877
Fix timestamp format in translation/synced lyrics test 2026-03-06 10:57:08 +00:00
Šarūnas Nejus
38708ae592
Refactor lyrics handling to use structured Lyrics object
* Introduce a `Lyrics` dataclass to carry text, source URL, and language
  metadata through fetch, translation, and storage paths.
* Return `Lyrics` from backends and plugin lookup methods instead of raw
  tuples/strings.
* Store backend name in `lyrics_source` derived from fetched URL root
  domain.
* Simplify translator flow to operate on `Lyrics`, reuse line splitting,
  append translations in-place, and record translation language
  metadata.
2026-03-06 10:57:08 +00:00
Šarūnas Nejus
835115a6f7
Fix genius end to end lyrics test 2026-03-06 10:57:08 +00:00
Šarūnas Nejus
c239275193
Do not split orig/trans if they are not different 2026-03-05 15:36:59 +00:00
Šarūnas Nejus
cd95c15a0b
Add a test to show duplicate translations we have right now 2026-03-05 15:36:59 +00:00
Šarūnas Nejus
82bfc03494
Preserve synced lyrics when fetched result is plain text
When lyrics.synced is enabled, avoid replacing existing synced lyrics with
newly fetched unsynced lyrics, even with force enabled.

Allow replacement when the new lyrics are also synced, or when synced mode
is disabled.
2026-03-05 15:36:59 +00:00