|
|
|
@ -58,7 +58,7 @@ namespace NzbDrone.Core.Providers
|
|
|
|
|
var series = _database
|
|
|
|
|
.Fetch<Series, QualityProfile>(@"SELECT Series.SeriesId, Series.Title, Series.CleanTitle, Series.Status, Series.Overview, Series.AirsDayOfWeek, Series.AirTimes,
|
|
|
|
|
Series.Language, Series.Path, Series.Monitored, Series.QualityProfileId, Series.SeasonFolder, Series.BacklogSetting, Series.Network,
|
|
|
|
|
SUM(CASE WHEN Ignored = 0 AND Airdate <= @0 THEN 1 ELSE 0 END) AS EpisodeCount,
|
|
|
|
|
Series.UtcOffset, Series.CustomStartDate, SUM(CASE WHEN Ignored = 0 AND Airdate <= @0 THEN 1 ELSE 0 END) AS EpisodeCount,
|
|
|
|
|
SUM(CASE WHEN Episodes.Ignored = 0 AND Episodes.EpisodeFileId > 0 AND Episodes.AirDate <= @0 THEN 1 ELSE 0 END) as EpisodeFileCount,
|
|
|
|
|
MAX(Episodes.SeasonNumber) as SeasonCount, MIN(CASE WHEN AirDate < @0 OR Ignored = 1 THEN NULL ELSE AirDate END) as NextAiring,
|
|
|
|
|
QualityProfiles.QualityProfileId, QualityProfiles.Name, QualityProfiles.Cutoff, QualityProfiles.SonicAllowed
|
|
|
|
@ -68,6 +68,7 @@ namespace NzbDrone.Core.Providers
|
|
|
|
|
WHERE Series.LastInfoSync IS NOT NULL
|
|
|
|
|
GROUP BY Series.SeriesId, Series.Title, Series.CleanTitle, Series.Status, Series.Overview, Series.AirsDayOfWeek, Series.AirTimes,
|
|
|
|
|
Series.Language, Series.Path, Series.Monitored, Series.QualityProfileId, Series.SeasonFolder, Series.BacklogSetting, Series.Network,
|
|
|
|
|
Series.UtcOffset, Series.CustomStartDate,
|
|
|
|
|
QualityProfiles.QualityProfileId, QualityProfiles.Name, QualityProfiles.Cutoff, QualityProfiles.SonicAllowed",DateTime.Today);
|
|
|
|
|
|
|
|
|
|
return series;
|
|
|
|
@ -99,7 +100,7 @@ namespace NzbDrone.Core.Providers
|
|
|
|
|
|
|
|
|
|
series.SeriesId = tvDbSeries.Id;
|
|
|
|
|
series.Title = tvDbSeries.SeriesName;
|
|
|
|
|
series.AirTimes = CleanAirsTime(tvDbSeries.AirsTime);
|
|
|
|
|
series.AirTime = CleanAirsTime(tvDbSeries.AirsTime);
|
|
|
|
|
series.AirsDayOfWeek = tvDbSeries.AirsDayOfWeek;
|
|
|
|
|
series.Overview = tvDbSeries.Overview;
|
|
|
|
|
series.Status = tvDbSeries.Status;
|
|
|
|
|