1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-25 01:06:30 +00:00

Episodes without dates but file will be included in count

Unmonitored episodes with files will be included in the episode count
This commit is contained in:
Mark McDowall 2013-08-24 18:56:19 -07:00
parent ae590828da
commit ff2b62887c

View file

@ -54,8 +54,8 @@ namespace NzbDrone.Core.SeriesStats
{
return @"SELECT
SeriesId,
SUM(CASE WHEN Monitored = 1 AND AirdateUtc <= @currentDate THEN 1 ELSE 0 END) AS EpisodeCount,
SUM(CASE WHEN Monitored = 1 AND Episodes.EpisodeFileId > 0 AND AirDateUtc <= @currentDate THEN 1 ELSE 0 END) AS EpisodeFileCount,
SUM(CASE WHEN (Monitored = 1 OR Episodes.EpisodeFileId > 0) AND (AirdateUtc <= @currentDate OR Episodes.EpisodeFileId > 0) THEN 1 ELSE 0 END) AS EpisodeCount,
SUM(CASE WHEN (Monitored = 1 OR Episodes.EpisodeFileId > 0) AND Episodes.EpisodeFileId > 0 THEN 1 ELSE 0 END) AS EpisodeFileCount,
MAX(Episodes.SeasonNumber) as SeasonCount,
MIN(CASE WHEN AirDateUtc < @currentDate THEN NULL ELSE AirDateUtc END) AS NextAiringString
FROM Episodes";