From 96e2d1f97174751e0f59f2c3baeb2a6697bcc196 Mon Sep 17 00:00:00 2001 From: James Upjohn Date: Sun, 20 Mar 2022 07:58:19 +1300 Subject: [PATCH] Fix empty game update not updating header (#3609) Co-authored-by: pajlada --- CHANGELOG.md | 1 + src/providers/twitch/TwitchChannel.cpp | 44 +++++++++++++++----------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ceb6a0dab..c5b2e939a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -104,6 +104,7 @@ - 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 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) - 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) diff --git a/src/providers/twitch/TwitchChannel.cpp b/src/providers/twitch/TwitchChannel.cpp index 93b19fcb0..49e721be9 100644 --- a/src/providers/twitch/TwitchChannel.cpp +++ b/src/providers/twitch/TwitchChannel.cpp @@ -739,26 +739,34 @@ void TwitchChannel::parseLiveStatus(bool live, const HelixStream &stream) { status->gameId = stream.gameId; - // Resolve game ID to game name - getHelix()->getGameById( - stream.gameId, - [this, weak = weakOf(this)](const auto &game) { - ChannelPtr shared = weak.lock(); - if (!shared) - { - return; - } + if (!stream.gameId.isEmpty()) + { + // Resolve game ID to game name + getHelix()->getGameById( + stream.gameId, + [this, weak = weakOf(this)](const auto &game) { + ChannelPtr shared = weak.lock(); + if (!shared) + { + return; + } - { - auto status = this->streamStatus_.access(); - status->game = game.name; - } + { + auto status = this->streamStatus_.access(); + status->game = game.name; + } - this->liveStatusChanged.invoke(); - }, - [] { - // failure - }); + this->liveStatusChanged.invoke(); + }, + [] { + // failure + }); + } + else + { + // Game is nothing and can't be resolved by the API, force empty + status->game = ""; + } } status->title = stream.title; QDateTime since = QDateTime::fromString(stream.startedAt, Qt::ISODate);