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.
53 lines
1.5 KiB
53 lines
1.5 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using NzbDrone.Core.SeriesStats;
|
|
|
|
namespace Sonarr.Api.V3.Series
|
|
{
|
|
public class SeasonStatisticsResource
|
|
{
|
|
public DateTime? NextAiring { get; set; }
|
|
public DateTime? PreviousAiring { 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 decimal PercentOfEpisodes
|
|
{
|
|
get
|
|
{
|
|
if (EpisodeCount == 0)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
return (decimal)EpisodeFileCount / (decimal)EpisodeCount * 100;
|
|
}
|
|
}
|
|
}
|
|
|
|
public static class SeasonStatisticsResourceMapper
|
|
{
|
|
public static SeasonStatisticsResource ToResource(this SeasonStatistics model)
|
|
{
|
|
if (model == null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
return new SeasonStatisticsResource
|
|
{
|
|
NextAiring = model.NextAiring,
|
|
PreviousAiring = model.PreviousAiring,
|
|
EpisodeFileCount = model.EpisodeFileCount,
|
|
EpisodeCount = model.EpisodeCount,
|
|
TotalEpisodeCount = model.TotalEpisodeCount,
|
|
SizeOnDisk = model.SizeOnDisk,
|
|
ReleaseGroups = model.ReleaseGroups
|
|
};
|
|
}
|
|
}
|
|
}
|