Fixed: Slow renaming and deleting episodes

Closes #5499
This commit is contained in:
Mark McDowall 2023-03-26 22:30:46 -07:00
parent 5ea1fb9424
commit 13a0dfa4ae
1 changed files with 1 additions and 1 deletions

View File

@ -114,7 +114,7 @@ namespace NzbDrone.Core.Datastore
Mapper.Entity<EpisodeFile>("EpisodeFiles").RegisterModel() Mapper.Entity<EpisodeFile>("EpisodeFiles").RegisterModel()
.HasOne(f => f.Series, f => f.SeriesId) .HasOne(f => f.Series, f => f.SeriesId)
.LazyLoad(x => x.Episodes, .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) t => t.Id > 0)
.Ignore(f => f.Path); .Ignore(f => f.Path);