mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 20:47:35 +03:00
Remove current Image Cache implementation
This commit is contained in:
parent
c430401ea9
commit
38bde0ddba
6 changed files with 28 additions and 167 deletions
|
@ -40,13 +40,12 @@ type FolderScanner interface {
|
|||
var isScanning sync.Mutex
|
||||
|
||||
type scanner struct {
|
||||
folders map[string]FolderScanner
|
||||
status map[string]*scanStatus
|
||||
lock *sync.RWMutex
|
||||
ds model.DataStore
|
||||
pls core.Playlists
|
||||
cacheWarmer core.CacheWarmer
|
||||
broker events.Broker
|
||||
folders map[string]FolderScanner
|
||||
status map[string]*scanStatus
|
||||
lock *sync.RWMutex
|
||||
ds model.DataStore
|
||||
pls core.Playlists
|
||||
broker events.Broker
|
||||
}
|
||||
|
||||
type scanStatus struct {
|
||||
|
@ -56,15 +55,14 @@ type scanStatus struct {
|
|||
lastUpdate time.Time
|
||||
}
|
||||
|
||||
func New(ds model.DataStore, playlists core.Playlists, cacheWarmer core.CacheWarmer, broker events.Broker) Scanner {
|
||||
func New(ds model.DataStore, playlists core.Playlists, broker events.Broker) Scanner {
|
||||
s := &scanner{
|
||||
ds: ds,
|
||||
pls: playlists,
|
||||
cacheWarmer: cacheWarmer,
|
||||
broker: broker,
|
||||
folders: map[string]FolderScanner{},
|
||||
status: map[string]*scanStatus{},
|
||||
lock: &sync.RWMutex{},
|
||||
ds: ds,
|
||||
pls: playlists,
|
||||
broker: broker,
|
||||
folders: map[string]FolderScanner{},
|
||||
status: map[string]*scanStatus{},
|
||||
lock: &sync.RWMutex{},
|
||||
}
|
||||
s.loadFolders()
|
||||
return s
|
||||
|
@ -143,7 +141,6 @@ func (s *scanner) RescanAll(ctx context.Context, fullRescan bool) error {
|
|||
}
|
||||
defer isScanning.Unlock()
|
||||
|
||||
defer s.cacheWarmer.Flush(ctx)
|
||||
var hasError bool
|
||||
for folder := range s.folders {
|
||||
err := s.rescan(ctx, folder, fullRescan)
|
||||
|
@ -245,5 +242,5 @@ func (s *scanner) loadFolders() {
|
|||
}
|
||||
|
||||
func (s *scanner) newScanner(f model.MediaFolder) FolderScanner {
|
||||
return NewTagScanner(f.Path, s.ds, s.pls, s.cacheWarmer)
|
||||
return NewTagScanner(f.Path, s.ds, s.pls)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue