mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-08 10:44:23 -04:00
DVR: Prefer HD channels then earliest showing when handling duplicate showings. (#8768)
Co-authored-by: Bond-009 <bond.009@outlook.com>
This commit is contained in:
parent
5443708c42
commit
75c96e6e76
@ -2192,10 +2192,9 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||||||
|
|
||||||
private void HandleDuplicateShowIds(List<TimerInfo> timers)
|
private void HandleDuplicateShowIds(List<TimerInfo> timers)
|
||||||
{
|
{
|
||||||
foreach (var timer in timers.Skip(1))
|
// sort showings by HD channels first, then by startDate, record earliest showing possible
|
||||||
|
foreach (var timer in timers.OrderByDescending(t => _liveTvManager.GetLiveTvChannel(t, this).IsHD).ThenBy(t => t.StartDate).Skip(1))
|
||||||
{
|
{
|
||||||
// TODO: Get smarter, prefer HD, etc
|
|
||||||
|
|
||||||
timer.Status = RecordingStatus.Cancelled;
|
timer.Status = RecordingStatus.Cancelled;
|
||||||
_timerProvider.Update(timer);
|
_timerProvider.Update(timer);
|
||||||
}
|
}
|
||||||
|
@ -121,12 +121,29 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||||||
var timer = new Timer(TimerCallback, item.Id, dueTime, TimeSpan.Zero);
|
var timer = new Timer(TimerCallback, item.Id, dueTime, TimeSpan.Zero);
|
||||||
|
|
||||||
if (_timers.TryAdd(item.Id, timer))
|
if (_timers.TryAdd(item.Id, timer))
|
||||||
|
{
|
||||||
|
if (item.IsSeries)
|
||||||
{
|
{
|
||||||
Logger.LogInformation(
|
Logger.LogInformation(
|
||||||
"Creating recording timer for {Id}, {Name}. Timer will fire in {Minutes} minutes",
|
"Creating recording timer for {Id}, {Name} {SeasonNumber}x{EpisodeNumber:D2} on channel {ChannelId}. Timer will fire in {Minutes} minutes at {StartDate}",
|
||||||
item.Id,
|
item.Id,
|
||||||
item.Name,
|
item.Name,
|
||||||
dueTime.TotalMinutes.ToString(CultureInfo.InvariantCulture));
|
item.SeasonNumber,
|
||||||
|
item.EpisodeNumber,
|
||||||
|
item.ChannelId,
|
||||||
|
dueTime.TotalMinutes.ToString(CultureInfo.InvariantCulture),
|
||||||
|
item.StartDate);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Logger.LogInformation(
|
||||||
|
"Creating recording timer for {Id}, {Name} on channel {ChannelId}. Timer will fire in {Minutes} minutes at {StartDate}",
|
||||||
|
item.Id,
|
||||||
|
item.Name,
|
||||||
|
item.ChannelId,
|
||||||
|
dueTime.TotalMinutes.ToString(CultureInfo.InvariantCulture),
|
||||||
|
item.StartDate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user