mirror of
https://git.aramjonghu.nl/AramJonghu/file-organizer.git
synced 2026-06-06 17:48:23 +02:00
archives support, builds .exe as well now
This commit is contained in:
@@ -5,6 +5,7 @@ pub const Category = enum {
|
||||
document,
|
||||
music,
|
||||
video,
|
||||
archive,
|
||||
code,
|
||||
other,
|
||||
};
|
||||
@@ -19,6 +20,7 @@ const CategoryMap = [_]CategoryEntry{
|
||||
.{ .category = .document, .extensions = &DocumentTypes },
|
||||
.{ .category = .music, .extensions = &MusicTypes },
|
||||
.{ .category = .video, .extensions = &VideoTypes },
|
||||
.{ .category = .archive, .extensions = &ArchiveTypes },
|
||||
};
|
||||
|
||||
const ImageTypes = [_][]const u8{
|
||||
@@ -42,6 +44,10 @@ const VideoTypes = [_][]const u8{
|
||||
".webm", ".wmv",
|
||||
};
|
||||
|
||||
const ArchiveTypes = [_][]const u8{
|
||||
".zip", ".rar", ".iso", ".tar", ".gz", ".7z", ".apk", ".cab", ".dar", ".dmg", ".jar", ".pea", ".tar.gz", ".tgz", ".tar.Z", ".tar.bz2", ".tbz2", ".tar.lz", ".tlz", ".tar.xz", ".txz", ".tar.zst",".war", ".zipx",
|
||||
};
|
||||
|
||||
pub fn classify(name: []const u8) Category {
|
||||
const extension = std.fs.path.extension(name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user