fix recording timers
This commit is contained in:
parent
cb36d426f2
commit
70f75f8adb
|
@ -461,7 +461,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||||
return CreateTimer(info, cancellationToken);
|
return CreateTimer(info, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task CreateSeriesTimerAsync(SeriesTimerInfo info, CancellationToken cancellationToken)
|
public Task CreateSeriesTimerAsync(SeriesTimerInfo info, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
return CreateSeriesTimer(info, cancellationToken);
|
return CreateSeriesTimer(info, cancellationToken);
|
||||||
}
|
}
|
||||||
|
@ -1011,7 +1011,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||||
Action onStarted = () =>
|
Action onStarted = () =>
|
||||||
{
|
{
|
||||||
timer.Status = RecordingStatus.InProgress;
|
timer.Status = RecordingStatus.InProgress;
|
||||||
_timerProvider.AddOrUpdate(timer);
|
_timerProvider.AddOrUpdate(timer, false);
|
||||||
|
|
||||||
result.Item3.Release();
|
result.Item3.Release();
|
||||||
isResourceOpen = false;
|
isResourceOpen = false;
|
||||||
|
@ -1060,7 +1060,7 @@ 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);
|
_timerProvider.AddOrUpdate(timer, false);
|
||||||
|
|
||||||
OnSuccessfulRecording(info.IsSeries, recordPath);
|
OnSuccessfulRecording(info.IsSeries, recordPath);
|
||||||
_timerProvider.Delete(timer);
|
_timerProvider.Delete(timer);
|
||||||
|
|
|
@ -72,6 +72,26 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AddOrUpdate(TimerInfo item, bool resetTimer)
|
||||||
|
{
|
||||||
|
if (resetTimer)
|
||||||
|
{
|
||||||
|
AddOrUpdate(item);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var list = GetAll().ToList();
|
||||||
|
|
||||||
|
if (!list.Any(i => EqualityComparer(i, item)))
|
||||||
|
{
|
||||||
|
base.Add(item);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
base.Update(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override void Add(TimerInfo item)
|
public override void Add(TimerInfo item)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(item.Id))
|
if (string.IsNullOrWhiteSpace(item.Id))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user