You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/NzbDrone.Api/Resolvers/NextAiringResolver.cs

19 lines
577 B

using System;
using System.Linq;
using AutoMapper;
namespace NzbDrone.Api.Resolvers
{
public class NextAiringResolver : ValueResolver<Core.Tv.Series, DateTime?>
{
protected override DateTime? ResolveCore(Core.Tv.Series source)
{
if (String.IsNullOrWhiteSpace(source.AirTime) || !source.NextAiring.HasValue)
return source.NextAiring;
return source.NextAiring.Value.Add(Convert.ToDateTime(source.AirTime).TimeOfDay)
.AddHours(source.UtcOffset * -1);
}
}
}