Only try to check cover art file for lastUpdated if fast access is not set

This commit is contained in:
Deluan 2020-11-16 16:39:31 -05:00 committed by Joe Stump
parent 82ceeea31b
commit 8f789e385a
No known key found for this signature in database
GPG Key ID: 29151C3EC48A0EB9
2 changed files with 7 additions and 5 deletions

View File

@ -52,7 +52,7 @@ type configOptions struct {
DevLogSourceLine bool
DevAutoCreateAdminPassword string
DevPreCacheAlbumArtwork bool
DevDisableTrackCoverArt bool
DevFastAccessCoverArt bool
DevOldCacheLayout bool
DevActivityMenu bool
}
@ -161,7 +161,7 @@ func init() {
viper.SetDefault("devautocreateadminpassword", "")
viper.SetDefault("devprecachealbumartwork", false)
viper.SetDefault("devoldcachelayout", false)
viper.SetDefault("devdisabletrackcoverart", false)
viper.SetDefault("devFastAccessCoverArt", false)
viper.SetDefault("devactivitymenu", true)
}

View File

@ -61,8 +61,10 @@ func (a *artwork) Get(ctx context.Context, id string, size int, out io.Writer) e
return err
}
if stat, err := os.Stat(path); err == nil {
lastUpdate = stat.ModTime()
if !conf.Server.DevFastAccessCoverArt {
if stat, err := os.Stat(path); err == nil {
lastUpdate = stat.ModTime()
}
}
info := &imageInfo{
@ -115,7 +117,7 @@ func (a *artwork) getImagePath(ctx context.Context, id string) (path string, las
}
// If it is a mediaFile and it has cover art, return it (if feature is disabled, skip)
if !conf.Server.DevDisableTrackCoverArt && mf.HasCoverArt {
if !conf.Server.DevFastAccessCoverArt && mf.HasCoverArt {
return mf.Path, mf.UpdatedAt, nil
}