mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-26 01:27:00 +00:00
fixed some settings value convert issues. would cause crash on clean installs.
This commit is contained in:
parent
9caacc4809
commit
8c372e938c
5 changed files with 41 additions and 36 deletions
|
@ -21,11 +21,11 @@ public void AddByUrlSuccess()
|
|||
{
|
||||
//Setup
|
||||
string sabHost = "192.168.5.55";
|
||||
string sabPort = "2222";
|
||||
int sabPort = 2222;
|
||||
string apikey = "5c770e3197e4fe763423ee7c392c25d1";
|
||||
string username = "admin";
|
||||
string password = "pass";
|
||||
string priority = "Normal";
|
||||
var priority = SabnzbdPriorityType.Normal;
|
||||
string category = "tv";
|
||||
|
||||
|
||||
|
@ -67,11 +67,11 @@ public void AddByUrlError()
|
|||
{
|
||||
//Setup
|
||||
string sabHost = "192.168.5.55";
|
||||
string sabPort = "2222";
|
||||
int sabPort = 2222;
|
||||
string apikey = "5c770e3197e4fe763423ee7c392c25d1";
|
||||
string username = "admin";
|
||||
string password = "pass";
|
||||
string priority = "Normal";
|
||||
var priority = SabnzbdPriorityType.Normal;
|
||||
string category = "tv";
|
||||
|
||||
var mocker = new AutoMoqer();
|
||||
|
@ -108,7 +108,7 @@ public void IsInQueue_True()
|
|||
{
|
||||
//Setup
|
||||
string sabHost = "192.168.5.55";
|
||||
string sabPort = "2222";
|
||||
int sabPort = 2222;
|
||||
string apikey = "5c770e3197e4fe763423ee7c392c25d1";
|
||||
string username = "admin";
|
||||
string password = "pass";
|
||||
|
@ -143,7 +143,7 @@ public void IsInQueue_False_Empty()
|
|||
{
|
||||
//Setup
|
||||
string sabHost = "192.168.5.55";
|
||||
string sabPort = "2222";
|
||||
int sabPort = 2222;
|
||||
string apikey = "5c770e3197e4fe763423ee7c392c25d1";
|
||||
string username = "admin";
|
||||
string password = "pass";
|
||||
|
@ -179,7 +179,7 @@ public void IsInQueue_False_Error()
|
|||
{
|
||||
//Setup
|
||||
string sabHost = "192.168.5.55";
|
||||
string sabPort = "2222";
|
||||
int sabPort = 2222;
|
||||
string apikey = "5c770e3197e4fe763423ee7c392c25d1";
|
||||
string username = "admin";
|
||||
string password = "pass";
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Core.Model;
|
||||
using NzbDrone.Core.Repository;
|
||||
using SubSonic.Repository;
|
||||
|
||||
|
@ -103,23 +104,23 @@ public virtual String NewzbinPassword
|
|||
set { SetValue("NewzbinPassword", value); }
|
||||
}
|
||||
|
||||
public virtual String SyncFrequency
|
||||
public virtual int SyncFrequency
|
||||
{
|
||||
get { return GetValue("SyncFrequency"); }
|
||||
get { return GetValueInt("SyncFrequency"); }
|
||||
|
||||
set { SetValue("SyncFrequency", value); }
|
||||
}
|
||||
|
||||
public virtual String DownloadPropers
|
||||
public virtual Boolean DownloadPropers
|
||||
{
|
||||
get { return GetValue("DownloadPropers"); }
|
||||
get { return GetValueBoolean("DownloadPropers"); }
|
||||
|
||||
set { SetValue("DownloadPropers", value); }
|
||||
}
|
||||
|
||||
public virtual String Retention
|
||||
public virtual Int32 Retention
|
||||
{
|
||||
get { return GetValue("Retention"); }
|
||||
get { return GetValueInt("Retention"); }
|
||||
|
||||
set { SetValue("Retention", value); }
|
||||
}
|
||||
|
@ -131,9 +132,9 @@ public virtual String SabHost
|
|||
set { SetValue("SabHost", value); }
|
||||
}
|
||||
|
||||
public virtual String SabPort
|
||||
public virtual int SabPort
|
||||
{
|
||||
get { return GetValue("SabPort"); }
|
||||
get { return GetValueInt("SabPort"); }
|
||||
|
||||
set { SetValue("SabPort", value); }
|
||||
}
|
||||
|
@ -166,11 +167,11 @@ public virtual String SabTvCategory
|
|||
set { SetValue("SabTvCategory", value); }
|
||||
}
|
||||
|
||||
public virtual String SabTvPriority
|
||||
public virtual SabnzbdPriorityType SabTvPriority
|
||||
{
|
||||
get { return GetValue("SabTvPriority"); }
|
||||
get { return (SabnzbdPriorityType)GetValueInt("SabTvPriority"); }
|
||||
|
||||
set { SetValue("SabTvPriority", value); }
|
||||
set { SetValue("SabTvPriority", (int)value); }
|
||||
}
|
||||
|
||||
public virtual Boolean UseBlackhole
|
||||
|
|
|
@ -29,7 +29,7 @@ public SabProvider(ConfigProvider configProvider, HttpProvider httpProvider)
|
|||
public virtual bool AddByUrl(string url, string title)
|
||||
{
|
||||
string cat = _configProvider.SabTvCategory;
|
||||
int priority = (int)Enum.Parse(typeof(SabnzbdPriorityType), _configProvider.SabTvPriority);
|
||||
int priority = (int)_configProvider.SabTvPriority;
|
||||
string name = url.Replace("&", "%26");
|
||||
string nzbName = HttpUtility.UrlEncode(title);
|
||||
|
||||
|
|
|
@ -106,20 +106,17 @@ public ActionResult Downloads()
|
|||
|
||||
var model = new DownloadSettingsModel
|
||||
{
|
||||
SyncFrequency = Convert.ToInt32(_configProvider.SyncFrequency),
|
||||
DownloadPropers = Convert.ToBoolean(_configProvider.DownloadPropers),
|
||||
Retention = Convert.ToInt32(_configProvider.Retention),
|
||||
SyncFrequency = _configProvider.SyncFrequency,
|
||||
DownloadPropers = _configProvider.DownloadPropers,
|
||||
Retention = _configProvider.Retention,
|
||||
SabHost = _configProvider.SabHost,
|
||||
SabPort = Convert.ToInt32(_configProvider.SabPort),
|
||||
SabPort =_configProvider.SabPort,
|
||||
SabApiKey = _configProvider.SabApiKey,
|
||||
SabUsername = _configProvider.SabUsername,
|
||||
SabPassword = _configProvider.SabPassword,
|
||||
SabTvCategory = _configProvider.SabTvCategory,
|
||||
SabTvPriority =
|
||||
(SabnzbdPriorityType)
|
||||
Enum.Parse(typeof(SabnzbdPriorityType),
|
||||
_configProvider.SabTvPriority),
|
||||
UseBlackHole = Convert.ToBoolean(_configProvider.UseBlackhole),
|
||||
SabTvPriority = _configProvider.SabTvPriority,
|
||||
UseBlackHole = _configProvider.UseBlackhole,
|
||||
BlackholeDirectory = _configProvider.BlackholeDirectory
|
||||
};
|
||||
|
||||
|
@ -374,7 +371,7 @@ public ActionResult SaveGeneral(SettingsModel data)
|
|||
return Content(SETTINGS_FAILED);
|
||||
}
|
||||
|
||||
|
||||
|
||||
basicNotification.Title = SETTINGS_SAVED;
|
||||
_notificationProvider.Register(basicNotification);
|
||||
|
||||
|
@ -437,16 +434,16 @@ public ActionResult SaveDownloads(DownloadSettingsModel data)
|
|||
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_configProvider.SyncFrequency = data.SyncFrequency.ToString();
|
||||
_configProvider.DownloadPropers = data.DownloadPropers.ToString();
|
||||
_configProvider.Retention = data.Retention.ToString();
|
||||
_configProvider.SyncFrequency = data.SyncFrequency;
|
||||
_configProvider.DownloadPropers = data.DownloadPropers;
|
||||
_configProvider.Retention = data.Retention;
|
||||
_configProvider.SabHost = data.SabHost;
|
||||
_configProvider.SabPort = data.SabPort.ToString();
|
||||
_configProvider.SabPort = data.SabPort;
|
||||
_configProvider.SabApiKey = data.SabApiKey;
|
||||
_configProvider.SabPassword = data.SabPassword;
|
||||
_configProvider.SabTvCategory = data.SabTvCategory;
|
||||
_configProvider.SabUsername = data.SabUsername;
|
||||
_configProvider.SabTvPriority = data.SabTvPriority.ToString();
|
||||
_configProvider.SabTvPriority = data.SabTvPriority;
|
||||
_configProvider.UseBlackhole = data.UseBlackHole;
|
||||
_configProvider.BlackholeDirectory = data.BlackholeDirectory;
|
||||
|
||||
|
|
|
@ -37,8 +37,15 @@ private static void Main()
|
|||
Attach();
|
||||
#endif
|
||||
|
||||
Process.Start(IISController.AppUrl);
|
||||
|
||||
try
|
||||
{
|
||||
Logger.Info("Starting default browser. {0}",IISController.AppUrl);
|
||||
Process.Start(IISController.AppUrl);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logger.ErrorException("Failed to open URL in default browser.", e);
|
||||
}
|
||||
while (true)
|
||||
{
|
||||
Console.ReadLine();
|
||||
|
|
Loading…
Reference in a new issue