Commit Graph

190 Commits

Author SHA1 Message Date
Šarūnas Nejus
7bad226c33 Add setup fixture to TestHelper 2026-06-03 18:00:46 +01:00
Sebastian Mohr
0c42b34c62 Added git blame ignore rev entry and formatting. 2026-06-01 19:41:51 +02:00
Sebastian Mohr
c6dc99f565 Remove i = with item = for consistency. 2026-06-01 19:41:51 +02:00
Sebastian Mohr
d226a930fe TestItemRead: Aligned with PytestItemHelper 2026-06-01 19:41:51 +02:00
Sebastian Mohr
be0eb1439b TestPathString: Use get_first_item helper function. Also consistency
renaming i -> item
2026-06-01 19:41:51 +02:00
Sebastian Mohr
c37ae7fe6e TestAlbumInfo: Renamed item fixture to item_in_album, should reflect intend
more closely.
2026-06-01 19:41:51 +02:00
Sebastian Mohr
50ca216881 Removed self.i in favor of more pytest like item and item_in_db fixtures. 2026-06-01 19:41:51 +02:00
Sebastian Mohr
fda0a68d35 Fixed teardown logic and removed unnecessary imports. 2026-06-01 19:41:51 +02:00
Sebastian Mohr
27f4092fdb TemplateTest -> TemplateTest 2026-06-01 19:41:51 +02:00
Sebastian Mohr
a7a789d9ee UnicodePathTest -> TestUnicodePath 2026-06-01 19:41:51 +02:00
Sebastian Mohr
31248cb813 ItemPruneDirsClutterTest -> TestItemPruneDirsClutter 2026-06-01 19:41:51 +02:00
Sebastian Mohr
870a236b53 FilesizeTest -> TestFilesize 2026-06-01 19:41:51 +02:00
Sebastian Mohr
69fdf15e9f WriteTest -> TestWrite, ItemReadTest -> TestItemRead, ItemReadGenreTest -> TestItemReadGenre 2026-06-01 19:41:51 +02:00
Sebastian Mohr
d67263408e ImportTimeTest -> TestImportTime 2026-06-01 19:41:51 +02:00
Sebastian Mohr
075b230266 MtimeTest -> TestMtime 2026-06-01 19:41:51 +02:00
Sebastian Mohr
2897df99a9 PathStringTest -> TestPathString 2026-06-01 19:41:51 +02:00
Sebastian Mohr
f91f6b849a ArtDestinationTest -> TestArtDestination 2026-06-01 19:41:51 +02:00
Sebastian Mohr
3dfbcb26e0 AlbumInfoTest -> TestAlbumInfo 2026-06-01 19:41:51 +02:00
Sebastian Mohr
6fc1d34c9a PluginDestinationTest -> TestPluginDestination 2026-06-01 19:41:51 +02:00
Sebastian Mohr
016445d851 SingletonDisambiguationTest -> TestSingletonDisambiguation 2026-06-01 19:41:51 +02:00
Sebastian Mohr
d3892b81e9 DisambiguationTest -> TestDisambiguation 2026-06-01 19:41:51 +02:00
Sebastian Mohr
3e967a93bf DestinationFunctionTest -> TestDestinationFunction 2026-06-01 19:41:51 +02:00
Sebastian Mohr
02bee3a468 ItemFormattedMappingTest -> TestItemFormattedMapping 2026-06-01 19:41:51 +02:00
Sebastian Mohr
c9249464cb ParseQueryTest -> TestParseQuery 2026-06-01 19:41:51 +02:00
Sebastian Mohr
733249912a DestinationTest -> TestDestination 2026-06-01 19:41:51 +02:00
Sebastian Mohr
eef0fefbd9 GetSetTest -> TestGetSet 2026-06-01 19:41:51 +02:00
Sebastian Mohr
b3ed48e1b5 RemoveTest -> TestRemove 2026-06-01 19:41:51 +02:00
Sebastian Mohr
a46bb52168 AddTest -> TestAdd:
Also PytestItemHelper for item fixture without db binding.
2026-06-01 19:41:51 +02:00
Sebastian Mohr
8368d0a6c1 StoreTest -> TestStore 2026-06-01 19:41:51 +02:00
Sebastian Mohr
9db2860877 LoadTest -> TestLoad:
Also introduced PytestItemInDBHelper for item fixture.
2026-06-01 19:41:51 +02:00
Šarūnas Nejus
28321bd3e6 Remove default path_formats value only used in tests
Ensure that path_formats is set in relevant tests to avoid reliance on
defaults and to clarify test intent. Update Library constructor type hint for
path_formats to use Template type.

This default value was only relevant in tests.
2026-05-24 15:09:58 +01:00
Eyüp Can Akman
6e6fee93bf library: include path and reason in ReadError/WriteError messages
ReadError and WriteError formatted the super() proxy in their f-string, so file read and write failures lost the path and reason.
Use super().__str__() to return the FileOperationError message.
2026-05-24 00:25:50 +01:00
Sebastian Mohr
adfb73b66d Run ruff format 2026-05-20 16:53:06 +02:00
oxms16
c9e6d0f84c Fix path queries for multi-valued fields 2026-05-14 12:26:48 +08:00
Multipixelone
d8f1ee7508 test(library): ensure clutter config works properly 2026-04-17 21:55:11 +01:00
Šarūnas Nejus
a461ccb037 Normalise Windows paths 2026-04-11 13:18:58 +01:00
Šarūnas Nejus
409f4bd19c Fix path tests on Windows 2026-04-11 13:02:42 +01:00
Šarūnas Nejus
9db82be003 Fix paths for Windows 2026-04-11 13:02:42 +01:00
Šarūnas Nejus
d259c3ac73 Store paths relative to music dir in DB, expand on read
Move path relativization/expansion logic from Item._setitem/__getitem__
into dbcore layer (PathType.to_sql/from_sql and PathQuery), so all
models benefit without per-model overrides.

Propagate contextvars to pipeline and replaygain pool threads so the
library root context variable is available during background processing.
2026-04-11 13:01:41 +01:00
Šarūnas Nejus
a2cb160064 Store item paths relative to library directory
Convert item paths to relative on write and back to absolute on read,
keeping the database free of hardcoded library directory. Fix tests to
account for absolute path return values.
2026-04-11 13:01:41 +01:00
Šarūnas Nejus
85eaa447f0 Migrate composer -> composers 2026-04-05 09:15:23 +01:00
zqmfb
5e9d5c03db Add test for reading externally tagged semicolon-delimited genres 2026-03-29 08:39:45 +01:00
Šarūnas Nejus
a540a8174a Clarify tests 2026-02-27 18:36:04 +00:00
Šarūnas Nejus
a8d53f78de Fix the rest of the tests 2026-02-27 18:34:26 +00:00
Šarūnas Nejus
5d7fb4e158 Remove genre field 2026-02-27 18:34:26 +00:00
Johann Fot
70bf57baf6 Add native support for multiple genres per album/track
Simplify multi-genre implementation based on maintainer feedback (PR #6169).

Changes:
- Remove multi_value_genres and genre_separator config options
- Replace complex sync_genre_fields() with ensure_first_value('genre', 'genres')
- Update all plugins (Beatport, MusicBrainz, LastGenre) to always write genres as lists
- Add automatic migration for comma/semicolon/slash-separated genre strings
- Add 'beet migrate genres' command for explicit batch migration with --pretend flag
- Update all tests to reflect simplified approach (44 tests passing)
- Update documentation

Implementation aligns with maintainer vision of always using multi-value genres
internally with automatic backward-compatible sync to the genre field via
ensure_first_value(), eliminating configuration complexity.

Migration strategy avoids problems from #5540:
- Automatic lazy migration on item access (no reimport/mbsync needed)
- Optional batch migration command for user control
- No endless rewrite loops due to proper field synchronization
2026-02-23 05:11:36 +00:00
Šarūnas Nejus
9d237d10fc Fix multi-value delimiter handling in templates
- Use '\␀' as the DB delimiter while formatting lists with '; ' for
templates.
- Update DelimitedString parsing to accept both separators:
  * '\␀' for the values from the DB
  * '; ' for the rest of parsed values (for example `beet modify genres="eletronic; jazz"`)
- Refresh %first docs and tests to reflect multi-value field behavior.
2026-02-22 16:12:58 +00:00
Šarūnas Nejus
c52656fb0a Enable RUF rules 2026-01-13 20:55:40 +00:00
Šarūnas Nejus
9352a79e41 Replace percent formatting 2025-08-30 22:35:00 +01:00
Šarūnas Nejus
edd3df99ba Introduce TestHelper.temp_dir_path 2025-07-09 09:17:14 +01:00