refactor(command): inject CommandRunner instead of static

This commit is contained in:
2026-07-02 20:04:04 +01:00
parent 947c8261fd
commit 5bebea3f95
6 changed files with 36 additions and 34 deletions

View File

@@ -23,6 +23,11 @@ import java.util.stream.Collectors;
@Service
public class StreamActionsService {
private static final Logger logger = LoggerFactory.getLogger(StreamActionsService.class);
private final CommandRunner commandRunner;
public StreamActionsService(CommandRunner commandRunner) {
this.commandRunner = commandRunner;
}
/**
* Concatenates a list of video segments and extracts a trimmed section
@@ -71,7 +76,7 @@ public class StreamActionsService {
logger.info("Saving section with ({} segments) to '{}'",
segments.size(), outputFile);
CommandRunner.run(command, line -> CommandRunner.setProgress(line, progressTracker, duration));
commandRunner.run(command, line -> commandRunner.setProgress(line, progressTracker, duration));
progressTracker.markComplete();
return CompletableFuture.completedFuture(outputFile);