mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-05 02:22:31 +01:00
19 lines
577 B
C#
19 lines
577 B
C#
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);
|
|
}
|
|
}
|
|
}
|