mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-30 03:28:28 -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
|
@ -33,6 +33,11 @@ namespace Ombi.Store.Repository.Requests
|
|||
|
||||
}
|
||||
|
||||
public IQueryable<MovieRequests> GetAll(string userId)
|
||||
{
|
||||
return GetWithUser().Where(x => x.RequestedUserId == userId);
|
||||
}
|
||||
|
||||
public MovieRequests GetRequest(int theMovieDbId)
|
||||
{
|
||||
return Db.MovieRequests.Where(x => x.TheMovieDbId == theMovieDbId)
|
||||
|
@ -48,6 +53,16 @@ namespace Ombi.Store.Repository.Requests
|
|||
.AsQueryable();
|
||||
}
|
||||
|
||||
|
||||
public IQueryable<MovieRequests> GetWithUser(string userId)
|
||||
{
|
||||
return Db.MovieRequests
|
||||
.Where(x => x.RequestedUserId == userId)
|
||||
.Include(x => x.RequestedUser)
|
||||
.ThenInclude(x => x.NotificationUserIds)
|
||||
.AsQueryable();
|
||||
}
|
||||
|
||||
public async Task Update(MovieRequests request)
|
||||
{
|
||||
if (Db.Entry(request).State == EntityState.Detached)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue