2020-12-17 10:23:17 +01:00
|
|
|
package entity
|
|
|
|
|
|
|
|
import "github.com/photoprism/photoprism/internal/classify"
|
|
|
|
|
|
|
|
type Priorities map[string]int
|
|
|
|
|
|
|
|
// Data source names.
|
|
|
|
const (
|
2021-11-21 21:25:11 +01:00
|
|
|
SrcAuto = "" // Prio 1
|
|
|
|
SrcDefault = "default" // Prio 1
|
|
|
|
SrcEstimate = "estimate" // Prio 2
|
|
|
|
SrcName = "name" // Prio 4
|
|
|
|
SrcYaml = "yaml" // Prio 8
|
2023-03-08 23:30:39 +01:00
|
|
|
SrcLDAP = "ldap" // Prio 8
|
2021-11-21 21:25:11 +01:00
|
|
|
SrcLocation = classify.SrcLocation // Prio 8
|
|
|
|
SrcMarker = "marker" // Prio 8
|
|
|
|
SrcImage = classify.SrcImage // Prio 8
|
|
|
|
SrcKeyword = classify.SrcKeyword // Prio 16
|
|
|
|
SrcMeta = "meta" // Prio 16
|
|
|
|
SrcXmp = "xmp" // Prio 32
|
|
|
|
SrcManual = "manual" // Prio 64
|
2022-10-17 19:07:38 +02:00
|
|
|
SrcAdmin = "admin" // Prio 128
|
2020-12-17 10:23:17 +01:00
|
|
|
)
|
|
|
|
|
2021-08-28 15:26:26 +02:00
|
|
|
// SrcString returns a source string for logging.
|
|
|
|
func SrcString(src string) string {
|
|
|
|
if src == SrcAuto {
|
|
|
|
return "auto"
|
|
|
|
}
|
|
|
|
|
|
|
|
return src
|
|
|
|
}
|
|
|
|
|
2021-08-12 12:05:10 +02:00
|
|
|
// SrcPriority maps source priorities.
|
2020-12-17 10:23:17 +01:00
|
|
|
var SrcPriority = Priorities{
|
|
|
|
SrcAuto: 1,
|
2021-08-15 20:57:26 +02:00
|
|
|
SrcDefault: 1,
|
2020-12-17 10:23:17 +01:00
|
|
|
SrcEstimate: 2,
|
|
|
|
SrcName: 4,
|
|
|
|
SrcYaml: 8,
|
2023-03-08 23:30:39 +01:00
|
|
|
SrcLDAP: 8,
|
2020-12-17 10:23:17 +01:00
|
|
|
SrcLocation: 8,
|
2021-08-12 17:49:48 +02:00
|
|
|
SrcMarker: 8,
|
2020-12-17 10:23:17 +01:00
|
|
|
SrcImage: 8,
|
|
|
|
SrcKeyword: 16,
|
|
|
|
SrcMeta: 16,
|
|
|
|
SrcXmp: 32,
|
|
|
|
SrcManual: 64,
|
2022-10-17 19:07:38 +02:00
|
|
|
SrcAdmin: 128,
|
2020-12-17 10:23:17 +01:00
|
|
|
}
|