mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-07 13:41:13 -07:00
Some plex work
This commit is contained in:
parent
6054f0d436
commit
10b22cc7ab
8 changed files with 183 additions and 83 deletions
|
@ -12,7 +12,7 @@ namespace RequestPlex.Core
|
|||
{
|
||||
public class SettingsService
|
||||
{
|
||||
public void SaveSettings(int port)
|
||||
public void SaveSettings(SettingsModel model)
|
||||
{
|
||||
var db = new DbConfiguration(new SqliteFactory());
|
||||
var repo = new GenericRepository<SettingsModel>(db);
|
||||
|
@ -20,13 +20,12 @@ namespace RequestPlex.Core
|
|||
var existingSettings = repo.GetAll().FirstOrDefault();
|
||||
if (existingSettings != null)
|
||||
{
|
||||
existingSettings.Port = port;
|
||||
existingSettings = model;
|
||||
repo.Update(existingSettings);
|
||||
return;
|
||||
}
|
||||
|
||||
var newSettings = new SettingsModel { Port = port };
|
||||
repo.Insert(newSettings);
|
||||
repo.Insert(model);
|
||||
}
|
||||
|
||||
public SettingsModel GetSettings()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue