diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-05-10 01:16:13 -0400 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2016-05-10 01:16:13 -0400 |
| commit | 2a49fa631abf6743a856f27bdaa3a53aac2e29dc (patch) | |
| tree | 0ba571e2880d93b077923ecb1822002939b0c757 /MediaBrowser.Server.Implementations/LiveTv | |
| parent | cfb0b96f30755af9526e35a7c78527509fa1ea2f (diff) | |
| parent | 9edda5782b6c6221e1b1def4e209b08c2f94ad9c (diff) | |
Merge pull request #1724 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Server.Implementations/LiveTv')
4 files changed, 22 insertions, 6 deletions
diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.cs index 54443d9ca..b21aa904b 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.cs @@ -23,6 +23,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV _fileSystem = fileSystem; } + public string GetOutputPath(MediaSourceInfo mediaSource, string targetFile) + { + return targetFile; + } + public async Task Record(MediaSourceInfo mediaSource, string targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken) { var httpRequestOptions = new HttpRequestOptions() diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index b5e8ad79a..2de51479f 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -898,10 +898,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV var recorder = await GetRecorder().ConfigureAwait(false); - if (recorder is EncodedRecorder) - { - recordPath = Path.ChangeExtension(recordPath, ".mp4"); - } + recordPath = recorder.GetOutputPath(mediaStreamInfo, recordPath); recordPath = EnsureFileUnique(recordPath, timer.Id); _fileSystem.CreateDirectory(Path.GetDirectoryName(recordPath)); activeRecordingInfo.Path = recordPath; @@ -1154,7 +1151,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV IncludeItemTypes = new[] { typeof(Episode).Name }, ParentIndexNumber = program.SeasonNumber.Value, IndexNumber = program.EpisodeNumber.Value, - AncestorIds = seriesIds + AncestorIds = seriesIds, + ExcludeLocationTypes = new[] { LocationType.Virtual } }); if (result.TotalRecordCount > 0) @@ -1169,7 +1167,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV { IncludeItemTypes = new[] { typeof(Episode).Name }, Name = program.EpisodeTitle, - AncestorIds = seriesIds + AncestorIds = seriesIds, + ExcludeLocationTypes = new[] { LocationType.Virtual } }); if (result.TotalRecordCount > 0) diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs index dec8ba83d..85b6ead07 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs @@ -42,6 +42,16 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV _liveTvOptions = liveTvOptions; } + public string GetOutputPath(MediaSourceInfo mediaSource, string targetFile) + { + if (_liveTvOptions.EnableOriginalAudioWithEncodedRecordings) + { + return Path.ChangeExtension(targetFile, ".mkv"); + } + + return Path.ChangeExtension(targetFile, ".mp4"); + } + public async Task Record(MediaSourceInfo mediaSource, string targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken) { if (mediaSource.RunTimeTicks.HasValue) diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/IRecorder.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/IRecorder.cs index 268a4f751..5706b6ae9 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/IRecorder.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/IRecorder.cs @@ -17,5 +17,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task.</returns> Task Record(MediaSourceInfo mediaSource, string targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken); + + string GetOutputPath(MediaSourceInfo mediaSource, string targetFile); } } |
