mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-13 16:52:56 -07:00
Lots of different UI enhancements and fixes #865
This commit is contained in:
parent
855a11ba9a
commit
ece8b39632
24 changed files with 351 additions and 61 deletions
|
@ -149,8 +149,19 @@ namespace Ombi.Core.Engine
|
|||
public async Task RemoveTvChild(int requestId)
|
||||
{
|
||||
var request = await TvRepository.GetChild().FirstOrDefaultAsync(x => x.Id == requestId);
|
||||
var all = TvRepository.Db.TvRequests.Include(x => x.ChildRequests);
|
||||
var parent = all.FirstOrDefault(x => x.Id == request.ParentRequestId);
|
||||
|
||||
// Is this the only child? If so delete the parent
|
||||
if (parent.ChildRequests.Count <= 1)
|
||||
{
|
||||
// Delete the parent
|
||||
TvRepository.Db.TvRequests.Remove(parent);
|
||||
}
|
||||
await Audit.Record(AuditType.Deleted, AuditArea.TvRequest, $"Deleting Request {request.Title}", Username);
|
||||
await TvRepository.DeleteChild(request);
|
||||
|
||||
TvRepository.Db.ChildRequests.Remove(request);
|
||||
await TvRepository.Db.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task RemoveTvRequest(int requestId)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue