Don't show non-existant channels as live
This commit is contained in:
@@ -97,8 +97,9 @@ void ChatWidgetHeader::updateChannelText()
|
|||||||
"<br>"
|
"<br>"
|
||||||
"Live for " +
|
"Live for " +
|
||||||
twitchChannel->streamUptime + " with " +
|
twitchChannel->streamUptime + " with " +
|
||||||
twitchChannel->streamViewerCount + " viewers"
|
twitchChannel->streamViewerCount +
|
||||||
"</p>");
|
" viewers"
|
||||||
|
"</p>");
|
||||||
} else {
|
} else {
|
||||||
this->channelNameLabel.setText(QString::fromStdString(channelName));
|
this->channelNameLabel.setText(QString::fromStdString(channelName));
|
||||||
this->setToolTip("");
|
this->setToolTip("");
|
||||||
@@ -213,6 +214,12 @@ void ChatWidgetHeader::checkLive()
|
|||||||
|
|
||||||
auto id = QString::fromStdString(channel->roomID);
|
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) {
|
util::twitch::get("https://api.twitch.tv/kraken/streams/" + id, this, [=](QJsonObject obj) {
|
||||||
if (obj.value("stream").isNull()) {
|
if (obj.value("stream").isNull()) {
|
||||||
channel->isLive = false;
|
channel->isLive = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user