From 1d029fe083226d3f431554b9a47c2eaa8b25a8e7 Mon Sep 17 00:00:00 2001 From: Lkhsss Date: Sat, 15 Mar 2025 16:17:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 9 ++++++- Cargo.lock | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 2 +- README.md | 2 ++ src/clap.rs | 2 +- src/main.rs | 4 ++- 6 files changed, 85 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b517dfa..ef1b034 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,4 +48,11 @@ - 增加进度条支持(虽然很丑) - 增加覆盖保存开关 ### Refactoring -- :hammer: 重构代码!使用mpsc进行线程通讯。 \ No newline at end of file +- :hammer: 重构代码!使用mpsc进行线程通讯。 + + +## [2.5.10] - 2025.3.15 +### Features :sparkles: +- 重新进度条支持!美观了不少啊 +### Refactoring +- :hammer: 重构大量代码! diff --git a/Cargo.lock b/Cargo.lock index 60ea9fd..3827655 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -40,12 +40,56 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + [[package]] name = "anstyle" version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +[[package]] +name = "anstyle-parse" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +dependencies = [ + "anstyle", + "once_cell", + "windows-sys", +] + [[package]] name = "anyhow" version = "1.0.97" @@ -249,8 +293,10 @@ version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" dependencies = [ + "anstream", "anstyle", "clap_lex", + "strsim", ] [[package]] @@ -277,6 +323,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" +[[package]] +name = "colorchoice" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" + [[package]] name = "colored" version = "2.2.0" @@ -611,6 +663,12 @@ dependencies = [ "syn", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "itertools" version = "0.12.1" @@ -1151,6 +1209,12 @@ version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "syn" version = "2.0.100" @@ -1264,6 +1328,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "v_frame" version = "0.3.8" diff --git a/Cargo.toml b/Cargo.toml index b6d6ce3..3370a6a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ aes = { version = "0.8.4", default-features = false } audiotags = {version = "0.5.0",default-features = false} base64 = {version = "0.22.*"} chrono = {version = "0.4.*",features = ["clock"],default-features = false} -clap = { version = "4.5.*", features = ["derive","std"],default-features = false} +clap = { version = "4.5.*", features = ["derive","std"]} colored = {version = "*",default-features = false} env_logger = {version = "*",default-features = false} hex = "0.4.3" diff --git a/README.md b/README.md index e20b6e9..6d8a317 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,8 @@ Options: - [x] 自动覆盖开关 --- +# [Changelog](CHANGELOG.md) +--- # 附 - ncm文件结构 |信息|大小|作用| diff --git a/src/clap.rs b/src/clap.rs index 900ff08..e2a1b64 100644 --- a/src/clap.rs +++ b/src/clap.rs @@ -5,7 +5,7 @@ use clap::Parser; #[command(author = "lkhsss")] #[command(version,about = "一个解密ncm文件的神秘程序 By Lkhsss", long_about = None)] pub struct Cli { - /// 并发的最大线程数,默认为4线程 + /// 并发的最大线程数,默认为8线程 #[arg(short, long)] pub workers: Option, /// 需要解密的文件夹或文件 diff --git a/src/main.rs b/src/main.rs index 153c30d..1e5ad24 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,6 +21,8 @@ mod test; mod threadpool; use ncmdump::Ncmfile; +const DEFAULT_MAXWORKER:usize = 8; + fn main() { let timer = ncmdump::TimeCompare::new(); // 初始化日志系统 @@ -37,7 +39,7 @@ fn main() { 1 } } - None => 4, + None => DEFAULT_MAXWORKER, }; let input = cli.input;