From e1a31785efc4d46352af4ebf66ecf03b04b0bb56 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sat, 4 Nov 2017 12:42:37 +0100 Subject: [PATCH] Don't show non-existant channels as live --- src/widgets/chatwidgetheader.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/widgets/chatwidgetheader.cpp b/src/widgets/chatwidgetheader.cpp index eb5afe9bb..e7cc15726 100644 --- a/src/widgets/chatwidgetheader.cpp +++ b/src/widgets/chatwidgetheader.cpp @@ -97,8 +97,9 @@ void ChatWidgetHeader::updateChannelText() "
" "Live for " + twitchChannel->streamUptime + " with " + - twitchChannel->streamViewerCount + " viewers" - "

"); + twitchChannel->streamViewerCount + + " viewers" + "

"); } else { this->channelNameLabel.setText(QString::fromStdString(channelName)); this->setToolTip(""); @@ -213,6 +214,12 @@ void ChatWidgetHeader::checkLive() auto id = QString::fromStdString(channel->roomID); + if (id.isEmpty()) { + channel->isLive = false; + this->updateChannelText(); + return; + } + util::twitch::get("https://api.twitch.tv/kraken/streams/" + id, this, [=](QJsonObject obj) { if (obj.value("stream").isNull()) { channel->isLive = false;