photoprism/pkg/fs/mediatype.go
Michael Mayer 590420c870 Search: Remove stopwords
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-04-07 22:03:31 +02:00

44 lines
937 B
Go

package fs
type MediaType string
const (
MediaRaw MediaType = "raw"
MediaImage MediaType = "image"
MediaVideo MediaType = "video"
MediaSidecar MediaType = "sidecar"
MediaOther MediaType = "other"
)
var MediaTypes = map[FileType]MediaType{
TypeRaw: MediaRaw,
TypeJpeg: MediaImage,
TypePng: MediaImage,
TypeGif: MediaImage,
TypeTiff: MediaImage,
TypeBitmap: MediaImage,
TypeHEIF: MediaImage,
TypeAvi: MediaVideo,
TypeMP4: MediaVideo,
TypeMov: MediaVideo,
TypeXMP: MediaSidecar,
TypeXML: MediaSidecar,
TypeAAE: MediaSidecar,
TypeYaml: MediaSidecar,
TypeText: MediaSidecar,
TypeJson: MediaSidecar,
TypeToml: MediaSidecar,
TypeMarkdown: MediaSidecar,
TypeOther: MediaOther,
}
func GetMediaType(fileName string) MediaType {
result, ok := MediaTypes[GetFileType(fileName)]
if !ok {
result = MediaOther
}
return result
}