From 23070fa67ce11a62a07cd0c65b301218265ce264 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 24 Jan 2017 01:20:06 -0500 Subject: update m3u parsing --- Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs | 2 +- Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'Emby.Server.Implementations') diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs index cfcf51d46..352f4fe95 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs @@ -50,7 +50,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts protected override async Task> GetChannelsInternal(TunerHostInfo info, CancellationToken cancellationToken) { - return await new M3uParser(Logger, _fileSystem, _httpClient, _appHost).Parse(info.Url, ChannelIdPrefix, info.Id, !info.EnableTvgId, cancellationToken).ConfigureAwait(false); + return await new M3uParser(Logger, _fileSystem, _httpClient, _appHost).Parse(info.Url, ChannelIdPrefix, info.Id, cancellationToken).ConfigureAwait(false); } public Task> GetTunerInfos(CancellationToken cancellationToken) diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs index cf36f7c6a..81d1571b1 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs @@ -33,14 +33,14 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts _appHost = appHost; } - public async Task> Parse(string url, string channelIdPrefix, string tunerHostId, bool enableStreamUrlAsIdentifier, CancellationToken cancellationToken) + public async Task> Parse(string url, string channelIdPrefix, string tunerHostId, CancellationToken cancellationToken) { var urlHash = url.GetMD5().ToString("N"); // Read the file and display it line by line. using (var reader = new StreamReader(await GetListingsStream(url, cancellationToken).ConfigureAwait(false))) { - return GetChannels(reader, urlHash, channelIdPrefix, tunerHostId, enableStreamUrlAsIdentifier); + return GetChannels(reader, urlHash, channelIdPrefix, tunerHostId); } } @@ -51,7 +51,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts // Read the file and display it line by line. using (var reader = new StringReader(text)) { - return GetChannels(reader, urlHash, channelIdPrefix, tunerHostId, false); + return GetChannels(reader, urlHash, channelIdPrefix, tunerHostId); } } @@ -71,7 +71,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts } const string ExtInfPrefix = "#EXTINF:"; - private List GetChannels(TextReader reader, string urlHash, string channelIdPrefix, string tunerHostId, bool enableStreamUrlAsIdentifier) + private List GetChannels(TextReader reader, string urlHash, string channelIdPrefix, string tunerHostId) { var channels = new List(); string line; @@ -97,7 +97,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts else if (!string.IsNullOrWhiteSpace(extInf) && !line.StartsWith("#", StringComparison.OrdinalIgnoreCase)) { var channel = GetChannelnfo(extInf, tunerHostId, line); - if (string.IsNullOrWhiteSpace(channel.Id) || enableStreamUrlAsIdentifier) + if (string.IsNullOrWhiteSpace(channel.Id)) { channel.Id = channelIdPrefix + urlHash + line.GetMD5().ToString("N"); } -- cgit v1.2.3