fix channel sorting (#54)

This commit is contained in:
Jason Dove
2021-03-09 03:40:13 +00:00
committed by GitHub
parent d53a2f8bbf
commit 54da3a3159
3 changed files with 7 additions and 4 deletions
+2 -2
View File
@@ -30,7 +30,7 @@ namespace ErsatzTV.Core.Iptv
xml.WriteStartElement("tv");
xml.WriteAttributeString("generator-info-name", "ersatztv");
foreach (Channel channel in _channels)
foreach (Channel channel in _channels.OrderBy(c => c.Number))
{
xml.WriteStartElement("channel");
xml.WriteAttributeString("id", channel.Number);
@@ -53,7 +53,7 @@ namespace ErsatzTV.Core.Iptv
xml.WriteEndElement(); // channel
}
foreach (Channel channel in _channels)
foreach (Channel channel in _channels.OrderBy(c => c.Number))
{
foreach (PlayoutItem playoutItem in channel.Playouts.Collect(p => p.Items).OrderBy(i => i.Start))
{
+2 -1
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ErsatzTV.Core.Domain;
using static LanguageExt.Prelude;
@@ -25,7 +26,7 @@ namespace ErsatzTV.Core.Iptv
var xmltv = $"{_scheme}://{_host}/iptv/xmltv.xml";
sb.AppendLine($"#EXTM3U url-tvg=\"{xmltv}\" x-tvg-url=\"{xmltv}\"");
foreach (Channel channel in _channels)
foreach (Channel channel in _channels.OrderBy(c => c.Number))
{
string logo = Optional(channel.Artwork).Flatten()
.Filter(a => a.ArtworkKind == ArtworkKind.Logo)