diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-01-25 15:25:50 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-25 15:25:50 -0500 |
| commit | d0f58ac0bfb99bd0759c3338292d0c2014067f42 (patch) | |
| tree | b18a7b9e395e8319c300ac9cdf78ad1e7dea675c /Emby.Server.Implementations | |
| parent | 9a3aa83ce3e7304690a712cd780b60d498338fa7 (diff) | |
| parent | 8f780269cbf8b9b1000f83432262e93c487164eb (diff) | |
Merge pull request #2420 from MediaBrowser/dev
update m3u parsing
Diffstat (limited to 'Emby.Server.Implementations')
3 files changed, 8 insertions, 8 deletions
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs index 352f4fe95..601cb2666 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<IEnumerable<ChannelInfo>> GetChannelsInternal(TunerHostInfo info, CancellationToken cancellationToken) { - return await new M3uParser(Logger, _fileSystem, _httpClient, _appHost).Parse(info.Url, ChannelIdPrefix, info.Id, cancellationToken).ConfigureAwait(false); + return await new M3uParser(Logger, _fileSystem, _httpClient, _appHost).Parse(info.Url, ChannelIdPrefix, info.Id, !info.EnableTvgId, cancellationToken).ConfigureAwait(false); } public Task<List<LiveTvTunerInfo>> GetTunerInfos(CancellationToken cancellationToken) @@ -176,4 +176,4 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts return Task.FromResult(true); } } -} +}
\ No newline at end of file diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs index 1fe6e75a9..5e191ada9 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<List<M3UChannel>> Parse(string url, string channelIdPrefix, string tunerHostId, CancellationToken cancellationToken) + public async Task<List<M3UChannel>> Parse(string url, string channelIdPrefix, string tunerHostId, bool enableStreamUrlAsIdentifier, 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); + return GetChannels(reader, urlHash, channelIdPrefix, tunerHostId, enableStreamUrlAsIdentifier); } } @@ -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); + return GetChannels(reader, urlHash, channelIdPrefix, tunerHostId, false); } } @@ -71,7 +71,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts } const string ExtInfPrefix = "#EXTINF:"; - private List<M3UChannel> GetChannels(TextReader reader, string urlHash, string channelIdPrefix, string tunerHostId) + private List<M3UChannel> GetChannels(TextReader reader, string urlHash, string channelIdPrefix, string tunerHostId, bool enableStreamUrlAsIdentifier) { var channels = new List<M3UChannel>(); 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)) + if (string.IsNullOrWhiteSpace(channel.Id) || enableStreamUrlAsIdentifier) { channel.Id = channelIdPrefix + urlHash + line.GetMD5().ToString("N"); } diff --git a/Emby.Server.Implementations/Migrations/GuideMigration.cs b/Emby.Server.Implementations/Migrations/GuideMigration.cs index 2e0219f93..71286b282 100644 --- a/Emby.Server.Implementations/Migrations/GuideMigration.cs +++ b/Emby.Server.Implementations/Migrations/GuideMigration.cs @@ -27,7 +27,7 @@ namespace Emby.Server.Implementations.Migrations public async Task Run() { - var name = "GuideRefresh1"; + var name = "GuideRefresh2"; if (!_config.Configuration.Migrations.Contains(name, StringComparer.OrdinalIgnoreCase)) { |
