#1513 partially fixed a bug

This commit is contained in:
tidusjar 2017-09-30 01:19:50 +01:00
parent 9e6a7d5a72
commit d8e77ef6b3
3 changed files with 13 additions and 4 deletions

View file

@ -128,13 +128,21 @@ namespace Ombi.Core.Engine
public async Task<IEnumerable<TvRequests>> GetRequests(int count, int position)
{
var allRequests = await TvRepository.Get().Skip(position).Take(count).ToListAsync();
var allRequests = await TvRepository.Get()
.Include(x => x.ChildRequests)
.ThenInclude(x => x.SeasonRequests)
.ThenInclude(x => x.Episodes)
.Skip(position).Take(count).ToListAsync();
return allRequests;
}
public async Task<IEnumerable<TreeNode<TvRequests, List<ChildRequests>>>> GetRequestsTreeNode(int count, int position)
{
var allRequests = await TvRepository.Get().Skip(position).Take(count).ToListAsync();
var allRequests = await TvRepository.Get()
.Include(x => x.ChildRequests)
.ThenInclude(x => x.SeasonRequests)
.ThenInclude(x=>x.Episodes)
.Skip(position).Take(count).ToListAsync();
return ParseIntoTreeNode(allRequests);
}
@ -146,7 +154,7 @@ namespace Ombi.Core.Engine
public async Task<IEnumerable<ChildRequests>> GetAllChldren(int tvId)
{
return await TvRepository.GetChild().Where(x => x.ParentRequestId == tvId).ToListAsync();
return await TvRepository.GetChild().Include(x => x.SeasonRequests).Where(x => x.ParentRequestId == tvId).ToListAsync();
}
public async Task<IEnumerable<TvRequests>> SearchTvRequest(string search)