more filetype support

This commit is contained in:
2026-05-21 19:55:33 +02:00
parent ea225b9c33
commit 98adb979f6
+20 -4
View File
@@ -21,10 +21,26 @@ const CategoryMap = [_]CategoryEntry{
.{ .category = .video, .extensions = &VideoTypes },
};
const ImageTypes = [_][]const u8{ ".png", ".jpg", ".jpeg", ".webp", ".gif" };
const DocumentTypes = [_][]const u8{ ".pdf", ".docx", ".odt" };
const MusicTypes = [_][]const u8{ ".mp3", ".ogg", ".flac", ".opus", ".aac", ".wav", ".alac", ".m4a" };
const VideoTypes = [_][]const u8{ ".mp4", ".mkv", ".mov", ".m4v" };
const ImageTypes = [_][]const u8{
".arw", ".avif", ".bmp", ".cr2", ".cr3", ".dng", ".gif",
".heic", ".heif", ".ico", ".jpeg", ".jpg", ".nef", ".nrw",
".orf", ".pef", ".png", ".raf", ".raw", ".rw2", ".srw",
".svg", ".tiff", ".tif", ".webp",
};
const DocumentTypes = [_][]const u8{
".csv", ".doc", ".docx", ".epub", ".md", ".odt",
".pdf", ".ppt", ".pptx", ".rtf", ".txt", ".xls", ".xlsx",
};
const MusicTypes = [_][]const u8{
".aac", ".aiff", ".aif", ".alac", ".ape", ".flac",
".m4a", ".mid", ".midi", ".mp3", ".ogg", ".opus",
".wav", ".wma", ".wv",
};
const VideoTypes = [_][]const u8{
".3gp", ".avi", ".flv", ".m2ts", ".m4v", ".mkv",
".mov", ".mp4", ".mts", ".ogv", ".ts", ".vob",
".webm", ".wmv",
};
pub fn classify(name: []const u8) Category {
const extension = std.fs.path.extension(name);