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.
Sonarr/src/NzbDrone.Core/SeriesStats/SeriesStatistics.cs

90 lines
2.4 KiB

using System;
using System.Collections.Generic;
using NzbDrone.Core.Datastore;
namespace NzbDrone.Core.SeriesStats
{
public class SeriesStatistics : ResultSet
{
public int SeriesId { get; set; }
public string NextAiringString { get; set; }
public string PreviousAiringString { get; set; }
public string LastAiredString { get; set; }
public int EpisodeFileCount { get; set; }
public int EpisodeCount { get; set; }
public int TotalEpisodeCount { get; set; }
public long SizeOnDisk { get; set; }
public List<string> ReleaseGroups { get; set; }
public List<SeasonStatistics> SeasonStatistics { get; set; }
public DateTime? NextAiring
{
get
{
DateTime nextAiring;
try
{
if (!DateTime.TryParse(NextAiringString, out nextAiring))
{
return null;
}
}
catch (ArgumentOutOfRangeException)
{
// GHI 3518: Can throw on mono (6.x?) despite being a Try*
return null;
}
return nextAiring;
}
}
public DateTime? PreviousAiring
{
get
{
DateTime previousAiring;
try
{
if (!DateTime.TryParse(PreviousAiringString, out previousAiring))
{
return null;
}
}
catch (ArgumentOutOfRangeException)
{
// GHI 3518: Can throw on mono (6.x?) despite being a Try*
return null;
}
return previousAiring;
}
}
public DateTime? LastAired
{
get
{
DateTime lastAired;
try
{
if (!DateTime.TryParse(LastAiredString, out lastAired))
{
return null;
}
}
catch (ArgumentOutOfRangeException)
{
// GHI 3518: Can throw on mono (6.x?) despite being a Try*
return null;
}
return lastAired;
}
}
}
}