更新自动打开文件夹功能
Some checks failed
Release / Publish to Github Releases (, macos-latest, aarch64-apple-darwin, true) (push) Has been cancelled
Release / Publish to Github Releases (, macos-latest, x86_64-apple-darwin) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, aarch64-unknown-linux-musl, true) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, arm-unknown-linux-musleabihf, true) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, armv7-unknown-linux-musleabihf, true) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, i686-unknown-linux-musl, true) (push) Has been cancelled
Release / Publish to Github Releases (, ubuntu-latest, x86_64-unknown-linux-musl, true) (push) Has been cancelled
Release / Publish to Github Releases (, windows-latest, aarch64-pc-windows-msvc, true) (push) Has been cancelled
Release / Publish to Github Releases (, windows-latest, i686-pc-windows-msvc, true) (push) Has been cancelled
Release / Publish to Github Releases (, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
Release / Publish to crates.io (push) Has been cancelled

This commit is contained in:
Lkhsss
2025-03-15 17:09:57 +08:00
parent 9d4c7d57b8
commit a6f37a961c
7 changed files with 57 additions and 5 deletions

View File

@ -57,3 +57,7 @@
- 重新进度条支持!美观了不少啊
### Refactoring
- :hammer: 重构大量代码!
## [2.6.11] - 2025.3.15
### Features :sparkles:
- 更新自动打开文件夹选项,当解密结束后自动调用文件管理器打开输出目录

2
Cargo.lock generated
View File

@ -811,7 +811,7 @@ checksum = "07dcca13d1740c0a665f77104803360da0bdb3323ecce2e93fa2c959a6d52806"
[[package]]
name = "ncmmiao"
version = "2.5.11"
version = "2.6.11"
dependencies = [
"aes",
"audiotags",

View File

@ -1,6 +1,6 @@
[package]
name = "ncmmiao"
version = "2.5.11"
version = "2.6.11"
edition = "2021"
authors = ["Lkhsss <lkhsss1019@gmail.com>"]
description = "A magic tool convert ncm to flac"

View File

@ -1,14 +1,16 @@
# NcmMiao :tada:
[![build](https://github.com/Lkhsss/NcmMiao/actions/workflows/build.yml/badge.svg?event=push)](https://github.com/Lkhsss/NcmMiao/actions/workflows/build.yml)
一个使用Rust语言编写的ncm文件解密工具(第一!😆)
一个使用Rust语言编写的ncm文件解密工具😆
### 功能及特点
- 支持单一文件,多文件夹递归批量解密。
- 完善的日志功能
- Colorful
- 编译文件小,解密快
- [New!]支持自动添加封面!
- 支持自动添加封面!
- 自动打开输出文件夹
- 简约美观
## 编译
```

View File

@ -19,4 +19,8 @@ pub struct Cli {
/// 强制覆盖保存开关
#[arg(short, long, name = "强制覆盖开关")]
pub forcesave: bool,
/// 自动打开输出目录
#[arg(short,long,name="自动打开输出目录")]
pub autoopen:bool,
}

View File

@ -19,6 +19,7 @@ mod ncmdump;
mod pathparse;
mod test;
mod threadpool;
mod opendir;
use ncmdump::Ncmfile;
const DEFAULT_MAXWORKER:usize = 8;
@ -118,7 +119,14 @@ fn main() {
successful.to_string().bright_green(),
(taskcount - successful).to_string().bright_red(),
showtime()
)
);
// 自动打开输出文件夹
if cli.autoopen{
opendir::opendir(outputdir.into());
};
}
lazy_static! {

34
src/opendir.rs Normal file
View File

@ -0,0 +1,34 @@
use log::error;
use std::{path::PathBuf, process::Command};
#[cfg(target_os = "windows")]
pub fn opendir(dir: PathBuf) {
match Command::new("explorer")
.arg(&dir) // <- Specify the directory you'd like to open.
.spawn()
{
Err(_) => error!("无法打开输出文件夹:[{}]", dir.display()),
_ => (),
}
}
#[cfg(target_os = "linux")]
pub fn opendir(dir: PathBuf) {
match Command::new("open")
.arg(&dir) // <- Specify the directory you'd like to open.
.spawn()
{
Err(_) => error!("无法打开输出文件夹:[{}]", dir.display()),
_ => (),
}
}
#[cfg(target_os = "macos")]
pub fn opendir(dir: PathBuf) {
match Command::new("open")
.arg(&dir) // <- Specify the directory you'd like to open.
.spawn()
{
Err(_) => error!("无法打开输出文件夹:[{}]", dir.display()),
_ => (),
}
}