mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-22 22:23:34 -07:00
Anomized tv-series
This commit is contained in:
parent
336d62ede3
commit
2610c01692
4 changed files with 35 additions and 10 deletions
|
@ -369,7 +369,7 @@ namespace Ombi.Core.Engine
|
|||
}
|
||||
else
|
||||
{
|
||||
allRequests = await TvRepository.GetChild().ToListAsync();
|
||||
allRequests = await TvRepository.GetChild(shouldHide.Anonimize).ToListAsync();
|
||||
|
||||
}
|
||||
|
||||
|
@ -424,7 +424,7 @@ namespace Ombi.Core.Engine
|
|||
}
|
||||
else
|
||||
{
|
||||
allRequests = await TvRepository.GetChild().ToListAsync();
|
||||
allRequests = await TvRepository.GetChild(shouldHide.Anonimize).ToListAsync();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace Ombi.Store.Repository.Requests
|
|||
TvRequests GetRequest(int theMovieDbId);
|
||||
Task Update(TvRequests request);
|
||||
Task UpdateChild(ChildRequests request);
|
||||
IQueryable<ChildRequests> GetChild();
|
||||
IQueryable<ChildRequests> GetChild(bool anonimize = false);
|
||||
IQueryable<ChildRequests> GetChild(string userId);
|
||||
Task MarkEpisodeAsAvailable(int id);
|
||||
Task MarkChildAsAvailable(int id);
|
||||
|
|
|
@ -80,14 +80,25 @@ namespace Ombi.Store.Repository.Requests
|
|||
.AsQueryable();
|
||||
}
|
||||
|
||||
public IQueryable<ChildRequests> GetChild()
|
||||
public IQueryable<ChildRequests> GetChild(bool anonimize = false)
|
||||
{
|
||||
return Db.ChildRequests
|
||||
.Include(x => x.RequestedUser)
|
||||
.Include(x => x.ParentRequest)
|
||||
.Include(x => x.SeasonRequests)
|
||||
.ThenInclude(x => x.Episodes)
|
||||
.AsQueryable();
|
||||
if (!anonimize) {
|
||||
return Db.ChildRequests
|
||||
.Include(x => x.RequestedUser)
|
||||
.Include(x => x.ParentRequest)
|
||||
.Include(x => x.SeasonRequests)
|
||||
.ThenInclude(x => x.Episodes)
|
||||
.AsQueryable();
|
||||
}
|
||||
else
|
||||
{
|
||||
return Db.ChildRequests
|
||||
.AsNoTracking()
|
||||
.Include(x => x.ParentRequest)
|
||||
.Include(x => x.SeasonRequests)
|
||||
.ThenInclude(x => x.Episodes)
|
||||
.AsQueryable();
|
||||
}
|
||||
}
|
||||
|
||||
public IQueryable<ChildRequests> GetChild(string userId)
|
||||
|
|
|
@ -25,6 +25,7 @@ export class TvGridComponent implements OnInit, AfterViewInit {
|
|||
public defaultSort: string = "requestedDate";
|
||||
public defaultOrder: string = "desc";
|
||||
public currentFilter: RequestFilterType = RequestFilterType.All;
|
||||
public anonimized: boolean = true;
|
||||
|
||||
public RequestFilter = RequestFilterType;
|
||||
public manageOwnRequests: boolean;
|
||||
|
@ -90,6 +91,19 @@ export class TvGridComponent implements OnInit, AfterViewInit {
|
|||
this.isLoadingResults = false;
|
||||
this.resultsLength = data.total;
|
||||
|
||||
if (data.collection.filter(x => x.requestedUser != null).length > 0) {
|
||||
this.anonimized = false;
|
||||
}
|
||||
|
||||
if (this.anonimized) {
|
||||
this.displayedColumns.forEach((element, index) => {
|
||||
if (element == 'requestedBy') this.displayedColumns.splice(index, 1);
|
||||
});
|
||||
}
|
||||
|
||||
console.log(this.anonimized);
|
||||
console.log(data.collection);
|
||||
|
||||
return data.collection;
|
||||
}),
|
||||
catchError((err) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue