mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 07:46:05 -07:00
Some more work. Need to stop the form submitting on a request
This commit is contained in:
parent
9a78f790a6
commit
96a3970a53
7 changed files with 106 additions and 8 deletions
|
@ -38,5 +38,36 @@ namespace RequestPlex.Core
|
|||
|
||||
return settings;
|
||||
}
|
||||
|
||||
public void AddRequest(int tmdbid, RequestType type)
|
||||
{
|
||||
var model = new RequestedModel
|
||||
{
|
||||
Tmdbid = tmdbid,
|
||||
Type = type
|
||||
};
|
||||
|
||||
var db = new DbConfiguration(new SqliteFactory());
|
||||
var repo = new GenericRepository<RequestedModel>(db);
|
||||
|
||||
repo.Insert(model);
|
||||
}
|
||||
|
||||
public bool CheckRequest(int tmdbid)
|
||||
{
|
||||
var db = new DbConfiguration(new SqliteFactory());
|
||||
var repo = new GenericRepository<RequestedModel>(db);
|
||||
|
||||
return repo.GetAll().Any(x => x.Tmdbid == tmdbid);
|
||||
}
|
||||
|
||||
public void DeleteRequest(int tmdbId)
|
||||
{
|
||||
var db = new DbConfiguration(new SqliteFactory());
|
||||
var repo = new GenericRepository<RequestedModel>(db);
|
||||
var entity = repo.GetAll().FirstOrDefault(x => x.Tmdbid == tmdbId);
|
||||
repo.Delete(entity);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue