mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-12 08:16:05 -07:00
Added the ability to hide requests that have not been made by that user (#2052)
This commit is contained in:
parent
28080fd8ab
commit
152818f8d1
21 changed files with 284 additions and 52 deletions
|
@ -48,6 +48,18 @@ namespace Ombi.Store.Repository.Requests
|
|||
.ThenInclude(x => x.Episodes)
|
||||
.AsQueryable();
|
||||
}
|
||||
|
||||
public IQueryable<TvRequests> Get(string userId)
|
||||
{
|
||||
return Db.TvRequests
|
||||
.Include(x => x.ChildRequests)
|
||||
.ThenInclude(x => x.RequestedUser)
|
||||
.Include(x => x.ChildRequests)
|
||||
.ThenInclude(x => x.SeasonRequests)
|
||||
.ThenInclude(x => x.Episodes)
|
||||
.Where(x => x.ChildRequests.Any(a => a.RequestedUserId == userId))
|
||||
.AsQueryable();
|
||||
}
|
||||
public IQueryable<ChildRequests> GetChild()
|
||||
{
|
||||
return Db.ChildRequests
|
||||
|
@ -58,6 +70,17 @@ namespace Ombi.Store.Repository.Requests
|
|||
.AsQueryable();
|
||||
}
|
||||
|
||||
public IQueryable<ChildRequests> GetChild(string userId)
|
||||
{
|
||||
return Db.ChildRequests
|
||||
.Where(x => x.RequestedUserId == userId)
|
||||
.Include(x => x.RequestedUser)
|
||||
.Include(x => x.ParentRequest)
|
||||
.Include(x => x.SeasonRequests)
|
||||
.ThenInclude(x => x.Episodes)
|
||||
.AsQueryable();
|
||||
}
|
||||
|
||||
public async Task Save()
|
||||
{
|
||||
await Db.SaveChangesAsync();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue