mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-25 03:19:55 +01:00
refactor: introduce GC, to delete old data
This commit is contained in:
parent
5d1df19291
commit
de1fea64bc
6 changed files with 105 additions and 9 deletions
|
|
@ -104,17 +104,11 @@ func (s *TagScanner) Scan(ctx context.Context, lastModifiedSince time.Time) erro
|
|||
return err
|
||||
}
|
||||
|
||||
err = s.ds.Album(ctx).PurgeEmpty()
|
||||
if err != nil {
|
||||
return err
|
||||
if len(changed)+len(deleted) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
err = s.ds.Artist(ctx).PurgeEmpty()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return s.ds.GC(log.NewContext(nil))
|
||||
}
|
||||
|
||||
func (s *TagScanner) refreshAlbums(ctx context.Context, updatedAlbums map[string]bool) error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue