diff --git a/Cargo.lock b/Cargo.lock index 9219c4a..7e62547 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -395,7 +395,7 @@ dependencies = [ [[package]] name = "biliup-cli" -version = "1.1.15" +version = "1.1.16" dependencies = [ "async-channel", "async-trait", @@ -3641,7 +3641,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "stream-gears" -version = "1.1.15" +version = "1.1.16" dependencies = [ "async-channel", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 8caf952..9621f53 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ members = [ resolver = "3" [workspace.package] -version = "1.1.15" +version = "1.1.16" [workspace.dependencies] serde = { version = "1.0", features = ["derive"] } diff --git a/crates/biliup-cli/src/server/infrastructure/models/hook_step.rs b/crates/biliup-cli/src/server/infrastructure/models/hook_step.rs index 4be3eac..81e1139 100644 --- a/crates/biliup-cli/src/server/infrastructure/models/hook_step.rs +++ b/crates/biliup-cli/src/server/infrastructure/models/hook_step.rs @@ -126,6 +126,22 @@ impl HookStep { fs::rename(video_path, destination) .await .change_context(AppError::Unknown)?; + + let buf = video_path.with_extension("xml"); + if buf.exists() { + let file_name = buf + .file_name() + .ok_or(AppError::Custom("Invalid file name".to_string()))?; + let destination = target_path.join(file_name); + fs::rename(&buf, &destination) + .await + .change_context(AppError::Unknown)?; + info!( + "移动弹幕文件: Moving {} to {}", + buf.display(), + destination.display() + ); + } } Ok(()) }