Skip to content

Commit

Permalink
Fix twitch top streams not displaying game name
Browse files Browse the repository at this point in the history
Exclude jetbrains idea folder from source control
  • Loading branch information
laurencee committed Mar 8, 2022
1 parent 5b1ee36 commit 299e67f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,8 @@ GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml

# Jetbrains
.idea/

# Credentials
twitchaccesstoken.local
4 changes: 2 additions & 2 deletions GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("2.13.5.0")]
[assembly: AssemblyFileVersion("2.13.5.0")]
[assembly: AssemblyVersion("2.13.6.0")]
[assembly: AssemblyFileVersion("2.13.6.0")]
16 changes: 10 additions & 6 deletions Livestream.Monitor/Model/ApiClients/TwitchApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,16 +321,20 @@ public async Task<List<LivestreamQueryResult>> GetTopStreams(TopStreamQuery topS
};
topStreamsPaginationKeyMap[nextPageKeyLookup] = topStreams.Pagination?.Cursor;

return topStreams.Streams.Select(x =>
var queryResults = new List<LivestreamQueryResult>();
foreach (var stream in topStreams.Streams)
{
var channelIdentifier = new ChannelIdentifier(this, x.UserId) { DisplayName = x.UserName };
var channelIdentifier = new ChannelIdentifier(this, stream.UserId) { DisplayName = stream.UserName };
var queryResult = new LivestreamQueryResult(channelIdentifier);
var livestreamModel = new LivestreamModel(x.UserId, channelIdentifier);
livestreamModel.PopulateWithStreamDetails(x);
var livestreamModel = new LivestreamModel(stream.UserId, channelIdentifier);
livestreamModel.PopulateWithStreamDetails(stream);
livestreamModel.Game = await GetGameNameById(stream.GameId);

queryResult.LivestreamModel = livestreamModel;
return queryResult;
}).ToList();
queryResults.Add(queryResult);
}

return queryResults;
}

public async Task<List<KnownGame>> GetKnownGameNames(string filterGameName)
Expand Down

0 comments on commit 299e67f

Please sign in to comment.