Implement targeted scanning of specific library/folder pairs without
full recursion. This enables efficient rescanning of individual folders
when changes are detected, significantly reducing scan time for large
libraries.
Key changes:
- Add ScanTarget struct and ScanFolders API to Scanner interface
- Implement CLI flag --targets for specifying libraryID:folderPath pairs
- Add FolderRepository.GetByPaths() for batch folder info retrieval
- Create loadSpecificFolders() for non-recursive directory loading
- Scope GC operations to affected libraries only (with TODO for full impl)
- Add comprehensive tests for selective scanning behavior
The selective scan:
- Only processes specified folders (no subdirectory recursion)
- Maintains library isolation
- Runs full maintenance pipeline scoped to affected libraries
- Supports both full and quick scan modes
Examples:
navidrome scan --targets "1:Music/Rock,1:Music/Jazz"
navidrome scan --full --targets "2:Classical"
* Adding environmental variable so that navidrome can detect
if its running as an MSI install for insights
* Renaming to be ND_PACKAGE_TYPE so we can reuse this for the
.deb/.rpm stats as well
* Packaged implies a bool, this is a description so it should
be packaging or just package imo
* wixl currently doesn't support <Environment> so I'm swapping out
to a file next-door to the configuration file, we should be
able to reuse this for deb/rpm as well
* Using a file we should be able to add support for linux like this
also
* MSI should copy the package into place for us, it's not a KeyPath
as older versions won't have it, so it's presence doesn't indicate
the installed status of the package
* OK this doesn't exist, need to find another way to do it
* package to .package and moving to the datadir
* fix(scanner): better log message when AutoImportPlaylists is disabled
Fix#3861
Signed-off-by: Deluan <deluan@navidrome.org>
* fix(scanner): support ID3v2 embedded images in WAV files
Fix#3867
Signed-off-by: Deluan <deluan@navidrome.org>
* feat(ui): show bitDepth in song info dialog
Signed-off-by: Deluan <deluan@navidrome.org>
* fix(server): don't break if the ND_CONFIGFILE does not exist
Signed-off-by: Deluan <deluan@navidrome.org>
* feat(docker): automatically loads a navidrome.toml file from /data, if available
Signed-off-by: Deluan <deluan@navidrome.org>
* feat(server): custom ArtistJoiner config (#3873)
* feat(server): custom ArtistJoiner config
Signed-off-by: Deluan <deluan@navidrome.org>
* refactor(ui): organize ArtistLinkField, add tests
Signed-off-by: Deluan <deluan@navidrome.org>
* feat(ui): use display artist
* feat(ui): use display artist
Signed-off-by: Deluan <deluan@navidrome.org>
---------
Signed-off-by: Deluan <deluan@navidrome.org>
* chore: remove some BFR-related TODOs that are not valid anymore
Signed-off-by: Deluan <deluan@navidrome.org>
* chore: remove more outdated TODOs
Signed-off-by: Deluan <deluan@navidrome.org>
* fix(scanner): elapsed time for folder processing is wrong in the logs
Signed-off-by: Deluan <deluan@navidrome.org>
* Should be able to reuse this mechanism with deb and rpm, I think
it would be nice to know which specific one it is without guessing
based on /etc/debian_version or something; but it doesn't look like
that is exposed by goreleaser into an env or anything :/
* Need to reference the installed file and I think Id's don't require []
* Need to add into the root directory for this to work
* That was not deliberately removed
* feat: add RPM and DEB package configuration files for Navidrome
Signed-off-by: Deluan <deluan@navidrome.org>
* Don't need this as goreleaser will sort it out
---------
Signed-off-by: Deluan <deluan@navidrome.org>
Co-authored-by: Deluan Quintão <deluan@navidrome.org>
Fixed race condition in the 'deduplicates items in buffer' test where the
background worker goroutine could process and clear the buffer before the
test could verify its contents. Added fc.SetReady(false) to keep the cache
unavailable during the test, ensuring buffered items remain in memory for
verification. This matches the pattern already used in the 'adds multiple
items to buffer' test.
Signed-off-by: Deluan <deluan@navidrome.org>
* feat: add album refresh functionality after deleting missing files
Implemented RefreshAlbums method in AlbumRepository to recalculate album attributes (size, duration, song count) from their constituent media files. This method processes albums in batches to maintain efficiency with large datasets.
Added integration in deleteMissingFiles to automatically refresh affected albums in the background after deleting missing media files, ensuring album statistics remain accurate. Includes comprehensive test coverage for various scenarios including single/multiple albums, empty batches, and large batch processing.
Signed-off-by: Deluan <deluan@navidrome.org>
* refactor: extract missing files deletion into reusable service layer
Extracted inline deletion logic from server/nativeapi/missing.go into a new core.MissingFiles service interface and implementation. This provides better separation of concerns and testability.
The MissingFiles service handles:
- Deletion of specific or all missing files via transaction
- Garbage collection after deletion
- Extraction of affected album IDs from missing files
- Background refresh of artist and album statistics
The deleteMissingFiles HTTP handler now simply delegates to the service, removing 70+ lines of inline logic. All deletion, transaction, and stat refresh logic is now centralized in core/missing_files.go.
Updated dependency injection to provide MissingFiles service to the native API router. Renamed receiver variable from 'n' to 'api' throughout native_api.go for consistency.
* refactor: consolidate maintenance operations into unified service
Consolidate MissingFiles and RefreshAlbums functionality into a new Maintenance service. This refactoring:
- Creates core.Maintenance interface combining DeleteMissingFiles, DeleteAllMissingFiles, and RefreshAlbums methods
- Moves RefreshAlbums logic from AlbumRepository persistence layer to core Maintenance service
- Removes MissingFiles interface and moves its implementation to maintenanceService
- Updates all references in wire providers, native API router, and handlers
- Removes RefreshAlbums interface method from AlbumRepository model
- Improves separation of concerns by centralizing maintenance operations in the core domain
This change provides a cleaner API and better organization of maintenance-related database operations.
* refactor: remove MissingFiles interface and update references
Remove obsolete MissingFiles interface and its references:
- Delete core/missing_files.go and core/missing_files_test.go
- Remove RefreshAlbums method from AlbumRepository interface and implementation
- Remove RefreshAlbums tests from AlbumRepository test suite
- Update wire providers to use NewMaintenance instead of NewMissingFiles
- Update native API router to use Maintenance service
- Update missing.go handler to use Maintenance interface
All functionality is now consolidated in the core.Maintenance service.
Signed-off-by: Deluan <deluan@navidrome.org>
* refactor: rename RefreshAlbums to refreshAlbums and update related calls
Signed-off-by: Deluan <deluan@navidrome.org>
* refactor: optimize album refresh logic and improve test coverage
Signed-off-by: Deluan <deluan@navidrome.org>
* refactor: simplify logging setup in tests with reusable LogHook function
Signed-off-by: Deluan <deluan@navidrome.org>
* refactor: add synchronization to logger and maintenance service for thread safety
Signed-off-by: Deluan <deluan@navidrome.org>
---------
Signed-off-by: Deluan <deluan@navidrome.org>
Fixed the multi-library selector dropdown background in the Ligera theme by changing the palette.background.paper value from 'inherit' to bLight['500'] ('#ffffff'). This ensures the dropdown has a solid white background that properly overlays content, making the library selection options clearly readable.
Closes#4502
* Update zh-Hant.json
Updated and optimized Traditional Chinese translation.
* Update zh-Hant.json
Updated and optimized Traditional Chinese translation.
* Update zh-Hant.json
Updated and optimized Traditional Chinese translation.