diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-06-14 02:40:21 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-06-14 02:40:21 -0400 |
| commit | 01c7dba742530e1274350bc9f8ea38a6ebc8e8f5 (patch) | |
| tree | aa271dbe7adc7477a102836d29e04faaef37e78e /MediaBrowser.Server.Implementations/LiveTv | |
| parent | 5f1bf17030853886feebfab97e7155571ea07a97 (diff) | |
don't auto-restart during recordings
Diffstat (limited to 'MediaBrowser.Server.Implementations/LiveTv')
| -rw-r--r-- | MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs | 25 |
2 files changed, 16 insertions, 11 deletions
diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs index 4022252ac..ffd5b65e4 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs @@ -145,7 +145,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV videoArgs = "-codec:v:0 copy"; } - var commandLineArgs = "-fflags +genpts -async 1 -vsync -1 -i \"{0}\" -t {4} -sn {2} -map_metadata -1 -threads 0 {3} -y \"{1}\""; + var commandLineArgs = "-fflags +genpts -async 1 -vsync -1 -re -i \"{0}\" -t {4} -sn {2} -map_metadata -1 -threads 0 {3} -y \"{1}\""; if (mediaSource.ReadAtNativeFramerate) { diff --git a/MediaBrowser.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs b/MediaBrowser.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs index 46794714c..1628ddc01 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs @@ -8,10 +8,10 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; - using Emby.XmlTv.Classes; using MediaBrowser.Common.Net; using MediaBrowser.Controller.Configuration; +using MediaBrowser.Model.Logging; namespace MediaBrowser.Server.Implementations.LiveTv.Listings { @@ -19,11 +19,13 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings { private readonly IServerConfigurationManager _config; private readonly IHttpClient _httpClient; + private readonly ILogger _logger; - public XmlTvListingsProvider(IServerConfigurationManager config, IHttpClient httpClient) + public XmlTvListingsProvider(IServerConfigurationManager config, IHttpClient httpClient, ILogger logger) { _config = config; _httpClient = httpClient; + _logger = logger; } public string Name @@ -55,6 +57,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings return cacheFile; } + _logger.Info("Downloading xmltv listings from {0}", path); + var tempFile = await _httpClient.GetTempFile(new HttpRequestOptions { CancellationToken = cancellationToken, @@ -101,10 +105,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings }); } - public Task AddMetadata(ListingsProviderInfo info, List<ChannelInfo> channels, CancellationToken cancellationToken) + public async Task AddMetadata(ListingsProviderInfo info, List<ChannelInfo> channels, CancellationToken cancellationToken) { // Add the channel image url - var reader = new XmlTvReader(info.Path, GetLanguage(), null); + var path = await GetXml(info.Path, cancellationToken).ConfigureAwait(false); + var reader = new XmlTvReader(path, GetLanguage(), null); var results = reader.GetChannels().ToList(); if (channels != null) @@ -120,8 +125,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings } }); } - - return Task.FromResult(true); } public Task Validate(ListingsProviderInfo info, bool validateLogin, bool validateListings) @@ -135,20 +138,22 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings return Task.FromResult(true); } - public Task<List<NameIdPair>> GetLineups(ListingsProviderInfo info, string country, string location) + public async Task<List<NameIdPair>> GetLineups(ListingsProviderInfo info, string country, string location) { // In theory this should never be called because there is always only one lineup - var reader = new XmlTvReader(info.Path, GetLanguage(), null); + var path = await GetXml(info.Path, CancellationToken.None).ConfigureAwait(false); + var reader = new XmlTvReader(path, GetLanguage(), null); var results = reader.GetChannels(); // Should this method be async? - return Task.FromResult(results.Select(c => new NameIdPair() { Id = c.Id, Name = c.DisplayName }).ToList()); + return results.Select(c => new NameIdPair() { Id = c.Id, Name = c.DisplayName }).ToList(); } public async Task<List<ChannelInfo>> GetChannels(ListingsProviderInfo info, CancellationToken cancellationToken) { // In theory this should never be called because there is always only one lineup - var reader = new XmlTvReader(info.Path, GetLanguage(), null); + var path = await GetXml(info.Path, cancellationToken).ConfigureAwait(false); + var reader = new XmlTvReader(path, GetLanguage(), null); var results = reader.GetChannels(); // Should this method be async? |
