Extract database clip saving into saveClip()

persistClip() had grown too large and handled multiple concerns.
This change moves the database save logic into saveClip(), making
persistClip() smaller and easier to refactor further.
This commit is contained in:
2025-12-15 22:06:57 +00:00
parent 65ec8cb29a
commit eed46cf266
2 changed files with 34 additions and 18 deletions

View File

@@ -119,10 +119,10 @@ public class JobService {
try {
Optional<User> user = userService.getLoggedInUser();
compressionService.compress(job.getInputFile(), job.getOutputFile(), job.getOutputClipOptions(), job.getStatus().getProcess())
.thenRun(() -> user.ifPresent(value ->
.thenRun(() -> user.ifPresent(userVal ->
clipService.persistClip(
job.getOutputClipOptions(),
value,
userVal,
job.getOutputFile(),
job.getInputFile().getName()
)