Fixed: Slow renaming and deleting episodes

Closes #5499
pull/5521/head
Mark McDowall 2 years ago
parent 5ea1fb9424
commit 13a0dfa4ae

@ -114,7 +114,7 @@ namespace NzbDrone.Core.Datastore
Mapper.Entity<EpisodeFile>("EpisodeFiles").RegisterModel()
.HasOne(f => f.Series, f => f.SeriesId)
.LazyLoad(x => x.Episodes,
(db, parent) => db.Query<Episode>(new SqlBuilder()).Where(c => c.EpisodeFileId == parent.Id).ToList(),
(db, parent) => db.Query<Episode>(new SqlBuilder().Where<Episode>(c => c.EpisodeFileId == parent.Id)).ToList(),
t => t.Id > 0)
.Ignore(f => f.Path);

Loading…
Cancel
Save