navidrome/tests
Deluan Quintão 758e64c999
feat(scanner): per-library PID configuration (#6252)
* feat(model): add per-library PID config columns

* refactor(metadata): pass PID config to ToMediaFile and add spec validation

* feat(scanner): rescan only libraries whose PID config changed

* feat(server): validate library PID config and rescan on change

* feat(ui): edit per-library PID config

* fix(ui): label the PID mode selects

* fix: tighten per-library PID rescan edge cases

An interrupted PID rescan no longer upgrades every library to a full scan, a save that loses the race for the scanner logs at debug, the confirm dialog only shows when the effective PID spec changes, and it now gets translation keys.

* refactor(metadata): pass the library to ToMediaFile

ToMediaFile and core.Inspect took the library ID and its PID config as
separate arguments, so a caller could mix values from two libraries. They
now take the model.Library and resolve the effective PID config from it.

* chore: tidy per-library PID comments, PropTypes and migration

Trim comments that restated the code, add PropTypes to the new UI
components, and recreate the migration with make migration-sql.

* fix(ui): show the PID spec help under its input

* feat(cmd): make inspect use the file's library PID config

inspect always used the global PID config, so it showed different IDs than
the scanner for files in a library with an override. It now finds the
file's library in the DB and uses its effective config, falling back to
the global config when there is no DB or the file is outside every
library. It never creates a DB. The library path matcher moves from
core/playlists to model so both can use it.

* refactor: simplify per-library PID code

Share the DB-file check between CLI commands, move ErrAlreadyScanning to
model so core no longer imports scanner, read the libraries once for
insights, and let ValidatePIDSpec accept an empty spec and look tags up
directly. In the scanner, use FullScanInProgress instead of a second
flag, and skip recomputing album IDs when the album spec did not change.
In the UI, share the PID inputs between Create and Edit, and use docsUrl.

* feat(ui): add section titles to Library Create and pre-fill Custom PID specs

Custom now starts from the global spec, so admins edit a working spec
instead of typing one from scratch.

* fix(inspect): map files with the library-relative path the scanner uses

Inspect gave metadata the file's directory as typed, so folder-based PIDs
never matched the DB. It now uses the path relative to the library root,
through the scanner's helper, which moves to model.

* fix(scanner): say when a PID rescan only covers target folders

* fix: reject tag aliases in album PID specs and match root libraries

Tags are stored under canonical names, so an alias in a spec always reads
as empty. In an album spec that gives every album the same ID, so album
specs now require the tag name. Track specs keep accepting aliases, since
the default one uses them. LibraryMatcher now matches paths under a
library at the filesystem root.

* refactor(model): move the tag alias lookup to tag_mappings.go

* test: run the library matcher and inspect tests on Windows

Build test paths with filepath instead of Unix literals, so they use the
OS separator like filepath.Abs output, and drop the Windows skips.

* feat(ui): add pt-BR translations for per-library PID settings
2026-10-02 05:05:32 -04:00
..
fixtures fix(lastfm): report a failure when the artist page has no image (#6198) 2026-09-21 17:34:32 -04:00
harness refactor(scanner): remove the unused legacy ffmpeg metadata extractor (#6231) 2026-09-26 12:30:52 -04:00
dns_stub.go test(plugins): stub DNS in the host SSRF guard tests (#6208) 2026-09-23 18:42:11 -04:00
fake_http_client.go Retry calls to Last.FM without MBIDs when if returns artist invalid (#1138) 2021-05-27 20:53:24 -04:00
init_tests.go fix(artwork): only use image files as local artwork sources (#6180) 2026-09-20 13:40:14 -04:00
mock_album_repo.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_artist_repo.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_artwork_queue_repo.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_artwork_repo.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_data_store.go feat(subsonic): OpenSubsonic API key authentication (#6219) 2026-09-27 21:56:58 -04:00
mock_ffmpeg.go refactor(scanner): remove the unused legacy ffmpeg metadata extractor (#6231) 2026-09-26 12:30:52 -04:00
mock_genre_repo.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_library_repo.go feat(scanner): per-library PID configuration (#6252) 2026-10-02 05:05:32 -04:00
mock_library_service.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_mediafile_repo.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_player_repo.go feat(subsonic): OpenSubsonic API key authentication (#6219) 2026-09-27 21:56:58 -04:00
mock_playlist_repo.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_playlist_track_repo.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_playqueue_repo.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_plugin_manager.go feat(plugins): allow mounting library directories as read-write (#5122) 2026-02-28 10:59:13 -05:00
mock_plugin_repo.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_property_repo.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_radio_repository.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_scanner.go fix(server): return correct scanType in startScan response (#5159) 2026-03-09 14:19:53 -04:00
mock_scrobble_buffer_repo.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_scrobble_repo.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_share_repo.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_tag_repo.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_transcoding_repo.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_user_props_repo.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_user_repo.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
mock_user_service.go refactor(persistence): stateless repositories with per-call context (#6149) 2026-09-25 18:06:10 -04:00
navidrome-test.toml feat(plugins): experimental support for plugins (#3998) 2025-06-22 20:45:38 -04:00
test_helpers.go ci: run Go tests on Windows (#5380) 2026-04-19 13:16:47 -04:00