feat: begin working on the categorize
This commit is contained in:
@@ -6,15 +6,6 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
type MediaType string
|
||||
|
||||
const (
|
||||
Video MediaType = "video"
|
||||
Presentation MediaType = "presentation"
|
||||
Internet MediaType = "internet"
|
||||
Unspecified MediaType = "unspecified"
|
||||
)
|
||||
|
||||
func RemoveFile(p string) error {
|
||||
err := os.Remove(p)
|
||||
if err != nil {
|
||||
@@ -24,21 +15,20 @@ func RemoveFile(p string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// 0: unspecified
|
||||
// 1: video
|
||||
// 2: presentation
|
||||
// 3: internet URL
|
||||
func CategorizeMediaType(ext string) (MediaType, bool) {
|
||||
// Lets categorize
|
||||
|
||||
switch ext {
|
||||
case ".mp4", ".mov", ".avi", ".mkv", ".webm", ".m4a":
|
||||
return Video, true
|
||||
case ".pptx", ".ppt", ".key", ".odp":
|
||||
return Presentation, true
|
||||
default:
|
||||
slog.Debug("marking file as invalid due to its undefined extension")
|
||||
return "", false
|
||||
}
|
||||
/*
|
||||
switch ext {
|
||||
case slices.Contains(videoFormats, ext):
|
||||
return Video, true
|
||||
case slices.Contains(presentationFormats, ext):
|
||||
return Presentation, true
|
||||
default:
|
||||
slog.Debug("marking file as invalid due to its undefined extension")
|
||||
return "", false
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
func ParseSlogLevel(s string) slog.Level {
|
||||
|
||||
Reference in New Issue
Block a user