Add game id

This commit is contained in:
2024-03-06 14:34:34 +00:00
parent 6003534272
commit 690c292a0a
2 changed files with 4 additions and 0 deletions

View File

@ -4,6 +4,9 @@ namespace NostrStreamer.ApiModel;
public class GameInfo
{
[JsonProperty("id")]
public string Id { get; init; } = null!;
[JsonProperty("name")]
public string Name { get; init; } = null!;

View File

@ -22,6 +22,7 @@ public class GameInfoController : Controller
var mapped = data?.Select(a => new GameInfo()
{
Id = $"igdb:{a.Id}",
Name = a.Name,
Cover = $"https://images.igdb.com/igdb/image/upload/t_cover_big_2x/{a.Cover?.ImageId}.jpg",
Genres = a.Genres.Select(b => b.Name).ToList()