fixed live status being cached
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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); //
|
||||
|
||||
Reference in New Issue
Block a user