From c7e39fdd9827df6fb4fb2b6eac118d5a7f39f19b Mon Sep 17 00:00:00 2001 From: 0xb00bface <0xboobface@gmail.com> Date: Sun, 23 Aug 2020 12:46:24 +0200 Subject: [PATCH] Fix MV Live models not showing up as recording MV Live models with spaces in the name would not show up as recording. --- client/src/main/java/ctbrec/ui/tabs/RecordedModelsTab.java | 5 ++--- common/src/main/java/ctbrec/AbstractModel.java | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/client/src/main/java/ctbrec/ui/tabs/RecordedModelsTab.java b/client/src/main/java/ctbrec/ui/tabs/RecordedModelsTab.java index 11890010..2521d99b 100644 --- a/client/src/main/java/ctbrec/ui/tabs/RecordedModelsTab.java +++ b/client/src/main/java/ctbrec/ui/tabs/RecordedModelsTab.java @@ -1,5 +1,6 @@ package ctbrec.ui.tabs; +import static ctbrec.Recording.State.*; import static ctbrec.SubsequentAction.*; import java.io.IOException; @@ -561,9 +562,7 @@ public class RecordedModelsTab extends Tab implements TabSelectionListener { .map(JavaFxModel::new) .peek(fxm -> { for (Recording recording : recordings) { - if(recording.getStatus() == Recording.State.RECORDING && - recording.getModel().getName().equals(fxm.getSanitizedNamed())) - { + if(recording.getStatus() == RECORDING && Objects.equals(recording.getModel(), fxm)){ fxm.getRecordingProperty().set(true); break; } diff --git a/common/src/main/java/ctbrec/AbstractModel.java b/common/src/main/java/ctbrec/AbstractModel.java index f87bb843..974e8380 100644 --- a/common/src/main/java/ctbrec/AbstractModel.java +++ b/common/src/main/java/ctbrec/AbstractModel.java @@ -171,7 +171,7 @@ public abstract class AbstractModel implements Model { if (getName() == null) { if (other.getName() != null) return false; - } else if (!getName().equals(other.getName())) + } else if (!getSanitizedNamed().equals(other.getSanitizedNamed())) return false; if (getUrl() == null) { if (other.getUrl() != null)