Skip to content

Comments

runcommand 功能划分#58

Closed
NangInShell wants to merge 4 commits intomainfrom
main
Closed

runcommand 功能划分#58
NangInShell wants to merge 4 commits intomainfrom
main

Conversation

@NangInShell
Copy link
Owner

1, runcommand 功能划分
2, 子进程管理优化

@Tohrusky Tohrusky requested a review from Copilot September 17, 2025 21:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the runCommand functionality by extracting input and output video information gathering into separate functions, and optimizes subprocess management by removing redundant stdin cleanup.

  • Extracted video information gathering logic into dedicated functions for better code organization
  • Simplified subprocess management by removing duplicate stdin.end() call
  • Improved code maintainability through function separation

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/main/runCommand.ts Refactored runCommand by extracting getInputVideoInfo and getOutputVideoInfo functions
src/main/childProcessManager.ts Removed redundant ffmpeg.proc.stdin.end() call from safeUnpipe function

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +46 to +50
async function getInputVideoInfo(event: IpcMainEvent, video: string): Promise<{
hasAudio: boolean
hasSubtitle: boolean
videoStream: any
}> {
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The videoStream property should have a more specific type instead of 'any'. Consider defining an interface for the video stream structure or using a union type that represents the expected ffprobe output format.

Copilot uses AI. Check for mistakes.
Comment on lines +85 to +90
async function getOutputVideoInfo(event: IpcMainEvent, vpyPath: string): Promise<{
width: string
height: string
frames: string
fps: string
}> {
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using more specific types for numeric properties. Properties like width, height, frames could be number instead of string, and fps could be a number representing frames per second.

Copilot uses AI. Check for mistakes.
@NangInShell NangInShell closed this by deleting the head repository Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant