mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-23 14:35:24 -07:00
Small cleanup
This commit is contained in:
parent
fb319a712e
commit
96d7354124
1 changed files with 9 additions and 10 deletions
|
@ -48,17 +48,16 @@ namespace Ombi.Store.Repository.Requests
|
||||||
|
|
||||||
public IQueryable<MovieRequests> GetWithUser(bool anonimize)
|
public IQueryable<MovieRequests> GetWithUser(bool anonimize)
|
||||||
{
|
{
|
||||||
var allRequests = Db.MovieRequests
|
if (!anonimize)
|
||||||
.Include(x => x.RequestedUser)
|
|
||||||
.ThenInclude(x => x.NotificationUserIds)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
if (anonimize)
|
|
||||||
{
|
{
|
||||||
allRequests.ForEach(x => x.RequestedUser = null);
|
return Db.MovieRequests
|
||||||
allRequests.ForEach(x => x.RequestedUserId = null);
|
.Include(x => x.RequestedUser)
|
||||||
|
.ThenInclude(x => x.NotificationUserIds)
|
||||||
|
.AsQueryable();
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
return Db.MovieRequests.AsQueryable(); //This still populates the RequestedUser for the logged in user (or so it seems...)
|
||||||
}
|
}
|
||||||
return allRequests.AsQueryable();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task MarkAsAvailable(int id)
|
public async Task MarkAsAvailable(int id)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue