update recording path
This commit is contained in:
parent
287f797d99
commit
9edda5782b
|
@ -23,6 +23,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||||
_fileSystem = fileSystem;
|
_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)
|
public async Task Record(MediaSourceInfo mediaSource, string targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var httpRequestOptions = new HttpRequestOptions()
|
var httpRequestOptions = new HttpRequestOptions()
|
||||||
|
|
|
@ -898,10 +898,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||||
|
|
||||||
var recorder = await GetRecorder().ConfigureAwait(false);
|
var recorder = await GetRecorder().ConfigureAwait(false);
|
||||||
|
|
||||||
if (recorder is EncodedRecorder)
|
recordPath = recorder.GetOutputPath(mediaStreamInfo, recordPath);
|
||||||
{
|
|
||||||
recordPath = Path.ChangeExtension(recordPath, ".mp4");
|
|
||||||
}
|
|
||||||
recordPath = EnsureFileUnique(recordPath, timer.Id);
|
recordPath = EnsureFileUnique(recordPath, timer.Id);
|
||||||
_fileSystem.CreateDirectory(Path.GetDirectoryName(recordPath));
|
_fileSystem.CreateDirectory(Path.GetDirectoryName(recordPath));
|
||||||
activeRecordingInfo.Path = recordPath;
|
activeRecordingInfo.Path = recordPath;
|
||||||
|
|
|
@ -42,6 +42,16 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||||
_liveTvOptions = liveTvOptions;
|
_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)
|
public async Task Record(MediaSourceInfo mediaSource, string targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
if (mediaSource.RunTimeTicks.HasValue)
|
if (mediaSource.RunTimeTicks.HasValue)
|
||||||
|
|
|
@ -17,5 +17,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns>Task.</returns>
|
/// <returns>Task.</returns>
|
||||||
Task Record(MediaSourceInfo mediaSource, string targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken);
|
Task Record(MediaSourceInfo mediaSource, string targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken);
|
||||||
|
|
||||||
|
string GetOutputPath(MediaSourceInfo mediaSource, string targetFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user