SeasonCount is fixed
This commit is contained in:
parent
7c72e1e865
commit
4196b7eedb
|
@ -54,9 +54,9 @@ namespace NzbDrone.Core.SeriesStats
|
||||||
{
|
{
|
||||||
return @"SELECT
|
return @"SELECT
|
||||||
SeriesId,
|
SeriesId,
|
||||||
SUM(CASE WHEN (Monitored = 1 AND AirdateUtc <= @currentDate) OR Episodes.EpisodeFileId > 0 THEN 1 ELSE 0 END) AS EpisodeCount,
|
SUM(CASE WHEN (Monitored = 1 AND AirdateUtc <= @currentDate) OR EpisodeFileId > 0 THEN 1 ELSE 0 END) AS EpisodeCount,
|
||||||
SUM(CASE WHEN Episodes.EpisodeFileId > 0 THEN 1 ELSE 0 END) AS EpisodeFileCount,
|
SUM(CASE WHEN Episodes.EpisodeFileId > 0 THEN 1 ELSE 0 END) AS EpisodeFileCount,
|
||||||
MAX(Episodes.SeasonNumber) as SeasonCount,
|
COUNT(DISTINCT(CASE WHEN SeasonNumber > 0 THEN SeasonNumber ELSE NULL END)) as SeasonCount,
|
||||||
MIN(CASE WHEN AirDateUtc < @currentDate THEN NULL ELSE AirDateUtc END) AS NextAiringString
|
MIN(CASE WHEN AirDateUtc < @currentDate THEN NULL ELSE AirDateUtc END) AS NextAiringString
|
||||||
FROM Episodes";
|
FROM Episodes";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue