aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-01-14 14:57:08 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-01-14 14:57:08 -0500
commit95ceddb7d9c817f2e9233bd5116e7cb8ee76fc49 (patch)
tree2517ccb8609ed192edd4068c60edbc4fac9d1172 /Emby.Server.Implementations
parent4a73875ef3e5f754c27e2682548f0249fc88e480 (diff)
update m3uparser
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs17
1 files changed, 8 insertions, 9 deletions
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs
index 5be94b507..06a7a0c2d 100644
--- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs
+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs
@@ -14,6 +14,7 @@ using MediaBrowser.Controller;
using MediaBrowser.Controller.IO;
using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Model.Logging;
+using MediaBrowser.Model.Extensions;
namespace Emby.Server.Implementations.LiveTv.TunerHosts
{
@@ -273,20 +274,18 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
var reg = new Regex(@"([a-z0-9\-_]+)=\""([^""]+)\""", RegexOptions.IgnoreCase);
var matches = reg.Matches(line);
- var minIndex = int.MaxValue;
+
+ remaining = line;
+
foreach (Match match in matches)
{
- dict[match.Groups[1].Value] = match.Groups[2].Value;
- minIndex = Math.Min(minIndex, match.Index);
- }
+ var key = match.Groups[1].Value;
+ var value = match.Groups[2].Value;
- if (minIndex > 0 && minIndex < line.Length)
- {
- line = line.Substring(0, minIndex);
+ dict[match.Groups[1].Value] = match.Groups[2].Value;
+ remaining = remaining.Replace(key + "=\"" + value + "\"", string.Empty, StringComparison.OrdinalIgnoreCase);
}
- remaining = line;
-
return dict;
}
}