Make new cache layout the default

This commit is contained in:
Deluan 2020-11-04 23:25:38 -05:00 committed by Joe Stump
parent e92b02c4cc
commit a9e239a698
No known key found for this signature in database
GPG Key ID: 29151C3EC48A0EB9
2 changed files with 6 additions and 6 deletions

View File

@ -51,7 +51,7 @@ type configOptions struct {
DevAutoCreateAdminPassword string
DevPreCacheAlbumArtwork bool
DevDisableTrackCoverArt bool
DevNewCacheLayout bool
DevOldCacheLayout bool
}
type scannerOptions struct {
@ -155,7 +155,7 @@ func init() {
viper.SetDefault("devlogsourceline", false)
viper.SetDefault("devautocreateadminpassword", "")
viper.SetDefault("devprecachealbumartwork", false)
viper.SetDefault("devnewcachelayout", false)
viper.SetDefault("devoldcachelayout", false)
viper.SetDefault("devdisabletrackcoverart", false)
}

View File

@ -191,10 +191,10 @@ 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.DevNewCacheLayout {
fs, err = NewSpreadFS(cacheFolder, 0755)
} else {
if conf.Server.DevOldCacheLayout {
fs, err = fscache.NewFs(cacheFolder, 0755)
} else {
fs, err = NewSpreadFS(cacheFolder, 0755)
}
if err != nil {
log.Error(fmt.Sprintf("Error initializing %s cache", name), err)
@ -206,7 +206,7 @@ func newFSCache(name, cacheSize, cacheFolder string, maxItems int) (fscache.Cach
return nil, err
}
if conf.Server.DevNewCacheLayout {
if !conf.Server.DevOldCacheLayout {
ck.SetKeyMapper(fs.(*spreadFS).KeyMapper)
}