mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Don't show non-existant channels as live
This commit is contained in:
parent
bdd5e4aae6
commit
e1a31785ef
1 changed files with 9 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue