|
|
@ -25,8 +25,10 @@
|
|
|
|
// ************************************************************************/
|
|
|
|
// ************************************************************************/
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
using System.Linq.Expressions;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
using Ombi.Store.Context;
|
|
|
|
using Ombi.Store.Context;
|
|
|
@ -74,6 +76,16 @@ namespace Ombi.Store.Repository
|
|
|
|
return await Db.PlexServerContent.Include(x => x.Seasons).FirstOrDefaultAsync(x => x.Key == key);
|
|
|
|
return await Db.PlexServerContent.Include(x => x.Seasons).FirstOrDefaultAsync(x => x.Key == key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public IEnumerable<PlexServerContent> GetWhereContentByCustom(Expression<Func<PlexServerContent, bool>> predicate)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return Db.PlexServerContent.Where(predicate);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public async Task<PlexServerContent> GetFirstContentByCustom(Expression<Func<PlexServerContent, bool>> predicate)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return await Db.PlexServerContent.FirstOrDefaultAsync(predicate);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async Task Update(PlexServerContent existingContent)
|
|
|
|
public async Task Update(PlexServerContent existingContent)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Db.PlexServerContent.Update(existingContent);
|
|
|
|
Db.PlexServerContent.Update(existingContent);
|
|
|
|