From 1b9b0998e1cda3225dd09f0f463cff56512e811d Mon Sep 17 00:00:00 2001 From: 0xboobface <0xboobface@gmail.com> Date: Wed, 25 Jul 2018 14:55:02 +0200 Subject: [PATCH] Added plausibility check for resolution If a model is online and the resolution is 0, we remove that value from the cache, so that it is requested again and we hopefully get a good value. --- src/main/java/ctbrec/ui/ThumbCell.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/ctbrec/ui/ThumbCell.java b/src/main/java/ctbrec/ui/ThumbCell.java index 895dd680..2c7e3ca6 100644 --- a/src/main/java/ctbrec/ui/ThumbCell.java +++ b/src/main/java/ctbrec/ui/ThumbCell.java @@ -248,6 +248,13 @@ public class ThumbCell extends StackPane { resolutionBackground.setVisible(true); resolutionBackground.setWidth(resolutionTag.getBoundsInLocal().getWidth() + 4); }); + + // the model is online, but the resolution is 0. probably something went wrong + // when we first requested the stream info, so we remove this invalid value from the "cache" + // so that it is requested again + if(model.isOnline() && res[1] == 0) { + resolutions.remove(model.getName()); + } } } @@ -524,6 +531,8 @@ public class ThumbCell extends StackPane { setRecording(recorder.isRecording(model)); setImage(model.getPreview()); topic.setText(model.getDescription()); + //Tooltip t = new Tooltip(model.getDescription()); + //Tooltip.install(this, t); if(Config.getInstance().getSettings().determineResolution) { determineResolution(); } else {