fixed live status being cached

This commit is contained in:
fourtf 2018-01-23 21:40:51 +01:00
parent dd05ea28fe
commit f292d2e097
3 changed files with 4 additions and 4 deletions

View file

@ -345,7 +345,7 @@ void ResourceManager::loadChannelData(const QString &roomID, bool bypassCache)
QString cheermoteURL = "https://api.twitch.tv/kraken/bits/actions?channel_id=" + roomID;
util::twitch::get2(
cheermoteURL, QThread::currentThread(), [this, roomID](const rapidjson::Document &d) {
cheermoteURL, QThread::currentThread(), true, [this, roomID](const rapidjson::Document &d) {
ResourceManager::Channel &ch = this->channels[roomID];
ParseCheermoteSets(ch.jsonCheermoteSets, d);

View file

@ -156,7 +156,7 @@ void TwitchChannel::refreshLiveStatus()
std::weak_ptr<Channel> weak = this->shared_from_this();
util::twitch::get2(url, QThread::currentThread(), [weak](const rapidjson::Document &d) {
util::twitch::get2(url, QThread::currentThread(), false, [weak](const rapidjson::Document &d) {
SharedChannel shared = weak.lock();
if (!shared) {

View file

@ -37,14 +37,14 @@ static void get(QString url, const QObject *caller,
});
}
static void get2(QString url, const QObject *caller,
static void get2(QString url, const QObject *caller, bool useQuickLoadCache,
std::function<void(const rapidjson::Document &)> successCallback)
{
util::NetworkRequest req(url);
req.setCaller(caller);
req.setRawHeader("Client-ID", getDefaultClientID());
req.setRawHeader("Accept", "application/vnd.twitchtv.v5+json");
req.setUseQuickLoadCache(true);
req.setUseQuickLoadCache(useQuickLoadCache);
req.getJSON2([=](const rapidjson::Document &document) {
successCallback(document); //