-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
src.go
50 lines (44 loc) Β· 1.22 KB
/
src.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package entity
import "github.com/photoprism/photoprism/internal/classify"
type Priorities map[string]int
// Data source names.
const (
SrcAuto = "" // Prio 1
SrcDefault = "default" // Prio 1
SrcEstimate = "estimate" // Prio 2
SrcName = "name" // Prio 4
SrcYaml = "yaml" // Prio 8
SrcLDAP = "ldap" // Prio 8
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
SrcAdmin = "admin" // Prio 128
)
// SrcString returns a source string for logging.
func SrcString(src string) string {
if src == SrcAuto {
return "auto"
}
return src
}
// SrcPriority maps source priorities.
var SrcPriority = Priorities{
SrcAuto: 1,
SrcDefault: 1,
SrcEstimate: 2,
SrcName: 4,
SrcYaml: 8,
SrcLDAP: 8,
SrcLocation: 8,
SrcMarker: 8,
SrcImage: 8,
SrcKeyword: 16,
SrcMeta: 16,
SrcXmp: 32,
SrcManual: 64,
SrcAdmin: 128,
}