mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 08:44:04 +01:00
Download: Add Disabled, Originals, MediaRaw & MediaSidecar Flags #2234
Extends DownloadSettings with 4 additional options: - Name: File name pattern for downloaded files (existed) - Disabled: Disables downloads - Originals: Only download files stored in "originals" folder - MediaRaw: Include RAW image files - MediaSidecar: Include metadata sidecar files (JSON, XMP, YAML)
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
package rnd
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
uuid "github.com/satori/go.uuid"
|
||||
)
|
||||
|
||||
// UUID returns a standard, random UUID as string.
|
||||
func UUID() string {
|
||||
return uuid.NewV4().String()
|
||||
}
|
||||
|
||||
// IsUUID tests if the string looks like a standard UUID.
|
||||
func IsUUID(s string) bool {
|
||||
return len(s) == 36 && IsHex(s)
|
||||
}
|
||||
|
||||
// SanitizeUUID normalizes UUIDs found in XMP or Exif metadata.
|
||||
func SanitizeUUID(s string) string {
|
||||
if s == "" {
|
||||
return ""
|
||||
}
|
||||
|
||||
s = strings.Replace(strings.TrimSpace(s), "\"", "", -1)
|
||||
|
||||
if start := strings.LastIndex(s, ":"); start != -1 {
|
||||
s = s[start+1:]
|
||||
}
|
||||
|
||||
if !IsUUID(s) {
|
||||
return ""
|
||||
}
|
||||
|
||||
return strings.ToLower(s)
|
||||
}
|
||||
Reference in New Issue
Block a user