mirror of
https://github.com/navidrome/navidrome.git
synced 2025-12-23 23:18:05 -05:00
feat(scanner): add folder hash for smarter quick scan change detection (#4220)
* Simplify folder hash migration * fix hashing lint * refactor Signed-off-by: Deluan <deluan@navidrome.org> * Update scanner/folder_entry.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Signed-off-by: Deluan <deluan@navidrome.org> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -25,6 +25,7 @@ type Folder struct {
|
||||
NumPlaylists int `structs:"num_playlists"`
|
||||
ImageFiles []string `structs:"image_files"`
|
||||
ImagesUpdatedAt time.Time `structs:"images_updated_at"`
|
||||
Hash string `structs:"hash"`
|
||||
Missing bool `structs:"missing"`
|
||||
UpdateAt time.Time `structs:"updated_at"`
|
||||
CreatedAt time.Time `structs:"created_at"`
|
||||
@@ -74,12 +75,17 @@ func NewFolder(lib Library, folderPath string) *Folder {
|
||||
|
||||
type FolderCursor iter.Seq2[Folder, error]
|
||||
|
||||
type FolderUpdateInfo struct {
|
||||
UpdatedAt time.Time
|
||||
Hash string
|
||||
}
|
||||
|
||||
type FolderRepository interface {
|
||||
Get(id string) (*Folder, error)
|
||||
GetByPath(lib Library, path string) (*Folder, error)
|
||||
GetAll(...QueryOptions) ([]Folder, error)
|
||||
CountAll(...QueryOptions) (int64, error)
|
||||
GetLastUpdates(lib Library) (map[string]time.Time, error)
|
||||
GetLastUpdates(lib Library) (map[string]FolderUpdateInfo, error)
|
||||
Put(*Folder) error
|
||||
MarkMissing(missing bool, ids ...string) error
|
||||
GetTouchedWithPlaylists() (FolderCursor, error)
|
||||
|
||||
Reference in New Issue
Block a user