2020-12-18 09:11:42 +01:00
|
|
|
package config
|
|
|
|
|
|
|
|
// DisableBackups tests if photo and album metadata backups should be disabled.
|
|
|
|
func (c *Config) DisableBackups() bool {
|
|
|
|
if !c.SidecarWritable() {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2020-12-18 20:42:12 +01:00
|
|
|
return c.options.DisableBackups
|
2020-12-18 09:11:42 +01:00
|
|
|
}
|
|
|
|
|
2020-12-18 10:59:21 +01:00
|
|
|
// DisableWebDAV tests if the built-in WebDAV server should be disabled.
|
|
|
|
func (c *Config) DisableWebDAV() bool {
|
|
|
|
if c.ReadOnly() || c.Demo() {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2020-12-18 20:42:12 +01:00
|
|
|
return c.options.DisableWebDAV
|
2020-12-18 10:59:21 +01:00
|
|
|
}
|
|
|
|
|
2020-12-18 09:11:42 +01:00
|
|
|
// DisableSettings tests if users should not be allowed to change settings.
|
|
|
|
func (c *Config) DisableSettings() bool {
|
2020-12-18 20:42:12 +01:00
|
|
|
return c.options.DisableSettings
|
2020-12-18 09:11:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// DisablePlaces tests if geocoding and maps should be disabled.
|
|
|
|
func (c *Config) DisablePlaces() bool {
|
2020-12-18 20:42:12 +01:00
|
|
|
return c.options.DisablePlaces
|
2020-12-18 09:11:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// DisableExifTool tests if ExifTool JSON files should not be created for improved metadata extraction.
|
|
|
|
func (c *Config) DisableExifTool() bool {
|
|
|
|
if !c.SidecarWritable() || c.ExifToolBin() == "" {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2020-12-18 20:42:12 +01:00
|
|
|
return c.options.DisableExifTool
|
2020-12-18 09:11:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// DisableTensorFlow tests if TensorFlow should not be used for image classification (or anything else).
|
|
|
|
func (c *Config) DisableTensorFlow() bool {
|
2021-08-05 15:15:33 +02:00
|
|
|
if LowMem && !c.options.DisableTensorFlow {
|
|
|
|
c.options.DisableTensorFlow = true
|
|
|
|
log.Warnf("config: disabled image classification due to memory constraints")
|
|
|
|
}
|
|
|
|
|
2020-12-18 20:42:12 +01:00
|
|
|
return c.options.DisableTensorFlow
|
2020-12-18 09:11:42 +01:00
|
|
|
}
|
2021-04-30 14:24:01 +02:00
|
|
|
|
2021-08-05 15:15:33 +02:00
|
|
|
// DisableFFmpeg tests if FFmpeg is disabled for video transcoding.
|
|
|
|
func (c *Config) DisableFFmpeg() bool {
|
|
|
|
if LowMem && !c.options.DisableFFmpeg {
|
|
|
|
c.options.DisableFFmpeg = true
|
|
|
|
log.Warnf("config: disabled video transcoding due to memory constraints")
|
|
|
|
}
|
|
|
|
|
|
|
|
return c.options.DisableFFmpeg || c.FFmpegBin() == ""
|
|
|
|
}
|
|
|
|
|
2021-04-30 14:24:01 +02:00
|
|
|
// DisableDarktable tests if Darktable is disabled for RAW conversion.
|
|
|
|
func (c *Config) DisableDarktable() bool {
|
2021-08-05 15:15:33 +02:00
|
|
|
if LowMem && !c.options.DisableDarktable {
|
|
|
|
c.options.DisableDarktable = true
|
|
|
|
log.Warnf("config: disabled file conversion with Darktable due to memory constraints")
|
|
|
|
}
|
|
|
|
|
2021-04-30 14:24:01 +02:00
|
|
|
return c.options.DisableDarktable || c.DarktableBin() == ""
|
|
|
|
}
|
|
|
|
|
|
|
|
// DisableRawtherapee tests if Rawtherapee is disabled for RAW conversion.
|
|
|
|
func (c *Config) DisableRawtherapee() bool {
|
2021-08-05 15:15:33 +02:00
|
|
|
if LowMem && !c.options.DisableRawtherapee {
|
|
|
|
c.options.DisableRawtherapee = true
|
|
|
|
log.Warnf("config: disabled file conversion with RawTherapee due to memory constraints")
|
|
|
|
}
|
|
|
|
|
2021-04-30 14:24:01 +02:00
|
|
|
return c.options.DisableRawtherapee || c.RawtherapeeBin() == ""
|
|
|
|
}
|
|
|
|
|
|
|
|
// DisableSips tests if SIPS is disabled for RAW conversion.
|
|
|
|
func (c *Config) DisableSips() bool {
|
|
|
|
return c.options.DisableSips || c.SipsBin() == ""
|
|
|
|
}
|
|
|
|
|
|
|
|
// DisableHeifConvert tests if heif-convert is disabled for HEIF conversion.
|
|
|
|
func (c *Config) DisableHeifConvert() bool {
|
|
|
|
return c.options.DisableHeifConvert || c.HeifConvertBin() == ""
|
|
|
|
}
|