mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +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:
34
pkg/clean/type.go
Normal file
34
pkg/clean/type.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package clean
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Type omits invalid runes, ensures a maximum length of 32 characters, and returns the result.
|
||||
func Type(s string) string {
|
||||
return Clip(ASCII(s), ClipType)
|
||||
}
|
||||
|
||||
// TypeLower converts a type string to lowercase, omits invalid runes, and shortens it if needed.
|
||||
func TypeLower(s string) string {
|
||||
return Type(strings.ToLower(s))
|
||||
}
|
||||
|
||||
// ShortType omits invalid runes, ensures a maximum length of 8 characters, and returns the result.
|
||||
func ShortType(s string) string {
|
||||
return Clip(ASCII(s), ClipShortType)
|
||||
}
|
||||
|
||||
// ShortTypeLower converts a short type string to lowercase, omits invalid runes, and shortens it if needed.
|
||||
func ShortTypeLower(s string) string {
|
||||
return ShortType(strings.ToLower(s))
|
||||
}
|
||||
|
||||
// LogType returns an entity type string for logging.
|
||||
func LogType(entityType string) string {
|
||||
if entityType == "" {
|
||||
return "<unknown-type>"
|
||||
}
|
||||
|
||||
return entityType
|
||||
}
|
||||
Reference in New Issue
Block a user