update timer settings

This commit is contained in:
Luke Pulverenti 2016-12-20 00:21:21 -05:00
parent 2345d02b41
commit a93c2682d9
3 changed files with 17 additions and 12 deletions

View File

@ -326,7 +326,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
{
epgData = GetEpgDataForChannel(timer.ChannelId);
}
await UpdateTimersForSeriesTimer(epgData, timer, true).ConfigureAwait(false);
await UpdateTimersForSeriesTimer(epgData, timer, false, true).ConfigureAwait(false);
}
}
@ -573,7 +573,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
}
_seriesTimerProvider.Add(info);
await UpdateTimersForSeriesTimer(epgData, info, false).ConfigureAwait(false);
await UpdateTimersForSeriesTimer(epgData, info, true, false).ConfigureAwait(false);
return info.Id;
}
@ -614,7 +614,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
epgData = GetEpgDataForChannel(instance.ChannelId);
}
await UpdateTimersForSeriesTimer(epgData, instance, true).ConfigureAwait(false);
await UpdateTimersForSeriesTimer(epgData, instance, true, true).ConfigureAwait(false);
}
}
@ -2159,7 +2159,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
}
}
private async Task UpdateTimersForSeriesTimer(List<ProgramInfo> epgData, SeriesTimerInfo seriesTimer, bool deleteInvalidTimers)
private async Task UpdateTimersForSeriesTimer(List<ProgramInfo> epgData, SeriesTimerInfo seriesTimer, bool updateTimerSettings, bool deleteInvalidTimers)
{
var allTimers = GetTimersForSeries(seriesTimer, epgData)
.ToList();
@ -2204,12 +2204,15 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
enabledTimersForSeries.Add(existingTimer);
}
existingTimer.KeepUntil = seriesTimer.KeepUntil;
existingTimer.IsPostPaddingRequired = seriesTimer.IsPostPaddingRequired;
existingTimer.IsPrePaddingRequired = seriesTimer.IsPrePaddingRequired;
existingTimer.PostPaddingSeconds = seriesTimer.PostPaddingSeconds;
existingTimer.PrePaddingSeconds = seriesTimer.PrePaddingSeconds;
existingTimer.Priority = seriesTimer.Priority;
if (updateTimerSettings)
{
existingTimer.KeepUntil = seriesTimer.KeepUntil;
existingTimer.IsPostPaddingRequired = seriesTimer.IsPostPaddingRequired;
existingTimer.IsPrePaddingRequired = seriesTimer.IsPrePaddingRequired;
existingTimer.PostPaddingSeconds = seriesTimer.PostPaddingSeconds;
existingTimer.PrePaddingSeconds = seriesTimer.PrePaddingSeconds;
existingTimer.Priority = seriesTimer.Priority;
}
existingTimer.SeriesTimerId = seriesTimer.Id;
_timerProvider.Update(existingTimer);

View File

@ -1681,7 +1681,7 @@ namespace Emby.Server.Implementations.LiveTv
return new QueryResult<BaseItem>();
}
if (_services.Count == 1 && !(query.IsInProgress ?? false))
if (_services.Count == 1 && !(query.IsInProgress ?? false) && (!query.IsLibraryItem.HasValue || query.IsLibraryItem.Value))
{
return GetEmbyRecordings(query, new DtoOptions(), user);
}

View File

@ -202,6 +202,7 @@ namespace MediaBrowser.Api.LiveTv
public bool? IsKids { get; set; }
public bool? IsSports { get; set; }
public bool? IsNews { get; set; }
public bool? IsLibraryItem { get; set; }
public GetRecordings()
{
@ -1057,7 +1058,8 @@ namespace MediaBrowser.Api.LiveTv
IsNews = request.IsNews,
IsSeries = request.IsSeries,
IsKids = request.IsKids,
IsSports = request.IsSports
IsSports = request.IsSports,
IsLibraryItem = request.IsLibraryItem
}, options, CancellationToken.None).ConfigureAwait(false);