From d9624cf42f21e0c9718a1f21d71d2c3ab526dcae Mon Sep 17 00:00:00 2001 From: Yifan Song <41675306+Eric-Song-Nop@users.noreply.github.com> Date: Tue, 8 Aug 2023 15:33:03 +0800 Subject: [PATCH 1/3] fix: theme doc path typo (#34) --- config/docs/theme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/docs/theme.md b/config/docs/theme.md index 881b03f1..4e777abb 100644 --- a/config/docs/theme.md +++ b/config/docs/theme.md @@ -1,3 +1,3 @@ # Theme -Just some colors, feel free to modify as you like, following the format in [../config/theme.toml](../config/theme.toml). +Just some colors, feel free to modify as you like, following the format in [../preset/theme.toml](../preset/theme.toml). From e123137823aeedee56f39c720094d3c22bcdb8b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E9=9B=85=20=C2=B7=20Misaki=20Masa?= Date: Tue, 8 Aug 2023 15:47:27 +0800 Subject: [PATCH 2/3] fix: unknown mime-type of `inode/x-empty` (#36) --- core/src/manager/preview.rs | 1 + shared/src/mime.rs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/core/src/manager/preview.rs b/core/src/manager/preview.rs index 65adce72..db303eb9 100644 --- a/core/src/manager/preview.rs +++ b/core/src/manager/preview.rs @@ -59,6 +59,7 @@ impl Preview { self.handle = Some(tokio::spawn(async move { let result = match kind { + MimeKind::Empty => Ok(PreviewData::None), MimeKind::Archive => Self::archive(&path).await.map(PreviewData::Text), MimeKind::Dir => Self::folder(&path).await, MimeKind::Image => Self::image(&path).await, diff --git a/shared/src/mime.rs b/shared/src/mime.rs index be0af996..a59df274 100644 --- a/shared/src/mime.rs +++ b/shared/src/mime.rs @@ -2,6 +2,8 @@ pub const MIME_DIR: &str = "inode/directory"; #[derive(Clone, Copy, PartialEq, Eq)] pub enum MimeKind { + Empty, + Archive, Dir, @@ -17,6 +19,10 @@ pub enum MimeKind { impl MimeKind { pub fn valid(s: &str) -> bool { + if s == "inode/x-empty" { + return true; + } + let parts = s.split('/').collect::>(); if parts.len() != 2 { return false; @@ -47,6 +53,8 @@ impl MimeKind { Self::Image } else if s.starts_with("video/") { Self::Video + } else if s == "inode/x-empty" { + Self::Empty } else if s == "application/json" { Self::JSON } else if s == "application/pdf" { From f9836f2f8ab25b91bd1758699cd4df5e48b6d532 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Tue, 8 Aug 2023 18:38:17 +0800 Subject: [PATCH 3/3] chore: rename bin (#33) --- app/Cargo.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Cargo.toml b/app/Cargo.toml index dc0f145a..239afaed 100644 --- a/app/Cargo.toml +++ b/app/Cargo.toml @@ -23,3 +23,7 @@ tokio = { version = "^1", features = [ "parking_lot" ] } tracing = "^0" tracing-appender = "^0" tracing-subscriber = "^0" + +[[bin]] +name = "yazi" +path = "src/main.rs"