More Season ignore work. Already ignored seasons will be ignored.

Fix: Season Ignore is handled separately from Episode Ignore.
This commit is contained in:
Mark McDowall 2012-02-20 22:50:38 -08:00
commit aac42d4882
12 changed files with 171 additions and 47 deletions

View file

@ -17,6 +17,13 @@ namespace NzbDrone.Core.Datastore.Migrations
new Column("SeasonNumber", DbType.Int32, ColumnProperty.NotNull),
new Column("Ignored", DbType.Boolean, ColumnProperty.NotNull)
});
Database.ExecuteNonQuery(@"INSERT INTO Seasons (SeriesId, SeasonNumber, Ignored)
SELECT SeriesId, SeasonNumber,
CASE WHEN Count(*) =
SUM(CASE WHEN Ignored = 1 THEN 1 ELSE 0 END) THEN 1 ELSE 0 END AS Ignored
FROM Episodes
GROUP BY SeriesId, SeasonNumber");
}
}
}