feat(scanner): add library stats to DB (#4229)

* Combine library stats migrations

* test: verify full library stats

* Fix total_songs calculation

* Fix library stats migration

* fix(scanner): log elapsed time and number of libraries updated during scan

Signed-off-by: Deluan <deluan@navidrome.org>

* fix(scanner): refresh library stats conditionally, only if changes were detected

Signed-off-by: Deluan <deluan@navidrome.org>

* fix(scanner): refresh library stats conditionally, only if changes were detected

Signed-off-by: Deluan <deluan@navidrome.org>

* fix(scanner): update queries to exclude missing entries in library stats

Signed-off-by: Deluan <deluan@navidrome.org>

---------

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan Quintão
2025-06-14 15:58:33 -04:00
committed by GitHub
parent 44834204de
commit 5667f6ab75
7 changed files with 180 additions and 15 deletions

View File

@@ -35,4 +35,8 @@ func (m *MockLibraryRepo) GetPath(id int) (string, error) {
return "", model.ErrNotFound
}
func (m *MockLibraryRepo) RefreshStats(id int) error {
return nil
}
var _ model.LibraryRepository = &MockLibraryRepo{}