mirror of
https://github.com/Radarr/Radarr
synced 2026-01-29 10:55:55 +01:00
refactor: extract UIConfigService and ProxyConfigService (#142)
Continue ConfigService split with UI and proxy-related settings. Uses delegation pattern for backward compatibility. Co-authored-by: admin <admin@ardentleatherworks.com>
This commit is contained in:
parent
7fd12125ed
commit
a567eb870d
4 changed files with 134 additions and 0 deletions
16
src/NzbDrone.Core/Configuration/IProxyConfigService.cs
Normal file
16
src/NzbDrone.Core/Configuration/IProxyConfigService.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using NzbDrone.Common.Http.Proxy;
|
||||
|
||||
namespace NzbDrone.Core.Configuration
|
||||
{
|
||||
public interface IProxyConfigService
|
||||
{
|
||||
bool ProxyEnabled { get; }
|
||||
ProxyType ProxyType { get; }
|
||||
string ProxyHostname { get; }
|
||||
int ProxyPort { get; }
|
||||
string ProxyUsername { get; }
|
||||
string ProxyPassword { get; }
|
||||
string ProxyBypassFilter { get; }
|
||||
bool ProxyBypassLocalAddresses { get; }
|
||||
}
|
||||
}
|
||||
16
src/NzbDrone.Core/Configuration/IUIConfigService.cs
Normal file
16
src/NzbDrone.Core/Configuration/IUIConfigService.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
namespace NzbDrone.Core.Configuration
|
||||
{
|
||||
public interface IUIConfigService
|
||||
{
|
||||
int FirstDayOfWeek { get; set; }
|
||||
string CalendarWeekColumnHeader { get; set; }
|
||||
MovieRuntimeFormatType MovieRuntimeFormat { get; set; }
|
||||
string ShortDateFormat { get; set; }
|
||||
string LongDateFormat { get; set; }
|
||||
string TimeFormat { get; set; }
|
||||
bool ShowRelativeDates { get; set; }
|
||||
bool EnableColorImpairedMode { get; set; }
|
||||
int MovieInfoLanguage { get; set; }
|
||||
int UILanguage { get; set; }
|
||||
}
|
||||
}
|
||||
30
src/NzbDrone.Core/Configuration/ProxyConfigService.cs
Normal file
30
src/NzbDrone.Core/Configuration/ProxyConfigService.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
using NzbDrone.Common.Http.Proxy;
|
||||
|
||||
namespace NzbDrone.Core.Configuration
|
||||
{
|
||||
public class ProxyConfigService : IProxyConfigService
|
||||
{
|
||||
private readonly IConfigService _configService;
|
||||
|
||||
public ProxyConfigService(IConfigService configService)
|
||||
{
|
||||
_configService = configService;
|
||||
}
|
||||
|
||||
public bool ProxyEnabled => _configService.ProxyEnabled;
|
||||
|
||||
public ProxyType ProxyType => _configService.ProxyType;
|
||||
|
||||
public string ProxyHostname => _configService.ProxyHostname;
|
||||
|
||||
public int ProxyPort => _configService.ProxyPort;
|
||||
|
||||
public string ProxyUsername => _configService.ProxyUsername;
|
||||
|
||||
public string ProxyPassword => _configService.ProxyPassword;
|
||||
|
||||
public string ProxyBypassFilter => _configService.ProxyBypassFilter;
|
||||
|
||||
public bool ProxyBypassLocalAddresses => _configService.ProxyBypassLocalAddresses;
|
||||
}
|
||||
}
|
||||
72
src/NzbDrone.Core/Configuration/UIConfigService.cs
Normal file
72
src/NzbDrone.Core/Configuration/UIConfigService.cs
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
namespace NzbDrone.Core.Configuration
|
||||
{
|
||||
public class UIConfigService : IUIConfigService
|
||||
{
|
||||
private readonly IConfigService _configService;
|
||||
|
||||
public UIConfigService(IConfigService configService)
|
||||
{
|
||||
_configService = configService;
|
||||
}
|
||||
|
||||
public int FirstDayOfWeek
|
||||
{
|
||||
get => _configService.FirstDayOfWeek;
|
||||
set => _configService.FirstDayOfWeek = value;
|
||||
}
|
||||
|
||||
public string CalendarWeekColumnHeader
|
||||
{
|
||||
get => _configService.CalendarWeekColumnHeader;
|
||||
set => _configService.CalendarWeekColumnHeader = value;
|
||||
}
|
||||
|
||||
public MovieRuntimeFormatType MovieRuntimeFormat
|
||||
{
|
||||
get => _configService.MovieRuntimeFormat;
|
||||
set => _configService.MovieRuntimeFormat = value;
|
||||
}
|
||||
|
||||
public string ShortDateFormat
|
||||
{
|
||||
get => _configService.ShortDateFormat;
|
||||
set => _configService.ShortDateFormat = value;
|
||||
}
|
||||
|
||||
public string LongDateFormat
|
||||
{
|
||||
get => _configService.LongDateFormat;
|
||||
set => _configService.LongDateFormat = value;
|
||||
}
|
||||
|
||||
public string TimeFormat
|
||||
{
|
||||
get => _configService.TimeFormat;
|
||||
set => _configService.TimeFormat = value;
|
||||
}
|
||||
|
||||
public bool ShowRelativeDates
|
||||
{
|
||||
get => _configService.ShowRelativeDates;
|
||||
set => _configService.ShowRelativeDates = value;
|
||||
}
|
||||
|
||||
public bool EnableColorImpairedMode
|
||||
{
|
||||
get => _configService.EnableColorImpairedMode;
|
||||
set => _configService.EnableColorImpairedMode = value;
|
||||
}
|
||||
|
||||
public int MovieInfoLanguage
|
||||
{
|
||||
get => _configService.MovieInfoLanguage;
|
||||
set => _configService.MovieInfoLanguage = value;
|
||||
}
|
||||
|
||||
public int UILanguage
|
||||
{
|
||||
get => _configService.UILanguage;
|
||||
set => _configService.UILanguage = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue