Browse Source

dummy up m3u channel numbers

Luke Pulverenti 8 years ago
parent
commit
39e8e3cbe7
1 changed files with 13 additions and 0 deletions
  1. 13 0
      Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs

+ 13 - 0
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;
         }