From b447c76dac23101da098ea42d795369b1dd75eda Mon Sep 17 00:00:00 2001 From: 0xboobface <0xboobface@gmail.com> Date: Fri, 9 Nov 2018 14:30:30 +0100 Subject: [PATCH] Don't fetch stream resolution if model is offline --- src/main/java/ctbrec/sites/bonga/BongaCamsModel.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/ctbrec/sites/bonga/BongaCamsModel.java b/src/main/java/ctbrec/sites/bonga/BongaCamsModel.java index da19f5b0..4014ae8c 100644 --- a/src/main/java/ctbrec/sites/bonga/BongaCamsModel.java +++ b/src/main/java/ctbrec/sites/bonga/BongaCamsModel.java @@ -171,12 +171,15 @@ public class BongaCamsModel extends AbstractModel { return new int[2]; } try { + if(!isOnline()) { + return new int[2]; + } List streamSources = getStreamSources(); Collections.sort(streamSources); StreamSource best = streamSources.get(streamSources.size()-1); resolution = new int[] {best.width, best.height}; - } catch (ExecutionException | IOException | ParseException | PlaylistException e) { - LOG.error("Couldn't determine stream resolution for {}", getName(), e); + } catch (ExecutionException | IOException | ParseException | PlaylistException | InterruptedException e) { + LOG.warn("Couldn't determine stream resolution for {} - {}", getName(), e.getMessage()); } return resolution; } else {