From 8d4ba6d513810e8c65e5d8f7bc54e053afec8863 Mon Sep 17 00:00:00 2001 From: 0xboobface <0xboobface@gmail.com> Date: Tue, 28 Aug 2018 17:16:44 +0200 Subject: [PATCH] Fix status switching between FINISHED and DOWNLOADING Do not change the status from an update, if it is in the status DOWNLOADING. Reason: The FINISHED status is overwritten with DOWNLOADING, if the recording is downloading. But during the update of the recordings, it gets reset with the FINISHED status from the server until it is overriden again. --- src/main/java/ctbrec/ui/JavaFxRecording.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/ctbrec/ui/JavaFxRecording.java b/src/main/java/ctbrec/ui/JavaFxRecording.java index 2bc3e4db..313a7e75 100644 --- a/src/main/java/ctbrec/ui/JavaFxRecording.java +++ b/src/main/java/ctbrec/ui/JavaFxRecording.java @@ -3,6 +3,7 @@ package ctbrec.ui; import java.text.DecimalFormat; import java.time.Instant; +import ctbrec.Config; import ctbrec.Recording; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; @@ -113,6 +114,13 @@ public class JavaFxRecording extends Recording { } public void update(Recording updated) { + if(!Config.getInstance().getSettings().localRecording) { + if(getStatus() == STATUS.DOWNLOADING && updated.getStatus() != STATUS.DOWNLOADING) { + // ignore, because the the status coming from the server is FINISHED and we are + // overriding it with DOWNLOADING + return; + } + } setStatus(updated.getStatus()); setProgress(updated.getProgress()); setSizeInByte(updated.getSizeInByte());