LiveTV fixes

This commit is contained in:
Cody Robibero
2023-02-11 07:46:52 -07:00
parent 7b1bd9f234
commit 32eccc139c
4 changed files with 40 additions and 11 deletions

View File

@@ -67,4 +67,23 @@ public class XmlTvListingsProviderTests
Assert.Equal("https://domain.tld/image.png", program.ImageUrl);
Assert.Equal("3297", program.ChannelId);
}
[Theory]
[InlineData("Test Data/LiveTv/Listings/XmlTv/emptycategory.xml")]
[InlineData("https://example.com/emptycategory.xml")]
public async Task GetProgramsAsync_EmptyCategories_Success(string path)
{
var info = new ListingsProviderInfo()
{
Path = path
};
var startDate = new DateTime(2022, 11, 4);
var programs = await _xmlTvListingsProvider.GetProgramsAsync(info, "3297", startDate, startDate.AddDays(1), CancellationToken.None);
var programsList = programs.ToList();
Assert.Single(programsList);
var program = programsList[0];
Assert.DoesNotContain(program.Genres, g => string.Equals(g, string.Empty, StringComparison.Ordinal));
Assert.Equal("3297", program.ChannelId);
}
}

View File

@@ -0,0 +1,6 @@
<tv date="20221104">
<programme channel="3297" start="20221104130000 -0400" stop="20221105235959 -0400">
<category lang="en" />
<category lang="en">sports</category>
</programme>
</tv>