mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-14 01:02:57 -07:00
Got the search finished up for #32
This commit is contained in:
parent
420e43dfaf
commit
e037ad0f2b
8 changed files with 118 additions and 18 deletions
|
@ -37,13 +37,11 @@ namespace PlexRequests.Store.Repository
|
|||
public class RequestJsonRepository : IRequestRepository
|
||||
{
|
||||
private ICacheProvider Cache { get; }
|
||||
|
||||
private string TypeName { get; }
|
||||
|
||||
public RequestJsonRepository(ISqliteConfiguration config, ICacheProvider cacheProvider)
|
||||
{
|
||||
Db = config;
|
||||
Cache = cacheProvider;
|
||||
TypeName = typeof(RequestJsonRepository).Name;
|
||||
}
|
||||
|
||||
private ISqliteConfiguration Db { get; }
|
||||
|
@ -60,7 +58,7 @@ namespace PlexRequests.Store.Repository
|
|||
|
||||
public IEnumerable<RequestBlobs> GetAll()
|
||||
{
|
||||
var key = TypeName + "GetAll";
|
||||
var key = "GetAll";
|
||||
var item = Cache.GetOrSet(key, () =>
|
||||
{
|
||||
using (var con = Db.DbConnection())
|
||||
|
@ -74,7 +72,7 @@ namespace PlexRequests.Store.Repository
|
|||
|
||||
public RequestBlobs Get(int id)
|
||||
{
|
||||
var key = TypeName + "Get" + id;
|
||||
var key = "Get" + id;
|
||||
var item = Cache.GetOrSet(key, () =>
|
||||
{
|
||||
using (var con = Db.DbConnection())
|
||||
|
@ -107,7 +105,7 @@ namespace PlexRequests.Store.Repository
|
|||
private void ResetCache()
|
||||
{
|
||||
Cache.Remove("Get");
|
||||
Cache.Remove(TypeName + "GetAll");
|
||||
Cache.Remove("GetAll");
|
||||
}
|
||||
|
||||
public bool UpdateAll(IEnumerable<RequestBlobs> entity)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue