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

@@ -12,6 +12,11 @@ import java.util.List;
@Service
public class ThumbnailService {
private static final Logger logger = LoggerFactory.getLogger(ThumbnailService.class);
private final CommandRunner commandRunner;
public ThumbnailService(CommandRunner commandRunner) {
this.commandRunner = commandRunner;
}
@Async("ffmpegTaskExecutor")
public void createThumbnail(Path inputFile, Path outputFile, Float timeInVideo) throws IOException, InterruptedException {
@@ -25,6 +30,6 @@ public class ThumbnailService {
outputFile.toAbsolutePath().toString()
);
CommandRunner.run(command);
commandRunner.run(command);
}
}