Fix empty game update not updating header (#3609)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
James Upjohn 2022-03-20 07:58:19 +13:00 committed by GitHub
parent 495f4b15f4
commit 96e2d1f971
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 18 deletions

View file

@ -104,6 +104,7 @@
- Bugfix: Fixed automod and unban messages showing when moderation actions were disabled (#3548) - Bugfix: Fixed automod and unban messages showing when moderation actions were disabled (#3548)
- Bugfix: Fixed crash when rendering a highlight inside of a sub message, with sub message highlights themselves turned off. (#3556) - Bugfix: Fixed crash when rendering a highlight inside of a sub message, with sub message highlights themselves turned off. (#3556)
- BugFix: Fixed SplitInput placeholder color. (#3606) - BugFix: Fixed SplitInput placeholder color. (#3606)
- BugFix: Remove game from stream/split title when set to "nothing." (#3609)
- BugFix: Fixed double-clicking on usernames with right/middle click causing text selection. (#3608) - BugFix: Fixed double-clicking on usernames with right/middle click causing text selection. (#3608)
- Dev: Batch checking live status for channels with live notifications that aren't connected. (#3442) - Dev: Batch checking live status for channels with live notifications that aren't connected. (#3442)
- Dev: Add GitHub action to test builds without precompiled headers enabled. (#3327) - Dev: Add GitHub action to test builds without precompiled headers enabled. (#3327)

View file

@ -739,6 +739,8 @@ void TwitchChannel::parseLiveStatus(bool live, const HelixStream &stream)
{ {
status->gameId = stream.gameId; status->gameId = stream.gameId;
if (!stream.gameId.isEmpty())
{
// Resolve game ID to game name // Resolve game ID to game name
getHelix()->getGameById( getHelix()->getGameById(
stream.gameId, stream.gameId,
@ -760,6 +762,12 @@ void TwitchChannel::parseLiveStatus(bool live, const HelixStream &stream)
// failure // failure
}); });
} }
else
{
// Game is nothing and can't be resolved by the API, force empty
status->game = "";
}
}
status->title = stream.title; status->title = stream.title;
QDateTime since = QDateTime::fromString(stream.startedAt, Qt::ISODate); QDateTime since = QDateTime::fromString(stream.startedAt, Qt::ISODate);
auto diff = since.secsTo(QDateTime::currentDateTime()); auto diff = since.secsTo(QDateTime::currentDateTime());