mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-29 11:05:44 +00:00
Deleting a series will also delete all items in history for that series.
This commit is contained in:
parent
7ebda928f8
commit
e4c9e11ee1
1 changed files with 4 additions and 0 deletions
|
@ -128,6 +128,10 @@ public virtual void DeleteSeries(int seriesId)
|
||||||
//Delete Files, Episdes, Seasons then the Series
|
//Delete Files, Episdes, Seasons then the Series
|
||||||
//Can't use providers because episode provider needs series provider - Cyclic Dependency Injection, this will work
|
//Can't use providers because episode provider needs series provider - Cyclic Dependency Injection, this will work
|
||||||
|
|
||||||
|
Logger.Debug("Deleting History Items from DB for Series: {0}", series.SeriesId);
|
||||||
|
var episodes = series.Episodes.Select(e => e.EpisodeId).ToList();
|
||||||
|
episodes.ForEach(e => _repository.DeleteMany<History>(h => h.EpisodeId == e));
|
||||||
|
|
||||||
Logger.Debug("Deleting EpisodeFiles from DB for Series: {0}", series.SeriesId);
|
Logger.Debug("Deleting EpisodeFiles from DB for Series: {0}", series.SeriesId);
|
||||||
_repository.DeleteMany(series.EpisodeFiles);
|
_repository.DeleteMany(series.EpisodeFiles);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue