From c0090f6f134171bb8c911cda39149550c8d304b0 Mon Sep 17 00:00:00 2001 From: laurencee Date: Sat, 16 Jan 2016 07:28:14 +1000 Subject: [PATCH] Map language to broadcaster language instead, we only care about what language is being spoken on the stream. Issue #2 Added missing json property mapping for Channel.BroadcasterLanguage --- Livestream.Monitor/Model/TwitchToModelMaps.cs | 4 ++-- TwitchTv/Dto/Channel.cs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Livestream.Monitor/Model/TwitchToModelMaps.cs b/Livestream.Monitor/Model/TwitchToModelMaps.cs index a6718d8..80c3b98 100644 --- a/Livestream.Monitor/Model/TwitchToModelMaps.cs +++ b/Livestream.Monitor/Model/TwitchToModelMaps.cs @@ -24,7 +24,7 @@ public static LivestreamModel ToLivestreamModel(this Follow follow, string impor Game = follow.Channel?.Game, IsPartner = follow.Channel?.Partner != null && follow.Channel.Partner.Value, ImportedBy = importedBy, - Language = follow.Channel?.Language + Language = follow.Channel?.BroadcasterLanguage }; } @@ -77,7 +77,7 @@ public static void PopulateWithChannel(this LivestreamModel livestreamModel, Cha livestreamModel.Description = channel.Status; livestreamModel.Game = channel.Game; livestreamModel.IsPartner = channel.Partner.HasValue && channel.Partner.Value; - livestreamModel.Language = channel.Language; + livestreamModel.Language = channel.BroadcasterLanguage; } } } diff --git a/TwitchTv/Dto/Channel.cs b/TwitchTv/Dto/Channel.cs index 06822db..cb6cbc7 100644 --- a/TwitchTv/Dto/Channel.cs +++ b/TwitchTv/Dto/Channel.cs @@ -11,6 +11,7 @@ public class Channel public object Banner { get; set; } + [JsonProperty("broadcaster_language")] public string BroadcasterLanguage { get; set; } [JsonProperty("display_name")]