aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-02-01 15:56:41 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-02-01 15:56:41 -0500
commit39e8e3cbe7865ba618c67c612a191b134f5ad186 (patch)
tree685c146f582fd05836e1ddaede21d1cbb72c003c
parent819efd2a7db5c393bec17e497a400a29c7dcb386 (diff)
dummy up m3u channel numbers
-rw-r--r--Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs
index bac9664c5..088c264f0 100644
--- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs
+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs
@@ -76,6 +76,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
var channels = new List<M3UChannel>();
string line;
string extInf = "";
+
while ((line = reader.ReadLine()) != null)
{
line = line.Trim();
@@ -111,6 +112,18 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
extInf = "";
}
}
+
+ var startingNumber = 1;
+ foreach (var channel in channels)
+ {
+ if (!string.IsNullOrWhiteSpace(channel.Number))
+ {
+ continue;
+ }
+
+ channel.Number = startingNumber.ToString(CultureInfo.InvariantCulture);
+ startingNumber++;
+ }
return channels;
}