Skip to content

Commit

Permalink
Remove old feature flag for cache layout
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Jul 2, 2021
1 parent f492057 commit 94e36d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
2 changes: 0 additions & 2 deletions conf/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ type configOptions struct {
DevAutoLoginUsername string
DevPreCacheAlbumArtwork bool
DevFastAccessCoverArt bool
DevOldCacheLayout bool
DevActivityPanel bool
DevEnableShare bool
DevEnableBufferedScrobble bool
Expand Down Expand Up @@ -226,7 +225,6 @@ func init() {
viper.SetDefault("devautocreateadminpassword", "")
viper.SetDefault("devautologinusername", "")
viper.SetDefault("devprecachealbumartwork", false)
viper.SetDefault("devoldcachelayout", false)
viper.SetDefault("devfastaccesscoverart", false)
viper.SetDefault("devactivitypanel", true)
viper.SetDefault("devenableshare", false)
Expand Down
13 changes: 3 additions & 10 deletions utils/cache/file_caches.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,9 @@ func newFSCache(name, cacheSize, cacheFolder string, maxItems int) (fscache.Cach

var fs fscache.FileSystem
log.Info(fmt.Sprintf("Creating %s cache", name), "path", cacheFolder, "maxSize", humanize.Bytes(size))
if conf.Server.DevOldCacheLayout {
fs, err = fscache.NewFs(cacheFolder, 0755)
} else {
fs, err = NewSpreadFS(cacheFolder, 0755)
}
fs, err = NewSpreadFS(cacheFolder, 0755)
if err != nil {
log.Error(fmt.Sprintf("Error initializing %s cache FS", name), "newLayout", !conf.Server.DevOldCacheLayout, err)
log.Error(fmt.Sprintf("Error initializing %s cache FS", name), err)
return nil, err
}

Expand All @@ -212,10 +208,7 @@ func newFSCache(name, cacheSize, cacheFolder string, maxItems int) (fscache.Cach
log.Error(fmt.Sprintf("Error initializing %s cache", name), err)
return nil, err
}

if !conf.Server.DevOldCacheLayout {
ck.SetKeyMapper(fs.(*spreadFS).KeyMapper)
}
ck.SetKeyMapper(fs.(*spreadFS).KeyMapper)

return ck, nil
}

0 comments on commit 94e36d7

Please sign in to comment.