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:
@@ -14,6 +14,14 @@ type Library struct {
|
||||
FullScanInProgress bool
|
||||
UpdatedAt time.Time
|
||||
CreatedAt time.Time
|
||||
|
||||
TotalSongs int
|
||||
TotalAlbums int
|
||||
TotalArtists int
|
||||
TotalFolders int
|
||||
TotalFiles int
|
||||
TotalMissingFiles int
|
||||
TotalSize int64
|
||||
}
|
||||
|
||||
type Libraries []Library
|
||||
@@ -32,4 +40,5 @@ type LibraryRepository interface {
|
||||
ScanBegin(id int, fullScan bool) error
|
||||
ScanEnd(id int) error
|
||||
ScanInProgress() (bool, error)
|
||||
RefreshStats(id int) error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user