diff --git a/ExternalAPIs.Tests/YoutubeClientShould.cs b/ExternalAPIs.Tests/YoutubeClientShould.cs index c7daa0c..84769ab 100644 --- a/ExternalAPIs.Tests/YoutubeClientShould.cs +++ b/ExternalAPIs.Tests/YoutubeClientShould.cs @@ -7,7 +7,8 @@ namespace ExternalAPIs.Tests { public class YoutubeClientShould { - private const string SKY_NEWS_VIDEO_ID = "y60wDzZt8yg"; + private const string SKY_NEWS_VIDEO_ID = "siyW0GOBtbo"; + private const string SKY_NEWS_CHANNEL_ID = "UCoMdktPbSTixAyNGwb-UYkQ"; private readonly YoutubeReadonlyClient sut = new YoutubeReadonlyClient(); [Fact, Trait("Category", "LocalOnly")] @@ -37,7 +38,7 @@ public async Task ThrowNotFoudExceptionForInvalidVideoId() [Fact, Trait("Category", "LocalOnly")] public async Task GetChannelIdFromUsername() { - const string channelName = "LoLChampSeries"; + const string channelName = "skynews"; var channelId = await sut.GetChannelIdFromUsername(channelName); Assert.NotNull(channelId); @@ -46,9 +47,7 @@ public async Task GetChannelIdFromUsername() [Fact, Trait("Category", "LocalOnly")] public async Task GetLiveVideos() { - // channelId of the value returned by the test "GetChannelIdFromUsername" - const string channelId = "UCvqRdlKsE5Q8mf8YXbdIJLw"; - var onlineVideos = await sut.GetLivestreamVideos(channelId); + var onlineVideos = await sut.GetLivestreamVideos(SKY_NEWS_CHANNEL_ID); Assert.NotNull(onlineVideos); Assert.NotNull(onlineVideos.Items); diff --git a/GlobalAssemblyInfo.cs b/GlobalAssemblyInfo.cs index 7cb98b8..b7adc97 100644 --- a/GlobalAssemblyInfo.cs +++ b/GlobalAssemblyInfo.cs @@ -22,5 +22,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.12.5.0")] -[assembly: AssemblyFileVersion("2.12.5.0")] \ No newline at end of file +[assembly: AssemblyVersion("2.12.6.0")] +[assembly: AssemblyFileVersion("2.12.6.0")] \ No newline at end of file diff --git a/Livestream.Monitor/Model/LivestreamModel.cs b/Livestream.Monitor/Model/LivestreamModel.cs index 8fa1b7d..62c28e5 100644 --- a/Livestream.Monitor/Model/LivestreamModel.cs +++ b/Livestream.Monitor/Model/LivestreamModel.cs @@ -168,9 +168,17 @@ public string Language } } - public Task GetStreamUrl => ApiClient?.GetStreamUrl(ChannelIdentifier.ChannelId); - - public Task GetChatUrl => ApiClient?.GetChatUrl(ChannelIdentifier.ChannelId); + public Task GetStreamUrl => ApiClient?.GetStreamUrl( + ApiClient.ApiName == YoutubeApiClient.API_NAME + ? Id // hack as youtube can return multiple livestreams for a channel and we store the video id in this field + : ChannelIdentifier.ChannelId + ); + + public Task GetChatUrl => ApiClient?.GetChatUrl( + ApiClient.ApiName == YoutubeApiClient.API_NAME + ? Id // hack as youtube can return multiple livestreams for a channel and we store the video id in this field + : ChannelIdentifier.ChannelId + ); /// The username this livestream came from via importing (twitch allows importing followed streams) public string ImportedBy { get; set; }