Migrated getChannel to Helix (#2381)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
Paweł
2021-01-21 13:48:48 +01:00
committed by GitHub
parent a9b1af60de
commit 857705668e
9 changed files with 81 additions and 54 deletions
+17 -16
View File
@@ -599,25 +599,26 @@ void TwitchChannel::refreshTitle()
}
this->titleRefreshedTime_ = QTime::currentTime();
const auto onSuccess = [this,
weak = weakOf<Channel>(this)](const auto &channel) {
ChannelPtr shared = weak.lock();
if (!shared)
{
return;
}
getHelix()->getChannel(
roomID,
[this, weak = weakOf<Channel>(this)](HelixChannel channel) {
ChannelPtr shared = weak.lock();
{
auto status = this->streamStatus_.access();
status->title = channel.status;
}
if (!shared)
{
return;
}
this->liveStatusChanged.invoke();
};
{
auto status = this->streamStatus_.access();
status->title = channel.title;
}
const auto onFailure = [] {};
getKraken()->getChannel(roomID, onSuccess, onFailure);
this->liveStatusChanged.invoke();
},
[] {
// failure
});
}
void TwitchChannel::refreshLiveStatus()