mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 13:07:36 +03:00
Add option to disable track cover art. Should help with cloud mounting (rclone)
This commit is contained in:
parent
32bac11b61
commit
d913108de2
2 changed files with 5 additions and 3 deletions
|
@ -49,6 +49,7 @@ type configOptions struct {
|
||||||
DevLogSourceLine bool
|
DevLogSourceLine bool
|
||||||
DevAutoCreateAdminPassword string
|
DevAutoCreateAdminPassword string
|
||||||
DevPreCacheAlbumArtwork bool
|
DevPreCacheAlbumArtwork bool
|
||||||
|
DevDisableTrackCoverArt bool
|
||||||
DevNewCacheLayout bool
|
DevNewCacheLayout bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,6 +137,7 @@ func init() {
|
||||||
viper.SetDefault("devautocreateadminpassword", "")
|
viper.SetDefault("devautocreateadminpassword", "")
|
||||||
viper.SetDefault("devprecachealbumartwork", false)
|
viper.SetDefault("devprecachealbumartwork", false)
|
||||||
viper.SetDefault("devnewcachelayout", false)
|
viper.SetDefault("devnewcachelayout", false)
|
||||||
|
viper.SetDefault("devdisabletrackcoverart", false)
|
||||||
}
|
}
|
||||||
|
|
||||||
func InitConfig(cfgFile string) {
|
func InitConfig(cfgFile string) {
|
||||||
|
|
|
@ -98,7 +98,7 @@ func (a *artwork) getImagePath(ctx context.Context, id string) (path string, las
|
||||||
|
|
||||||
log.Trace(ctx, "Looking for media file art", "id", id)
|
log.Trace(ctx, "Looking for media file art", "id", id)
|
||||||
|
|
||||||
// Check if id is a mediaFile cover id
|
// Check if id is a mediaFile id
|
||||||
var mf *model.MediaFile
|
var mf *model.MediaFile
|
||||||
mf, err = a.ds.MediaFile(ctx).Get(id)
|
mf, err = a.ds.MediaFile(ctx).Get(id)
|
||||||
|
|
||||||
|
@ -110,8 +110,8 @@ func (a *artwork) getImagePath(ctx context.Context, id string) (path string, las
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// If it is a mediaFile and it has cover art, return it
|
// If it is a mediaFile and it has cover art, return it (if feature is disabled, skip)
|
||||||
if mf.HasCoverArt {
|
if !conf.Server.DevDisableTrackCoverArt && mf.HasCoverArt {
|
||||||
return mf.Path, mf.UpdatedAt, nil
|
return mf.Path, mf.UpdatedAt, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue