mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
update search
This commit is contained in:
parent
35e83dc73d
commit
c1e83beeac
@ -979,16 +979,16 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
|||||||
|
|
||||||
var recordPath = GetRecordingPath(timer, info);
|
var recordPath = GetRecordingPath(timer, info);
|
||||||
var recordingStatus = RecordingStatus.New;
|
var recordingStatus = RecordingStatus.New;
|
||||||
|
var isResourceOpen = false;
|
||||||
|
SemaphoreSlim semaphore = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var result = await GetChannelStreamInternal(timer.ChannelId, null, CancellationToken.None).ConfigureAwait(false);
|
var result = await GetChannelStreamInternal(timer.ChannelId, null, CancellationToken.None).ConfigureAwait(false);
|
||||||
|
isResourceOpen = true;
|
||||||
|
semaphore = result.Item3;
|
||||||
var mediaStreamInfo = result.Item1;
|
var mediaStreamInfo = result.Item1;
|
||||||
var isResourceOpen = true;
|
|
||||||
|
|
||||||
// Unfortunately due to the semaphore we have to have a nested try/finally
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// HDHR doesn't seem to release the tuner right away after first probing with ffmpeg
|
// HDHR doesn't seem to release the tuner right away after first probing with ffmpeg
|
||||||
//await Task.Delay(3000, cancellationToken).ConfigureAwait(false);
|
//await Task.Delay(3000, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
@ -1031,16 +1031,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
|||||||
recordingStatus = RecordingStatus.Completed;
|
recordingStatus = RecordingStatus.Completed;
|
||||||
_logger.Info("Recording completed: {0}", recordPath);
|
_logger.Info("Recording completed: {0}", recordPath);
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (isResourceOpen)
|
|
||||||
{
|
|
||||||
result.Item3.Release();
|
|
||||||
}
|
|
||||||
|
|
||||||
_libraryMonitor.ReportFileSystemChangeComplete(recordPath, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (OperationCanceledException)
|
catch (OperationCanceledException)
|
||||||
{
|
{
|
||||||
_logger.Info("Recording stopped: {0}", recordPath);
|
_logger.Info("Recording stopped: {0}", recordPath);
|
||||||
@ -1053,6 +1043,13 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if (isResourceOpen && semaphore != null)
|
||||||
|
{
|
||||||
|
semaphore.Release();
|
||||||
|
}
|
||||||
|
|
||||||
|
_libraryMonitor.ReportFileSystemChangeComplete(recordPath, true);
|
||||||
|
|
||||||
ActiveRecordingInfo removed;
|
ActiveRecordingInfo removed;
|
||||||
_activeRecordings.TryRemove(timer.Id, out removed);
|
_activeRecordings.TryRemove(timer.Id, out removed);
|
||||||
}
|
}
|
||||||
@ -1060,10 +1057,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
|||||||
if (recordingStatus == RecordingStatus.Completed)
|
if (recordingStatus == RecordingStatus.Completed)
|
||||||
{
|
{
|
||||||
timer.Status = RecordingStatus.Completed;
|
timer.Status = RecordingStatus.Completed;
|
||||||
_timerProvider.AddOrUpdate(timer, false);
|
_timerProvider.Delete(timer);
|
||||||
|
|
||||||
OnSuccessfulRecording(info.IsSeries, recordPath);
|
OnSuccessfulRecording(info.IsSeries, recordPath);
|
||||||
_timerProvider.Delete(timer);
|
|
||||||
}
|
}
|
||||||
else if (DateTime.UtcNow < timer.EndDate)
|
else if (DateTime.UtcNow < timer.EndDate)
|
||||||
{
|
{
|
||||||
|
@ -61,9 +61,16 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
|||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
File.Delete(tempfile);
|
File.Delete(tempfile);
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.ErrorException("Error deleting recording temp file", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task RecordInternal(MediaSourceInfo mediaSource, string tempFile, string targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken)
|
public async Task RecordInternal(MediaSourceInfo mediaSource, string tempFile, string targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user