Skip to content

Commit

Permalink
Server: Avoid the dumb way of doing this.
Browse files Browse the repository at this point in the history
  • Loading branch information
e3ndr committed Sep 23, 2023
1 parent 34abda1 commit 1834e01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import co.casterlabs.rakurai.json.annotating.JsonExclude;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import xyz.e3ndr.athena.types.AudioCodec;
import xyz.e3ndr.athena.types.ContainerFormat;
Expand Down Expand Up @@ -38,7 +37,7 @@ public class TranscodeSession {
private double encodingProgress = 0;
private double encodingSpeed = 0;

private @Setter boolean isComplete;
private boolean isComplete;

@JsonExclude
@ToString.Exclude
Expand Down Expand Up @@ -78,6 +77,10 @@ public void processStatistic(String ffmpegLine) {

long currentTime = timestampToMillis(timeStr);
this.encodingProgress = (double) currentTime / this.duration;

if (this.encodingProgress == 1) {
this.isComplete = true;
}
}

{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ public static TranscodeSession start(File targetFile, Media media, VideoQuality
if (!hasStarted) {
startPromise.resolve(null); // Just in case...
}

session.setComplete(true);
}
});

Expand Down

0 comments on commit 1834e01

Please sign in to comment.