mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-27 22:56:45 -04:00
@@ -5,11 +5,13 @@ namespace NzbDrone.Core.Configuration
|
||||
{
|
||||
public class AccessDeniedConfigFileException : NzbDroneException
|
||||
{
|
||||
public AccessDeniedConfigFileException(string message) : base(message)
|
||||
public AccessDeniedConfigFileException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
|
||||
public AccessDeniedConfigFileException(string message, Exception innerException) : base(message, innerException)
|
||||
public AccessDeniedConfigFileException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,4 @@ namespace NzbDrone.Core.Configuration
|
||||
|
||||
public string Value { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,10 @@ namespace NzbDrone.Core.Configuration
|
||||
|
||||
object currentValue;
|
||||
allWithDefaults.TryGetValue(configValue.Key, out currentValue);
|
||||
if (currentValue == null) continue;
|
||||
if (currentValue == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var equal = configValue.Value.ToString().Equals(currentValue.ToString());
|
||||
|
||||
@@ -257,7 +260,6 @@ namespace NzbDrone.Core.Configuration
|
||||
{
|
||||
parentContainer.Add(new XElement(key, valueString));
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
parentContainer.Descendants(key).Single().Value = valueString;
|
||||
@@ -331,12 +333,10 @@ namespace NzbDrone.Core.Configuration
|
||||
return xDoc;
|
||||
}
|
||||
}
|
||||
|
||||
catch (XmlException ex)
|
||||
{
|
||||
throw new InvalidConfigFileException($"{_configFile} is corrupt is invalid. Please delete the config file and Lidarr will recreate it.", ex);
|
||||
}
|
||||
|
||||
catch (UnauthorizedAccessException ex)
|
||||
{
|
||||
throw new AccessDeniedConfigFileException($"Lidarr does not have access to config file: {_configFile}. Please fix permissions", ex);
|
||||
@@ -356,7 +356,6 @@ namespace NzbDrone.Core.Configuration
|
||||
{
|
||||
throw new AccessDeniedConfigFileException($"Lidarr does not have access to config file: {_configFile}. Please fix permissions", ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private string GenerateApiKey()
|
||||
|
||||
@@ -2,7 +2,6 @@ using System.Linq;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.Messaging.Events;
|
||||
|
||||
|
||||
namespace NzbDrone.Core.Configuration
|
||||
{
|
||||
public interface IConfigRepository : IBasicRepository<Config>
|
||||
@@ -18,7 +17,6 @@ namespace NzbDrone.Core.Configuration
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public Config Get(string key)
|
||||
{
|
||||
return Query.Where(c => c.Key == key).SingleOrDefault();
|
||||
@@ -30,7 +28,7 @@ namespace NzbDrone.Core.Configuration
|
||||
|
||||
if (dbValue == null)
|
||||
{
|
||||
return Insert(new Config {Key = key, Value = value});
|
||||
return Insert(new Config { Key = key, Value = value });
|
||||
}
|
||||
|
||||
dbValue.Value = value;
|
||||
@@ -38,4 +36,4 @@ namespace NzbDrone.Core.Configuration
|
||||
return Update(dbValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@ using System.Globalization;
|
||||
using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Common.EnsureThat;
|
||||
using NzbDrone.Common.Http.Proxy;
|
||||
using NzbDrone.Core.Configuration.Events;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
using NzbDrone.Core.Messaging.Events;
|
||||
using NzbDrone.Common.Http.Proxy;
|
||||
using NzbDrone.Core.Qualities;
|
||||
using NzbDrone.Core.Security;
|
||||
|
||||
@@ -57,7 +57,10 @@ namespace NzbDrone.Core.Configuration
|
||||
{
|
||||
object currentValue;
|
||||
allWithDefaults.TryGetValue(configValue.Key, out currentValue);
|
||||
if (currentValue == null || configValue.Value == null) continue;
|
||||
if (currentValue == null || configValue.Value == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var equal = configValue.Value.ToString().Equals(currentValue.ToString());
|
||||
|
||||
@@ -108,9 +111,9 @@ namespace NzbDrone.Core.Configuration
|
||||
|
||||
public int MaximumSize
|
||||
{
|
||||
get { return GetValueInt("MaximumSize", 0);}
|
||||
get { return GetValueInt("MaximumSize", 0); }
|
||||
|
||||
set { SetValue("MaximumSize", value);}
|
||||
set { SetValue("MaximumSize", value); }
|
||||
}
|
||||
|
||||
public int MinimumAge
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
using NzbDrone.Common.Http.Proxy;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
using NzbDrone.Core.Qualities;
|
||||
using NzbDrone.Core.Security;
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace NzbDrone.Core.Configuration
|
||||
string TimeFormat { get; set; }
|
||||
bool ShowRelativeDates { get; set; }
|
||||
bool EnableColorImpairedMode { get; set; }
|
||||
|
||||
|
||||
bool ExpandAlbumByDefault { get; set; }
|
||||
bool ExpandSingleByDefault { get; set; }
|
||||
bool ExpandEPByDefault { get; set; }
|
||||
|
||||
@@ -5,11 +5,13 @@ namespace NzbDrone.Core.Configuration
|
||||
{
|
||||
public class InvalidConfigFileException : NzbDroneException
|
||||
{
|
||||
public InvalidConfigFileException(string message) : base(message)
|
||||
public InvalidConfigFileException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
|
||||
public InvalidConfigFileException(string message, Exception innerException) : base(message, innerException)
|
||||
public InvalidConfigFileException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user