mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
Working on the movie matching. Stop dupes #1869
This commit is contained in:
parent
c7d88f8808
commit
6002b202d9
3 changed files with 29 additions and 3 deletions
|
@ -1,5 +1,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using Ombi.Store.Entities;
|
||||
|
||||
|
@ -15,5 +17,7 @@ namespace Ombi.Store.Repository
|
|||
Task<PlexEpisode> Add(PlexEpisode content);
|
||||
Task<PlexEpisode> GetEpisodeByKey(int key);
|
||||
Task AddRange(IEnumerable<PlexEpisode> content);
|
||||
IEnumerable<PlexServerContent> GetWhereContentByCustom(Expression<Func<PlexServerContent, bool>> predicate);
|
||||
Task<PlexServerContent> GetFirstContentByCustom(Expression<Func<PlexServerContent, bool>> predicate);
|
||||
}
|
||||
}
|
|
@ -25,8 +25,10 @@
|
|||
// ************************************************************************/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
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);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
Db.PlexServerContent.Update(existingContent);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue