Fixed the multiple notifications (I think)

This commit is contained in:
Jamie Rees 2019-12-17 13:11:45 +00:00
commit 1069ddf9cf
8 changed files with 79 additions and 14 deletions

View file

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
@ -100,6 +101,23 @@ namespace Ombi.Store.Repository.Requests
.AsQueryable();
}
public async Task MarkChildAsAvailable(int id)
{
var request = new ChildRequests { Id = id, Available = true, MarkedAsAvailable = DateTime.UtcNow };
var attached = Db.ChildRequests.Attach(request);
attached.Property(x => x.Available).IsModified = true;
attached.Property(x => x.MarkedAsAvailable).IsModified = true;
await Db.SaveChangesAsync();
}
public async Task MarkEpisodeAsAvailable(int id)
{
var request = new EpisodeRequests { Id = id, Available = true };
var attached = Db.EpisodeRequests.Attach(request);
attached.Property(x => x.Available).IsModified = true;
await Db.SaveChangesAsync();
}
public async Task Save()
{
await InternalSaveChanges();
@ -141,10 +159,10 @@ namespace Ombi.Store.Repository.Requests
public async Task Update(TvRequests request)
{
Db.Update(request);
await InternalSaveChanges();
}
public async Task UpdateChild(ChildRequests request)
{
Db.Update(request);