2019-12-09 08:04:41 +01:00
|
|
|
package photoprism
|
|
|
|
|
2020-01-02 05:03:47 +01:00
|
|
|
type IndexOptions struct {
|
2020-05-06 15:53:47 +02:00
|
|
|
Path string
|
|
|
|
Rescan bool
|
|
|
|
Convert bool
|
2019-12-09 08:04:41 +01:00
|
|
|
}
|
|
|
|
|
2020-01-02 05:03:47 +01:00
|
|
|
func (o *IndexOptions) SkipUnchanged() bool {
|
2020-05-06 10:35:41 +02:00
|
|
|
return !o.Rescan
|
2019-12-09 08:04:41 +01:00
|
|
|
}
|
|
|
|
|
2020-01-02 05:03:47 +01:00
|
|
|
// IndexOptionsAll returns new index options with all options set to true.
|
|
|
|
func IndexOptionsAll() IndexOptions {
|
|
|
|
result := IndexOptions{
|
2020-05-06 15:53:47 +02:00
|
|
|
Path: "/",
|
|
|
|
Rescan: true,
|
|
|
|
Convert: true,
|
2019-12-09 08:04:41 +01:00
|
|
|
}
|
|
|
|
|
2020-01-02 05:03:47 +01:00
|
|
|
return result
|
2019-12-09 08:04:41 +01:00
|
|
|
}
|
|
|
|
|
2020-01-02 05:03:47 +01:00
|
|
|
// IndexOptionsNone returns new index options with all options set to false.
|
|
|
|
func IndexOptionsNone() IndexOptions {
|
|
|
|
result := IndexOptions{}
|
2019-12-09 08:04:41 +01:00
|
|
|
|
2020-01-02 05:03:47 +01:00
|
|
|
return result
|
2019-12-09 08:04:41 +01:00
|
|
|
}
|