mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 03:52:33 +02:00
Because it's 2016!
This commit is contained in:
parent
2e36538dcd
commit
aba613acd1
@ -27,7 +27,7 @@ public EnableAuthInNancy(IAuthenticationService authenticationService,
|
||||
_configFileProvider = configFileProvider;
|
||||
}
|
||||
|
||||
public int Order { get { return 10; } }
|
||||
public int Order => 10;
|
||||
|
||||
public void Register(IPipelines pipelines)
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ public CacheHeaderPipeline(ICacheableSpecification cacheableSpecification)
|
||||
_cacheableSpecification = cacheableSpecification;
|
||||
}
|
||||
|
||||
public int Order { get { return 0; } }
|
||||
public int Order => 0;
|
||||
|
||||
public void Register(IPipelines pipelines)
|
||||
{
|
||||
|
@ -7,7 +7,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
|
||||
{
|
||||
public class CorsPipeline : IRegisterNancyPipeline
|
||||
{
|
||||
public int Order { get { return 0; } }
|
||||
public int Order => 0;
|
||||
|
||||
public void Register(IPipelines pipelines)
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ public class GzipCompressionPipeline : IRegisterNancyPipeline
|
||||
{
|
||||
private readonly Logger _logger;
|
||||
|
||||
public int Order { get { return 0; } }
|
||||
public int Order => 0;
|
||||
|
||||
public GzipCompressionPipeline(Logger logger)
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ public IfModifiedPipeline(ICacheableSpecification cacheableSpecification)
|
||||
_cacheableSpecification = cacheableSpecification;
|
||||
}
|
||||
|
||||
public int Order { get { return 0; } }
|
||||
public int Order => 0;
|
||||
|
||||
public void Register(IPipelines pipelines)
|
||||
{
|
||||
|
@ -7,7 +7,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
|
||||
{
|
||||
public class NzbDroneVersionPipeline : IRegisterNancyPipeline
|
||||
{
|
||||
public int Order { get { return 0; } }
|
||||
public int Order => 0;
|
||||
|
||||
public void Register(IPipelines pipelines)
|
||||
{
|
||||
|
@ -23,7 +23,7 @@ public RequestLoggingPipeline(NzbDroneErrorPipeline errorPipeline)
|
||||
_errorPipeline = errorPipeline;
|
||||
}
|
||||
|
||||
public int Order { get { return 100; } }
|
||||
public int Order => 100;
|
||||
|
||||
public void Register(IPipelines pipelines)
|
||||
{
|
||||
|
@ -31,13 +31,6 @@ protected override string GetLogFilePath(string filename)
|
||||
return Path.Combine(_appFolderInfo.GetLogFolder(), filename);
|
||||
}
|
||||
|
||||
protected override string DownloadUrlRoot
|
||||
{
|
||||
get
|
||||
{
|
||||
return "logfile";
|
||||
}
|
||||
}
|
||||
|
||||
protected override string DownloadUrlRoot => "logfile";
|
||||
}
|
||||
}
|
@ -38,12 +38,6 @@ protected override string GetLogFilePath(string filename)
|
||||
return Path.Combine(_appFolderInfo.GetUpdateLogFolder(), filename);
|
||||
}
|
||||
|
||||
protected override string DownloadUrlRoot
|
||||
{
|
||||
get
|
||||
{
|
||||
return "updatelogfile";
|
||||
}
|
||||
}
|
||||
protected override string DownloadUrlRoot => "updatelogfile";
|
||||
}
|
||||
}
|
@ -55,17 +55,8 @@ protected override TinyIoCContainer GetApplicationContainer()
|
||||
return _tinyIoCContainer;
|
||||
}
|
||||
|
||||
protected override DiagnosticsConfiguration DiagnosticsConfiguration
|
||||
{
|
||||
get { return new DiagnosticsConfiguration { Password = @"password" }; }
|
||||
}
|
||||
protected override DiagnosticsConfiguration DiagnosticsConfiguration => new DiagnosticsConfiguration { Password = @"password" };
|
||||
|
||||
protected override byte[] FavIcon
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
protected override byte[] FavIcon => null;
|
||||
}
|
||||
}
|
@ -9,6 +9,6 @@ public class LanguageResource : RestResource
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)]
|
||||
public new int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string NameLower { get { return Name.ToLowerInvariant(); } }
|
||||
public string NameLower => Name.ToLowerInvariant();
|
||||
}
|
||||
}
|
@ -8,12 +8,6 @@ public abstract class RestResource
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual string ResourceName
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetType().Name.ToLowerInvariant().Replace("resource", "");
|
||||
}
|
||||
}
|
||||
public virtual string ResourceName => GetType().Name.ToLowerInvariant().Replace("resource", "");
|
||||
}
|
||||
}
|
@ -31,10 +31,7 @@ public class TinyIoCNancyBootstrapper : NancyBootstrapperWithRequestContainerBas
|
||||
/// does not mean the assembly *will* be included, a true from another delegate will
|
||||
/// take precedence.
|
||||
/// </summary>
|
||||
protected virtual IEnumerable<Func<Assembly, bool>> AutoRegisterIgnoredAssemblies
|
||||
{
|
||||
get { return DefaultAutoRegisterIgnoredAssemblies; }
|
||||
}
|
||||
protected virtual IEnumerable<Func<Assembly, bool>> AutoRegisterIgnoredAssemblies => DefaultAutoRegisterIgnoredAssemblies;
|
||||
|
||||
/// <summary>
|
||||
/// Configures the container using AutoRegister followed by registration
|
||||
|
@ -47,52 +47,16 @@ public void WaitForNoSpinner(int timeout = 30)
|
||||
});
|
||||
}
|
||||
|
||||
public IWebElement SeriesNavIcon
|
||||
{
|
||||
get
|
||||
{
|
||||
return FindByClass("x-series-nav");
|
||||
}
|
||||
}
|
||||
public IWebElement SeriesNavIcon => FindByClass("x-series-nav");
|
||||
|
||||
public IWebElement CalendarNavIcon
|
||||
{
|
||||
get
|
||||
{
|
||||
return FindByClass("x-calendar-nav");
|
||||
}
|
||||
}
|
||||
public IWebElement CalendarNavIcon => FindByClass("x-calendar-nav");
|
||||
|
||||
public IWebElement ActivityNavIcon
|
||||
{
|
||||
get
|
||||
{
|
||||
return FindByClass("x-activity-nav");
|
||||
}
|
||||
}
|
||||
public IWebElement ActivityNavIcon => FindByClass("x-activity-nav");
|
||||
|
||||
public IWebElement WantedNavIcon
|
||||
{
|
||||
get
|
||||
{
|
||||
return FindByClass("x-wanted-nav");
|
||||
}
|
||||
}
|
||||
public IWebElement WantedNavIcon => FindByClass("x-wanted-nav");
|
||||
|
||||
public IWebElement SettingNavIcon
|
||||
{
|
||||
get
|
||||
{
|
||||
return FindByClass("x-settings-nav");
|
||||
}
|
||||
}
|
||||
public IWebElement SettingNavIcon => FindByClass("x-settings-nav");
|
||||
|
||||
public IWebElement SystemNavIcon
|
||||
{
|
||||
get
|
||||
{
|
||||
return FindByClass("x-system-nav");
|
||||
}
|
||||
}
|
||||
public IWebElement SystemNavIcon => FindByClass("x-system-nav");
|
||||
}
|
||||
}
|
@ -28,7 +28,7 @@ public void Clear()
|
||||
_cache.Clear();
|
||||
}
|
||||
|
||||
public ICollection<ICached> Caches { get { return _cache.Values; } }
|
||||
public ICollection<ICached> Caches => _cache.Values;
|
||||
|
||||
public ICached<T> GetCache<T>(Type host)
|
||||
{
|
||||
|
@ -67,13 +67,7 @@ public void Remove(string key)
|
||||
_store.TryRemove(key, out value);
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return _store.Count;
|
||||
}
|
||||
}
|
||||
public int Count => _store.Count;
|
||||
|
||||
public T Get(string key, Func<T> function, TimeSpan? lifeTime = null)
|
||||
{
|
||||
|
@ -14,10 +14,7 @@ public interface IConsoleService
|
||||
|
||||
public class ConsoleService : IConsoleService
|
||||
{
|
||||
public static bool IsConsoleAvailable
|
||||
{
|
||||
get { return Console.In != StreamReader.Null; }
|
||||
}
|
||||
public static bool IsConsoleAvailable => Console.In != StreamReader.Null;
|
||||
|
||||
public void PrintHelp()
|
||||
{
|
||||
|
@ -14,15 +14,9 @@ public DriveInfoMount(DriveInfo driveInfo, DriveType driveType = DriveType.Unkno
|
||||
_driveType = driveType;
|
||||
}
|
||||
|
||||
public long AvailableFreeSpace
|
||||
{
|
||||
get { return _driveInfo.AvailableFreeSpace; }
|
||||
}
|
||||
public long AvailableFreeSpace => _driveInfo.AvailableFreeSpace;
|
||||
|
||||
public string DriveFormat
|
||||
{
|
||||
get { return _driveInfo.DriveFormat; }
|
||||
}
|
||||
public string DriveFormat => _driveInfo.DriveFormat;
|
||||
|
||||
public DriveType DriveType
|
||||
{
|
||||
@ -37,35 +31,17 @@ public DriveType DriveType
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsReady
|
||||
{
|
||||
get { return _driveInfo.IsReady; }
|
||||
}
|
||||
public bool IsReady => _driveInfo.IsReady;
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return _driveInfo.Name; }
|
||||
}
|
||||
public string Name => _driveInfo.Name;
|
||||
|
||||
public string RootDirectory
|
||||
{
|
||||
get { return _driveInfo.RootDirectory.FullName; }
|
||||
}
|
||||
public string RootDirectory => _driveInfo.RootDirectory.FullName;
|
||||
|
||||
public long TotalFreeSpace
|
||||
{
|
||||
get { return _driveInfo.TotalFreeSpace; }
|
||||
}
|
||||
public long TotalFreeSpace => _driveInfo.TotalFreeSpace;
|
||||
|
||||
public long TotalSize
|
||||
{
|
||||
get { return _driveInfo.TotalSize; }
|
||||
}
|
||||
public long TotalSize => _driveInfo.TotalSize;
|
||||
|
||||
public string VolumeLabel
|
||||
{
|
||||
get { return _driveInfo.VolumeLabel; }
|
||||
}
|
||||
public string VolumeLabel => _driveInfo.VolumeLabel;
|
||||
|
||||
public string VolumeName
|
||||
{
|
||||
|
@ -77,28 +77,13 @@ private static string FixSlashes(string path, OsPathKind kind)
|
||||
return path;
|
||||
}
|
||||
|
||||
public OsPathKind Kind
|
||||
{
|
||||
get { return _kind; }
|
||||
}
|
||||
public OsPathKind Kind => _kind;
|
||||
|
||||
public bool IsWindowsPath
|
||||
{
|
||||
get { return _kind == OsPathKind.Windows; }
|
||||
}
|
||||
public bool IsWindowsPath => _kind == OsPathKind.Windows;
|
||||
|
||||
public bool IsUnixPath
|
||||
{
|
||||
get { return _kind == OsPathKind.Unix; }
|
||||
}
|
||||
public bool IsUnixPath => _kind == OsPathKind.Unix;
|
||||
|
||||
public bool IsEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
return _path.IsNullOrWhiteSpace();
|
||||
}
|
||||
}
|
||||
public bool IsEmpty => _path.IsNullOrWhiteSpace();
|
||||
|
||||
public bool IsRooted
|
||||
{
|
||||
@ -132,13 +117,7 @@ public OsPath Directory
|
||||
}
|
||||
}
|
||||
|
||||
public string FullPath
|
||||
{
|
||||
get
|
||||
{
|
||||
return _path;
|
||||
}
|
||||
}
|
||||
public string FullPath => _path;
|
||||
|
||||
public string FileName
|
||||
{
|
||||
@ -162,13 +141,7 @@ public string FileName
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsValid
|
||||
{
|
||||
get
|
||||
{
|
||||
return _path.IsPathValid();
|
||||
}
|
||||
}
|
||||
public bool IsValid => _path.IsPathValid();
|
||||
|
||||
private int GetFileNameIndex()
|
||||
{
|
||||
|
@ -6,10 +6,7 @@ namespace NzbDrone.Common.EnvironmentInfo
|
||||
{
|
||||
public static class BuildInfo
|
||||
{
|
||||
public static Version Version
|
||||
{
|
||||
get { return Assembly.GetExecutingAssembly().GetName().Version; }
|
||||
}
|
||||
public static Version Version => Assembly.GetExecutingAssembly().GetName().Version;
|
||||
|
||||
public static DateTime BuildDateTime
|
||||
{
|
||||
|
@ -36,18 +36,9 @@ static RuntimeInfoBase()
|
||||
IsProduction = InternalIsProduction();
|
||||
}
|
||||
|
||||
public static bool IsUserInteractive
|
||||
{
|
||||
get { return Environment.UserInteractive; }
|
||||
}
|
||||
public static bool IsUserInteractive => Environment.UserInteractive;
|
||||
|
||||
bool IRuntimeInfo.IsUserInteractive
|
||||
{
|
||||
get
|
||||
{
|
||||
return IsUserInteractive;
|
||||
}
|
||||
}
|
||||
bool IRuntimeInfo.IsUserInteractive => IsUserInteractive;
|
||||
|
||||
public bool IsAdmin
|
||||
{
|
||||
|
@ -47,21 +47,9 @@ public StartupContext(params string[] args)
|
||||
public HashSet<string> Flags { get; private set; }
|
||||
public Dictionary<string, string> Args { get; private set; }
|
||||
|
||||
public bool InstallService
|
||||
{
|
||||
get
|
||||
{
|
||||
return Flags.Contains(INSTALL_SERVICE);
|
||||
}
|
||||
}
|
||||
public bool InstallService => Flags.Contains(INSTALL_SERVICE);
|
||||
|
||||
public bool UninstallService
|
||||
{
|
||||
get
|
||||
{
|
||||
return Flags.Contains(UNINSTALL_SERVICE);
|
||||
}
|
||||
}
|
||||
public bool UninstallService => Flags.Contains(UNINSTALL_SERVICE);
|
||||
|
||||
public string PreservedArguments
|
||||
{
|
||||
|
@ -15,19 +15,13 @@ public class ExceptronClient : IExceptronClient
|
||||
/// <summary>
|
||||
/// Version of Client
|
||||
/// </summary>
|
||||
public string ClientVersion
|
||||
{
|
||||
get { return Assembly.GetExecutingAssembly().GetName().Version.ToString(); }
|
||||
}
|
||||
public string ClientVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Name of Client
|
||||
/// </summary>
|
||||
public string ClientName
|
||||
{
|
||||
get { return "Official .NET"; }
|
||||
}
|
||||
public string ClientName => "Official .NET";
|
||||
|
||||
/// <summary>
|
||||
/// Client Configuration
|
||||
|
@ -14,13 +14,7 @@ public class ExceptionResponse
|
||||
/// <summary>
|
||||
/// Was the report successfully processed on the server
|
||||
/// </summary>
|
||||
public bool Successful
|
||||
{
|
||||
get
|
||||
{
|
||||
return !string.IsNullOrEmpty(RefId);
|
||||
}
|
||||
}
|
||||
public bool Successful => !string.IsNullOrEmpty(RefId);
|
||||
|
||||
/// <summary>
|
||||
/// Exception that caused the message to fail.
|
||||
|
@ -16,13 +16,7 @@ internal bool TryGetValue(TKey key, out TValue value)
|
||||
return _Dictionary.TryGetValue(key, out value);
|
||||
}
|
||||
|
||||
internal TValue this[TKey key]
|
||||
{
|
||||
get
|
||||
{
|
||||
return _Dictionary[key];
|
||||
}
|
||||
}
|
||||
internal TValue this[TKey key] => _Dictionary[key];
|
||||
|
||||
internal void Add(TKey key, TValue value)
|
||||
{
|
||||
|
@ -328,9 +328,6 @@ protected override bool ReleaseHandle()
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool IsInvalid
|
||||
{
|
||||
get { return !_initialized || !_available; }
|
||||
}
|
||||
public override bool IsInvalid => !_initialized || !_available;
|
||||
}
|
||||
}
|
||||
|
@ -49,13 +49,7 @@ public string Content
|
||||
}
|
||||
|
||||
|
||||
public bool HasHttpError
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)StatusCode >= 400;
|
||||
}
|
||||
}
|
||||
public bool HasHttpError => (int)StatusCode >= 400;
|
||||
|
||||
public Dictionary<string, string> GetCookies()
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ public class HttpUri : IEquatable<HttpUri>
|
||||
private static readonly Regex RegexUri = new Regex(@"^(?:(?<scheme>[a-z]+):)?(?://(?<host>[-A-Z0-9.]+)(?::(?<port>[0-9]{1,5}))?)?(?<path>(?:(?:(?<=^)|/)[^/?#\r\n]+)+/?|/)?(?:\?(?<query>[^#\r\n]*))?(?:\#(?<fragment>.*))?$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
private readonly string _uri;
|
||||
public string FullUri { get { return _uri; } }
|
||||
public string FullUri => _uri;
|
||||
|
||||
public HttpUri(string uri)
|
||||
{
|
||||
|
@ -45,19 +45,13 @@ public string[] BypassListAsArray
|
||||
}
|
||||
}
|
||||
|
||||
public string Key
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.Join("_",
|
||||
Type,
|
||||
Host,
|
||||
Port,
|
||||
Username,
|
||||
Password,
|
||||
BypassFilter,
|
||||
BypassLocalAddress);
|
||||
}
|
||||
}
|
||||
public string Key => string.Join("_",
|
||||
Type,
|
||||
Host,
|
||||
Port,
|
||||
Username,
|
||||
Password,
|
||||
BypassFilter,
|
||||
BypassLocalAddress);
|
||||
}
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ protected sealed override bool TryDequeue(Task task)
|
||||
}
|
||||
|
||||
/// <summary>Gets the maximum concurrency level supported by this scheduler.</summary>
|
||||
public sealed override int MaximumConcurrencyLevel { get { return _maxDegreeOfParallelism; } }
|
||||
public sealed override int MaximumConcurrencyLevel => _maxDegreeOfParallelism;
|
||||
|
||||
/// <summary>Gets an enumerable of the tasks currently scheduled on this scheduler.</summary>
|
||||
/// <returns>An enumerable of the tasks currently scheduled.</returns>
|
||||
|
@ -669,13 +669,7 @@ public NamedParameterOverloads(IDictionary<string, object> data)
|
||||
|
||||
private static readonly NamedParameterOverloads _Default = new NamedParameterOverloads();
|
||||
|
||||
public static NamedParameterOverloads Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return _Default;
|
||||
}
|
||||
}
|
||||
public static NamedParameterOverloads Default => _Default;
|
||||
}
|
||||
|
||||
public enum UnregisteredResolutionActions
|
||||
@ -741,46 +735,22 @@ public NamedResolutionFailureActions NamedResolutionFailureAction
|
||||
/// <summary>
|
||||
/// Gets the default options (attempt resolution of unregistered types, fail on named resolution if name not found)
|
||||
/// </summary>
|
||||
public static ResolveOptions Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return _Default;
|
||||
}
|
||||
}
|
||||
public static ResolveOptions Default => _Default;
|
||||
|
||||
/// <summary>
|
||||
/// Preconfigured option for attempting resolution of unregistered types and failing on named resolution if name not found
|
||||
/// </summary>
|
||||
public static ResolveOptions FailNameNotFoundOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return _FailNameNotFoundOnly;
|
||||
}
|
||||
}
|
||||
public static ResolveOptions FailNameNotFoundOnly => _FailNameNotFoundOnly;
|
||||
|
||||
/// <summary>
|
||||
/// Preconfigured option for failing on resolving unregistered types and on named resolution if name not found
|
||||
/// </summary>
|
||||
public static ResolveOptions FailUnregisteredAndNameNotFound
|
||||
{
|
||||
get
|
||||
{
|
||||
return _FailUnregisteredAndNameNotFound;
|
||||
}
|
||||
}
|
||||
public static ResolveOptions FailUnregisteredAndNameNotFound => _FailUnregisteredAndNameNotFound;
|
||||
|
||||
/// <summary>
|
||||
/// Preconfigured option for failing on resolving unregistered types, but attempting unnamed resolution if name not found
|
||||
/// </summary>
|
||||
public static ResolveOptions FailUnregisteredOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return _FailUnregisteredOnly;
|
||||
}
|
||||
}
|
||||
public static ResolveOptions FailUnregisteredOnly => _FailUnregisteredOnly;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -2394,7 +2364,7 @@ private abstract class ObjectFactoryBase
|
||||
/// Generally set to true for delegate style factories as CanResolve cannot delve
|
||||
/// into the delegates they contain.
|
||||
/// </summary>
|
||||
public virtual bool AssumeConstruction { get { return false; } }
|
||||
public virtual bool AssumeConstruction => false;
|
||||
|
||||
/// <summary>
|
||||
/// The type the factory instantiates
|
||||
@ -2471,7 +2441,7 @@ private class MultiInstanceFactory : ObjectFactoryBase
|
||||
{
|
||||
private readonly Type registerType;
|
||||
private readonly Type registerImplementation;
|
||||
public override Type CreatesType { get { return this.registerImplementation; } }
|
||||
public override Type CreatesType => this.registerImplementation;
|
||||
|
||||
public MultiInstanceFactory(Type registerType, Type registerImplementation)
|
||||
{
|
||||
@ -2501,26 +2471,14 @@ public override object GetObject(Type requestedType, TinyIoCContainer container,
|
||||
}
|
||||
}
|
||||
|
||||
public override ObjectFactoryBase SingletonVariant
|
||||
{
|
||||
get
|
||||
{
|
||||
return new SingletonFactory(this.registerType, this.registerImplementation);
|
||||
}
|
||||
}
|
||||
public override ObjectFactoryBase SingletonVariant => new SingletonFactory(this.registerType, this.registerImplementation);
|
||||
|
||||
public override ObjectFactoryBase GetCustomObjectLifetimeVariant(ITinyIoCObjectLifetimeProvider lifetimeProvider, string errorString)
|
||||
{
|
||||
return new CustomObjectLifetimeFactory(this.registerType, this.registerImplementation, lifetimeProvider, errorString);
|
||||
}
|
||||
|
||||
public override ObjectFactoryBase MultiInstanceVariant
|
||||
{
|
||||
get
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
public override ObjectFactoryBase MultiInstanceVariant => this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -2532,9 +2490,9 @@ private class DelegateFactory : ObjectFactoryBase
|
||||
|
||||
private Func<TinyIoCContainer, NamedParameterOverloads, object> _factory;
|
||||
|
||||
public override bool AssumeConstruction { get { return true; } }
|
||||
public override bool AssumeConstruction => true;
|
||||
|
||||
public override Type CreatesType { get { return this.registerType; } }
|
||||
public override Type CreatesType => this.registerType;
|
||||
|
||||
public override object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
|
||||
{
|
||||
@ -2558,21 +2516,9 @@ public DelegateFactory(Type registerType, Func<TinyIoCContainer, NamedParameterO
|
||||
this.registerType = registerType;
|
||||
}
|
||||
|
||||
public override ObjectFactoryBase WeakReferenceVariant
|
||||
{
|
||||
get
|
||||
{
|
||||
return new WeakDelegateFactory(this.registerType, _factory);
|
||||
}
|
||||
}
|
||||
public override ObjectFactoryBase WeakReferenceVariant => new WeakDelegateFactory(this.registerType, _factory);
|
||||
|
||||
public override ObjectFactoryBase StrongReferenceVariant
|
||||
{
|
||||
get
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
public override ObjectFactoryBase StrongReferenceVariant => this;
|
||||
|
||||
public override void SetConstructor(ConstructorInfo constructor)
|
||||
{
|
||||
@ -2590,9 +2536,9 @@ private class WeakDelegateFactory : ObjectFactoryBase
|
||||
|
||||
private WeakReference _factory;
|
||||
|
||||
public override bool AssumeConstruction { get { return true; } }
|
||||
public override bool AssumeConstruction => true;
|
||||
|
||||
public override Type CreatesType { get { return this.registerType; } }
|
||||
public override Type CreatesType => this.registerType;
|
||||
|
||||
public override object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
|
||||
{
|
||||
@ -2634,13 +2580,7 @@ public override ObjectFactoryBase StrongReferenceVariant
|
||||
}
|
||||
}
|
||||
|
||||
public override ObjectFactoryBase WeakReferenceVariant
|
||||
{
|
||||
get
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
public override ObjectFactoryBase WeakReferenceVariant => this;
|
||||
|
||||
public override void SetConstructor(ConstructorInfo constructor)
|
||||
{
|
||||
@ -2657,7 +2597,7 @@ private class InstanceFactory : ObjectFactoryBase, IDisposable
|
||||
private readonly Type registerImplementation;
|
||||
private object _instance;
|
||||
|
||||
public override bool AssumeConstruction { get { return true; } }
|
||||
public override bool AssumeConstruction => true;
|
||||
|
||||
public InstanceFactory(Type registerType, Type registerImplementation, object instance)
|
||||
{
|
||||
@ -2669,36 +2609,18 @@ public InstanceFactory(Type registerType, Type registerImplementation, object in
|
||||
_instance = instance;
|
||||
}
|
||||
|
||||
public override Type CreatesType
|
||||
{
|
||||
get { return this.registerImplementation; }
|
||||
}
|
||||
public override Type CreatesType => this.registerImplementation;
|
||||
|
||||
public override object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
|
||||
{
|
||||
return _instance;
|
||||
}
|
||||
|
||||
public override ObjectFactoryBase MultiInstanceVariant
|
||||
{
|
||||
get { return new MultiInstanceFactory(this.registerType, this.registerImplementation); }
|
||||
}
|
||||
public override ObjectFactoryBase MultiInstanceVariant => new MultiInstanceFactory(this.registerType, this.registerImplementation);
|
||||
|
||||
public override ObjectFactoryBase WeakReferenceVariant
|
||||
{
|
||||
get
|
||||
{
|
||||
return new WeakInstanceFactory(this.registerType, this.registerImplementation, this._instance);
|
||||
}
|
||||
}
|
||||
public override ObjectFactoryBase WeakReferenceVariant => new WeakInstanceFactory(this.registerType, this.registerImplementation, this._instance);
|
||||
|
||||
public override ObjectFactoryBase StrongReferenceVariant
|
||||
{
|
||||
get
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
public override ObjectFactoryBase StrongReferenceVariant => this;
|
||||
|
||||
public override void SetConstructor(ConstructorInfo constructor)
|
||||
{
|
||||
@ -2735,10 +2657,7 @@ public WeakInstanceFactory(Type registerType, Type registerImplementation, objec
|
||||
_instance = new WeakReference(instance);
|
||||
}
|
||||
|
||||
public override Type CreatesType
|
||||
{
|
||||
get { return this.registerImplementation; }
|
||||
}
|
||||
public override Type CreatesType => this.registerImplementation;
|
||||
|
||||
public override object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
|
||||
{
|
||||
@ -2750,21 +2669,9 @@ public override object GetObject(Type requestedType, TinyIoCContainer container,
|
||||
return instance;
|
||||
}
|
||||
|
||||
public override ObjectFactoryBase MultiInstanceVariant
|
||||
{
|
||||
get
|
||||
{
|
||||
return new MultiInstanceFactory(this.registerType, this.registerImplementation);
|
||||
}
|
||||
}
|
||||
public override ObjectFactoryBase MultiInstanceVariant => new MultiInstanceFactory(this.registerType, this.registerImplementation);
|
||||
|
||||
public override ObjectFactoryBase WeakReferenceVariant
|
||||
{
|
||||
get
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
public override ObjectFactoryBase WeakReferenceVariant => this;
|
||||
|
||||
public override ObjectFactoryBase StrongReferenceVariant
|
||||
{
|
||||
@ -2819,10 +2726,7 @@ public SingletonFactory(Type registerType, Type registerImplementation)
|
||||
this.registerImplementation = registerImplementation;
|
||||
}
|
||||
|
||||
public override Type CreatesType
|
||||
{
|
||||
get { return this.registerImplementation; }
|
||||
}
|
||||
public override Type CreatesType => this.registerImplementation;
|
||||
|
||||
public override object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
|
||||
{
|
||||
@ -2836,26 +2740,14 @@ public override object GetObject(Type requestedType, TinyIoCContainer container,
|
||||
return _Current;
|
||||
}
|
||||
|
||||
public override ObjectFactoryBase SingletonVariant
|
||||
{
|
||||
get
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
public override ObjectFactoryBase SingletonVariant => this;
|
||||
|
||||
public override ObjectFactoryBase GetCustomObjectLifetimeVariant(ITinyIoCObjectLifetimeProvider lifetimeProvider, string errorString)
|
||||
{
|
||||
return new CustomObjectLifetimeFactory(this.registerType, this.registerImplementation, lifetimeProvider, errorString);
|
||||
}
|
||||
|
||||
public override ObjectFactoryBase MultiInstanceVariant
|
||||
{
|
||||
get
|
||||
{
|
||||
return new MultiInstanceFactory(this.registerType, this.registerImplementation);
|
||||
}
|
||||
}
|
||||
public override ObjectFactoryBase MultiInstanceVariant => new MultiInstanceFactory(this.registerType, this.registerImplementation);
|
||||
|
||||
public override ObjectFactoryBase GetFactoryForChildContainer(Type type, TinyIoCContainer parent, TinyIoCContainer child)
|
||||
{
|
||||
@ -2908,10 +2800,7 @@ public CustomObjectLifetimeFactory(Type registerType, Type registerImplementatio
|
||||
_LifetimeProvider = lifetimeProvider;
|
||||
}
|
||||
|
||||
public override Type CreatesType
|
||||
{
|
||||
get { return this.registerImplementation; }
|
||||
}
|
||||
public override Type CreatesType => this.registerImplementation;
|
||||
|
||||
public override object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
|
||||
{
|
||||
@ -2980,13 +2869,8 @@ static TinyIoCContainer()
|
||||
/// <summary>
|
||||
/// Lazy created Singleton instance of the container for simple scenarios
|
||||
/// </summary>
|
||||
public static TinyIoCContainer Current
|
||||
{
|
||||
get
|
||||
{
|
||||
return _Current;
|
||||
}
|
||||
}
|
||||
public static TinyIoCContainer Current => _Current;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Type Registrations
|
||||
|
@ -23,21 +23,9 @@ public abstract class DbTest<TSubject, TModel> : DbTest
|
||||
|
||||
protected BasicRepository<TModel> Storage { get; private set; }
|
||||
|
||||
protected IList<TModel> AllStoredModels
|
||||
{
|
||||
get
|
||||
{
|
||||
return Storage.All().ToList();
|
||||
}
|
||||
}
|
||||
protected IList<TModel> AllStoredModels => Storage.All().ToList();
|
||||
|
||||
protected TModel StoredModel
|
||||
{
|
||||
get
|
||||
{
|
||||
return Storage.All().Single();
|
||||
}
|
||||
}
|
||||
protected TModel StoredModel => Storage.All().Single();
|
||||
|
||||
[SetUp]
|
||||
public void CoreTestSetup()
|
||||
@ -66,13 +54,7 @@ public abstract class DbTest : CoreTest
|
||||
{
|
||||
private ITestDatabase _db;
|
||||
|
||||
protected virtual MigrationType MigrationType
|
||||
{
|
||||
get
|
||||
{
|
||||
return MigrationType.Main;
|
||||
}
|
||||
}
|
||||
protected virtual MigrationType MigrationType => MigrationType.Main;
|
||||
|
||||
protected ITestDatabase Db
|
||||
{
|
||||
|
@ -45,9 +45,6 @@ public override void SetupDb()
|
||||
}
|
||||
|
||||
[Obsolete("Don't use Mocker/Repositories in MigrationTests, query the DB.", true)]
|
||||
public new AutoMoqer Mocker
|
||||
{
|
||||
get { return base.Mocker; }
|
||||
}
|
||||
public new AutoMoqer Mocker => base.Mocker;
|
||||
}
|
||||
}
|
@ -9,18 +9,12 @@ namespace NzbDrone.Core.Test.IndexerTests
|
||||
{
|
||||
public class TestIndexer : HttpIndexerBase<TestIndexerSettings>
|
||||
{
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Test Indexer";
|
||||
}
|
||||
}
|
||||
public override string Name => "Test Indexer";
|
||||
|
||||
public override DownloadProtocol Protocol { get { return DownloadProtocol.Usenet; } }
|
||||
public override DownloadProtocol Protocol => DownloadProtocol.Usenet;
|
||||
|
||||
public int _supportedPageSize;
|
||||
public override int PageSize { get { return _supportedPageSize; } }
|
||||
public override int PageSize => _supportedPageSize;
|
||||
|
||||
public TestIndexer(IHttpClient httpClient, IIndexerStatusService indexerStatusService, IConfigService configService, IParsingService parsingService, Logger logger)
|
||||
: base(httpClient, indexerStatusService, configService, parsingService, logger)
|
||||
|
@ -20,14 +20,8 @@ public class DatabaseTargetFixture : DbTest<DatabaseTarget, Log>
|
||||
private static string _uniqueMessage;
|
||||
Logger _logger;
|
||||
|
||||
protected override MigrationType MigrationType
|
||||
{
|
||||
get
|
||||
{
|
||||
return MigrationType.Log;
|
||||
protected override MigrationType MigrationType => MigrationType.Log;
|
||||
|
||||
}
|
||||
}
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
|
@ -17,12 +17,6 @@ public AnalyticsService(IConfigFileProvider configFileProvider)
|
||||
_configFileProvider = configFileProvider;
|
||||
}
|
||||
|
||||
public bool IsEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return _configFileProvider.AnalyticsEnabled && RuntimeInfoBase.IsProduction;
|
||||
}
|
||||
}
|
||||
public bool IsEnabled => _configFileProvider.AnalyticsEnabled && RuntimeInfoBase.IsProduction;
|
||||
}
|
||||
}
|
@ -6,21 +6,9 @@ public class BackupCommand : Command
|
||||
{
|
||||
public BackupType Type { get; set; }
|
||||
|
||||
public override bool SendUpdatesToClient
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public override bool SendUpdatesToClient => true;
|
||||
|
||||
public override bool UpdateScheduledTask
|
||||
{
|
||||
get
|
||||
{
|
||||
return Type == BackupType.Scheduled;
|
||||
}
|
||||
}
|
||||
public override bool UpdateScheduledTask => Type == BackupType.Scheduled;
|
||||
}
|
||||
|
||||
public enum BackupType
|
||||
|
@ -4,12 +4,6 @@ namespace NzbDrone.Core.Blacklisting
|
||||
{
|
||||
public class ClearBlacklistCommand : Command
|
||||
{
|
||||
public override bool SendUpdatesToClient
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public override bool SendUpdatesToClient => true;
|
||||
}
|
||||
}
|
@ -133,33 +133,15 @@ public string BindAddress
|
||||
}
|
||||
}
|
||||
|
||||
public int Port
|
||||
{
|
||||
get { return GetValueInt("Port", 8989); }
|
||||
}
|
||||
public int Port => GetValueInt("Port", 8989);
|
||||
|
||||
public int SslPort
|
||||
{
|
||||
get { return GetValueInt("SslPort", 9898); }
|
||||
}
|
||||
public int SslPort => GetValueInt("SslPort", 9898);
|
||||
|
||||
public bool EnableSsl
|
||||
{
|
||||
get { return GetValueBoolean("EnableSsl", false); }
|
||||
}
|
||||
public bool EnableSsl => GetValueBoolean("EnableSsl", false);
|
||||
|
||||
public bool LaunchBrowser
|
||||
{
|
||||
get { return GetValueBoolean("LaunchBrowser", true); }
|
||||
}
|
||||
public bool LaunchBrowser => GetValueBoolean("LaunchBrowser", true);
|
||||
|
||||
public string ApiKey
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetValue("ApiKey", GenerateApiKey());
|
||||
}
|
||||
}
|
||||
public string ApiKey => GetValue("ApiKey", GenerateApiKey());
|
||||
|
||||
public AuthenticationType AuthenticationMethod
|
||||
{
|
||||
@ -177,28 +159,13 @@ public AuthenticationType AuthenticationMethod
|
||||
}
|
||||
}
|
||||
|
||||
public bool AnalyticsEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetValueBoolean("AnalyticsEnabled", true, persist: false);
|
||||
}
|
||||
}
|
||||
public bool AnalyticsEnabled => GetValueBoolean("AnalyticsEnabled", true, persist: false);
|
||||
|
||||
public string Branch
|
||||
{
|
||||
get { return GetValue("Branch", "master").ToLowerInvariant(); }
|
||||
}
|
||||
public string Branch => GetValue("Branch", "master").ToLowerInvariant();
|
||||
|
||||
public string LogLevel
|
||||
{
|
||||
get { return GetValue("LogLevel", "Info"); }
|
||||
}
|
||||
public string LogLevel => GetValue("LogLevel", "Info");
|
||||
|
||||
public string SslCertHash
|
||||
{
|
||||
get { return GetValue("SslCertHash", ""); }
|
||||
}
|
||||
public string SslCertHash => GetValue("SslCertHash", "");
|
||||
|
||||
public string UrlBase
|
||||
{
|
||||
@ -215,28 +182,13 @@ public string UrlBase
|
||||
}
|
||||
}
|
||||
|
||||
public string UiFolder
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetValue("UiFolder", "UI", false);
|
||||
}
|
||||
}
|
||||
public string UiFolder => GetValue("UiFolder", "UI", false);
|
||||
|
||||
public bool UpdateAutomatically
|
||||
{
|
||||
get { return GetValueBoolean("UpdateAutomatically", false, false); }
|
||||
}
|
||||
public bool UpdateAutomatically => GetValueBoolean("UpdateAutomatically", false, false);
|
||||
|
||||
public UpdateMechanism UpdateMechanism
|
||||
{
|
||||
get { return GetValueEnum("UpdateMechanism", UpdateMechanism.BuiltIn, false); }
|
||||
}
|
||||
public UpdateMechanism UpdateMechanism => GetValueEnum("UpdateMechanism", UpdateMechanism.BuiltIn, false);
|
||||
|
||||
public string UpdateScriptPath
|
||||
{
|
||||
get { return GetValue("UpdateScriptPath", "", false ); }
|
||||
}
|
||||
public string UpdateScriptPath => GetValue("UpdateScriptPath", "", false );
|
||||
|
||||
public int GetValueInt(string key, int defaultValue)
|
||||
{
|
||||
|
@ -300,65 +300,29 @@ public bool CleanupMetadataImages
|
||||
set { SetValue("CleanupMetadataImages", value); }
|
||||
}
|
||||
|
||||
public string RijndaelPassphrase
|
||||
{
|
||||
get { return GetValue("RijndaelPassphrase", Guid.NewGuid().ToString(), true); }
|
||||
}
|
||||
public string RijndaelPassphrase => GetValue("RijndaelPassphrase", Guid.NewGuid().ToString(), true);
|
||||
|
||||
public string HmacPassphrase
|
||||
{
|
||||
get { return GetValue("HmacPassphrase", Guid.NewGuid().ToString(), true); }
|
||||
}
|
||||
public string HmacPassphrase => GetValue("HmacPassphrase", Guid.NewGuid().ToString(), true);
|
||||
|
||||
public string RijndaelSalt
|
||||
{
|
||||
get { return GetValue("RijndaelSalt", Guid.NewGuid().ToString(), true); }
|
||||
}
|
||||
public string RijndaelSalt => GetValue("RijndaelSalt", Guid.NewGuid().ToString(), true);
|
||||
|
||||
public string HmacSalt
|
||||
{
|
||||
get { return GetValue("HmacSalt", Guid.NewGuid().ToString(), true); }
|
||||
}
|
||||
public string HmacSalt => GetValue("HmacSalt", Guid.NewGuid().ToString(), true);
|
||||
|
||||
public bool ProxyEnabled
|
||||
{
|
||||
get { return GetValueBoolean("ProxyEnabled", false); }
|
||||
}
|
||||
public bool ProxyEnabled => GetValueBoolean("ProxyEnabled", false);
|
||||
|
||||
public ProxyType ProxyType
|
||||
{
|
||||
get { return GetValueEnum<ProxyType>("ProxyType", ProxyType.Http); }
|
||||
}
|
||||
public ProxyType ProxyType => GetValueEnum<ProxyType>("ProxyType", ProxyType.Http);
|
||||
|
||||
public string ProxyHostname
|
||||
{
|
||||
get { return GetValue("ProxyHostname", string.Empty); }
|
||||
}
|
||||
public string ProxyHostname => GetValue("ProxyHostname", string.Empty);
|
||||
|
||||
public int ProxyPort
|
||||
{
|
||||
get { return GetValueInt("ProxyPort", 8080); }
|
||||
}
|
||||
public int ProxyPort => GetValueInt("ProxyPort", 8080);
|
||||
|
||||
public string ProxyUsername
|
||||
{
|
||||
get { return GetValue("ProxyUsername", string.Empty); }
|
||||
}
|
||||
public string ProxyUsername => GetValue("ProxyUsername", string.Empty);
|
||||
|
||||
public string ProxyPassword
|
||||
{
|
||||
get { return GetValue("ProxyPassword", string.Empty); }
|
||||
}
|
||||
public string ProxyPassword => GetValue("ProxyPassword", string.Empty);
|
||||
|
||||
public string ProxyBypassFilter
|
||||
{
|
||||
get { return GetValue("ProxyBypassFilter", string.Empty); }
|
||||
}
|
||||
public string ProxyBypassFilter => GetValue("ProxyBypassFilter", string.Empty);
|
||||
|
||||
public bool ProxyBypassLocalAddresses
|
||||
{
|
||||
get { return GetValueBoolean("ProxyBypassLocalAddresses", true); }
|
||||
}
|
||||
public bool ProxyBypassLocalAddresses => GetValueBoolean("ProxyBypassLocalAddresses", true);
|
||||
|
||||
private string GetValue(string key)
|
||||
{
|
||||
|
@ -4,12 +4,6 @@ namespace NzbDrone.Core.Configuration
|
||||
{
|
||||
public class ResetApiKeyCommand : Command
|
||||
{
|
||||
public override bool SendUpdatesToClient
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public override bool SendUpdatesToClient => true;
|
||||
}
|
||||
}
|
||||
|
@ -40,10 +40,7 @@ namespace NzbDrone.Core.Datastore
|
||||
private readonly IDatabase _database;
|
||||
private readonly IEventAggregator _eventAggregator;
|
||||
|
||||
protected IDataMapper DataMapper
|
||||
{
|
||||
get { return _database.GetDataMapper(); }
|
||||
}
|
||||
protected IDataMapper DataMapper => _database.GetDataMapper();
|
||||
|
||||
public BasicRepository(IDatabase database, IEventAggregator eventAggregator)
|
||||
{
|
||||
@ -51,10 +48,7 @@ public BasicRepository(IDatabase database, IEventAggregator eventAggregator)
|
||||
_eventAggregator = eventAggregator;
|
||||
}
|
||||
|
||||
protected QueryBuilder<TModel> Query
|
||||
{
|
||||
get { return DataMapper.Query<TModel>(); }
|
||||
}
|
||||
protected QueryBuilder<TModel> Query => DataMapper.Query<TModel>();
|
||||
|
||||
protected void Delete(Expression<Func<TModel, bool>> filter)
|
||||
{
|
||||
@ -289,9 +283,6 @@ private void PublishModelEvent(TModel model, ModelAction action)
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual bool PublishModelEvents
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
protected virtual bool PublishModelEvents => false;
|
||||
}
|
||||
}
|
||||
|
@ -46,12 +46,6 @@ public object ToDB(object clrValue)
|
||||
}
|
||||
}
|
||||
|
||||
public Type DbType
|
||||
{
|
||||
get
|
||||
{
|
||||
return typeof(int);
|
||||
}
|
||||
}
|
||||
public Type DbType => typeof(int);
|
||||
}
|
||||
}
|
@ -60,12 +60,6 @@ public object ToDB(object clrValue)
|
||||
return JsonConvert.SerializeObject(clrValue, SerializerSetting);
|
||||
}
|
||||
|
||||
public Type DbType
|
||||
{
|
||||
get
|
||||
{
|
||||
return typeof(string);
|
||||
}
|
||||
}
|
||||
public Type DbType => typeof(string);
|
||||
}
|
||||
}
|
@ -6,13 +6,7 @@ namespace NzbDrone.Core.Datastore.Converters
|
||||
{
|
||||
public class EnumIntConverter : IConverter
|
||||
{
|
||||
public Type DbType
|
||||
{
|
||||
get
|
||||
{
|
||||
return typeof(int);
|
||||
}
|
||||
}
|
||||
public Type DbType => typeof(int);
|
||||
|
||||
public object FromDB(ConverterContext context)
|
||||
{
|
||||
|
@ -30,9 +30,6 @@ public object ToDB(object clrValue)
|
||||
return value.ToString();
|
||||
}
|
||||
|
||||
public Type DbType
|
||||
{
|
||||
get { return typeof(string); }
|
||||
}
|
||||
public Type DbType => typeof(string);
|
||||
}
|
||||
}
|
||||
|
@ -31,9 +31,6 @@ public object ToDB(object clrValue)
|
||||
return value.FullPath;
|
||||
}
|
||||
|
||||
public Type DbType
|
||||
{
|
||||
get { return typeof(string); }
|
||||
}
|
||||
public Type DbType => typeof(string);
|
||||
}
|
||||
}
|
||||
|
@ -38,13 +38,7 @@ public object ToDB(object clrValue)
|
||||
return (int)quality;
|
||||
}
|
||||
|
||||
public Type DbType
|
||||
{
|
||||
get
|
||||
{
|
||||
return typeof(int);
|
||||
}
|
||||
}
|
||||
public Type DbType => typeof(int);
|
||||
|
||||
public override bool CanConvert(Type objectType)
|
||||
{
|
||||
|
@ -27,12 +27,6 @@ public object ToDB(object clrValue)
|
||||
return dateTime.ToUniversalTime();
|
||||
}
|
||||
|
||||
public Type DbType
|
||||
{
|
||||
get
|
||||
{
|
||||
return typeof(DateTime);
|
||||
}
|
||||
}
|
||||
public Type DbType => typeof(DateTime);
|
||||
}
|
||||
}
|
@ -25,10 +25,7 @@ public IDataMapper GetDataMapper()
|
||||
return _database.GetDataMapper();
|
||||
}
|
||||
|
||||
public Version Version
|
||||
{
|
||||
get { return _database.Version; }
|
||||
}
|
||||
public Version Version => _database.Version;
|
||||
|
||||
public void Vacuum()
|
||||
{
|
||||
|
@ -25,10 +25,7 @@ public IDataMapper GetDataMapper()
|
||||
return _database.GetDataMapper();
|
||||
}
|
||||
|
||||
public Version Version
|
||||
{
|
||||
get { return _database.Version; }
|
||||
}
|
||||
public Version Version => _database.Version;
|
||||
|
||||
public void Vacuum()
|
||||
{
|
||||
|
@ -18,13 +18,7 @@ public NzbDroneSqliteProcessor(IDbConnection connection, IMigrationGenerator gen
|
||||
|
||||
}
|
||||
|
||||
public override bool SupportsTransactions
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public override bool SupportsTransactions => true;
|
||||
|
||||
public override void Process(AlterColumnExpression expression)
|
||||
{
|
||||
|
@ -16,15 +16,9 @@ public class SqliteSyntaxReader
|
||||
public TokenType Type { get; private set; }
|
||||
public string Value { get; private set; }
|
||||
|
||||
public string ValueToUpper
|
||||
{
|
||||
get { return Value.ToUpperInvariant(); }
|
||||
}
|
||||
public string ValueToUpper => Value.ToUpperInvariant();
|
||||
|
||||
public bool IsEndOfFile
|
||||
{
|
||||
get { return Index >= Buffer.Length; }
|
||||
}
|
||||
public bool IsEndOfFile => Index >= Buffer.Length;
|
||||
|
||||
public enum TokenType
|
||||
{
|
||||
|
@ -9,13 +9,7 @@ public class DownloadDecision
|
||||
public RemoteEpisode RemoteEpisode { get; private set; }
|
||||
public IEnumerable<Rejection> Rejections { get; private set; }
|
||||
|
||||
public bool Approved
|
||||
{
|
||||
get
|
||||
{
|
||||
return !Rejections.Any();
|
||||
}
|
||||
}
|
||||
public bool Approved => !Rejections.Any();
|
||||
|
||||
public bool TemporarilyRejected
|
||||
{
|
||||
|
@ -22,7 +22,7 @@ public AcceptableSizeSpecification(IQualityDefinitionService qualityDefinitionSe
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ public AnimeVersionUpgradeSpecification(QualityUpgradableSpecification qualityUp
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -17,7 +17,7 @@ public BlacklistSpecification(IBlacklistService blacklistService, Logger logger)
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -16,7 +16,7 @@ public CutoffSpecification(QualityUpgradableSpecification qualityUpgradableSpeci
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ public FullSeasonSpecification(Logger logger, IEpisodeService episodeService)
|
||||
_episodeService = episodeService;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ public LanguageSpecification(Logger logger)
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -16,7 +16,7 @@ public MinimumAgeSpecification(IConfigService configService, Logger logger)
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Temporary; } }
|
||||
public RejectionType Type => RejectionType.Temporary;
|
||||
|
||||
public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -8,7 +8,7 @@ public class NotSampleSpecification : IDecisionEngineSpecification
|
||||
{
|
||||
private readonly Logger _logger;
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public NotSampleSpecification(Logger logger)
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ public ProtocolSpecification(IDelayProfileService delayProfileService,
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ public QualityAllowedByProfileSpecification(Logger logger)
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -23,7 +23,7 @@ public QueueSpecification(IQueueService queueService,
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ public RawDiskSpecification(Logger logger)
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -20,7 +20,7 @@ public ReleaseRestrictionsSpecification(IRestrictionService restrictionService,
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -16,7 +16,7 @@ public RetentionSpecification(IConfigService configService, Logger logger)
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -26,7 +26,7 @@ public DelaySpecification(IPendingReleaseService pendingReleaseService,
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Temporary; } }
|
||||
public RejectionType Type => RejectionType.Temporary;
|
||||
|
||||
public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -26,7 +26,7 @@ public HistorySpecification(IHistoryService historyService,
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ public MonitoredEpisodeSpecification(Logger logger)
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -20,7 +20,7 @@ public ProperSpecification(QualityUpgradableSpecification qualityUpgradableSpeci
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -15,7 +15,7 @@ public SameEpisodesGrabSpecification(SameEpisodesSpecification sameEpisodesSpeci
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -16,7 +16,7 @@ public DailyEpisodeMatchSpecification(Logger logger, IEpisodeService episodeServ
|
||||
_episodeService = episodeService;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public Decision IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -15,7 +15,7 @@ public EpisodeRequestedSpecification(Logger logger)
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public Decision IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ public SeasonMatchSpecification(Logger logger)
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public Decision IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ public SeriesSpecification(Logger logger)
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public Decision IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ public SingleEpisodeSearchMatchSpecification(Logger logger)
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public Decision IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -13,13 +13,7 @@ public TorrentSeedingSpecification(Logger logger)
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return RejectionType.Permanent;
|
||||
}
|
||||
}
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
|
||||
public Decision IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteria)
|
||||
|
@ -16,7 +16,7 @@ public UpgradeDiskSpecification(QualityUpgradableSpecification qualityUpgradable
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public RejectionType Type { get { return RejectionType.Permanent; } }
|
||||
public RejectionType Type => RejectionType.Permanent;
|
||||
|
||||
public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
|
||||
{
|
||||
|
@ -24,13 +24,7 @@ public class TorrentBlackhole : TorrentClientBase<TorrentBlackholeSettings>
|
||||
|
||||
public TimeSpan ScanGracePeriod { get; set; }
|
||||
|
||||
public override bool PreferTorrentFile
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public override bool PreferTorrentFile => true;
|
||||
|
||||
public TorrentBlackhole(IScanWatchFolder scanWatchFolder,
|
||||
ITorrentFileInfoReader torrentFileInfoReader,
|
||||
@ -88,22 +82,9 @@ protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string
|
||||
return null;
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Torrent Blackhole";
|
||||
}
|
||||
}
|
||||
|
||||
public override ProviderMessage Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ProviderMessage("Magnet links are not supported.", ProviderMessageType.Warning);
|
||||
}
|
||||
}
|
||||
public override string Name => "Torrent Blackhole";
|
||||
|
||||
public override ProviderMessage Message => new ProviderMessage("Magnet links are not supported.", ProviderMessageType.Warning);
|
||||
|
||||
|
||||
public override IEnumerable<DownloadClientItem> GetItems()
|
||||
|
@ -52,13 +52,7 @@ protected override string AddFromNzbFile(RemoteEpisode remoteEpisode, string fil
|
||||
return null;
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Usenet Blackhole";
|
||||
}
|
||||
}
|
||||
public override string Name => "Usenet Blackhole";
|
||||
|
||||
public override IEnumerable<DownloadClientItem> GetItems()
|
||||
{
|
||||
|
@ -75,13 +75,7 @@ protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string
|
||||
return actualHash.ToUpper();
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Deluge";
|
||||
}
|
||||
}
|
||||
public override string Name => "Deluge";
|
||||
|
||||
public override IEnumerable<DownloadClientItem> GetItems()
|
||||
{
|
||||
|
@ -31,10 +31,7 @@ public Hadouken(IHadoukenProxy proxy,
|
||||
_proxy = proxy;
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get { return "Hadouken"; }
|
||||
}
|
||||
public override string Name => "Hadouken";
|
||||
|
||||
public override IEnumerable<DownloadClientItem> GetItems()
|
||||
{
|
||||
|
@ -43,13 +43,7 @@ protected override string AddFromNzbFile(RemoteEpisode remoteEpisode, string fil
|
||||
return response;
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "NZBVortex";
|
||||
}
|
||||
}
|
||||
public override string Name => "NZBVortex";
|
||||
|
||||
public override IEnumerable<DownloadClientItem> GetItems()
|
||||
{
|
||||
|
@ -7,13 +7,7 @@ public class NzbVortexJsonError
|
||||
public string Status { get; set; }
|
||||
public string Error { get; set; }
|
||||
|
||||
public bool Failed
|
||||
{
|
||||
get
|
||||
{
|
||||
return !string.IsNullOrWhiteSpace(Status) &&
|
||||
Status.Equals("false", StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
}
|
||||
public bool Failed => !string.IsNullOrWhiteSpace(Status) &&
|
||||
Status.Equals("false", StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
}
|
||||
|
@ -194,13 +194,7 @@ private IEnumerable<DownloadClientItem> GetHistory()
|
||||
return historyItems;
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "NZBGet";
|
||||
}
|
||||
}
|
||||
public override string Name => "NZBGet";
|
||||
|
||||
public override IEnumerable<DownloadClientItem> GetItems()
|
||||
{
|
||||
|
@ -28,21 +28,9 @@ public Pneumatic(IHttpClient httpClient,
|
||||
_httpClient = httpClient;
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Pneumatic";
|
||||
}
|
||||
}
|
||||
public override string Name => "Pneumatic";
|
||||
|
||||
public override DownloadProtocol Protocol
|
||||
{
|
||||
get
|
||||
{
|
||||
return DownloadProtocol.Usenet;
|
||||
}
|
||||
}
|
||||
public override DownloadProtocol Protocol => DownloadProtocol.Usenet;
|
||||
|
||||
public override string Download(RemoteEpisode remoteEpisode)
|
||||
{
|
||||
@ -70,13 +58,7 @@ public override string Download(RemoteEpisode remoteEpisode)
|
||||
return GetDownloadClientId(strmFile);
|
||||
}
|
||||
|
||||
public bool IsConfigured
|
||||
{
|
||||
get
|
||||
{
|
||||
return !string.IsNullOrWhiteSpace(Settings.NzbFolder);
|
||||
}
|
||||
}
|
||||
public bool IsConfigured => !string.IsNullOrWhiteSpace(Settings.NzbFolder);
|
||||
|
||||
public override IEnumerable<DownloadClientItem> GetItems()
|
||||
{
|
||||
|
@ -189,13 +189,7 @@ private IEnumerable<DownloadClientItem> GetHistory()
|
||||
return historyItems;
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "SABnzbd";
|
||||
}
|
||||
}
|
||||
public override string Name => "SABnzbd";
|
||||
|
||||
public override IEnumerable<DownloadClientItem> GetItems()
|
||||
{
|
||||
|
@ -7,13 +7,7 @@ public class SabnzbdJsonError
|
||||
public string Status { get; set; }
|
||||
public string Error { get; set; }
|
||||
|
||||
public bool Failed
|
||||
{
|
||||
get
|
||||
{
|
||||
return !string.IsNullOrWhiteSpace(Status) &&
|
||||
Status.Equals("false", StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
}
|
||||
public bool Failed => !string.IsNullOrWhiteSpace(Status) &&
|
||||
Status.Equals("false", StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
}
|
||||
|
@ -40,12 +40,6 @@ protected override ValidationFailure ValidateVersion()
|
||||
return null;
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Transmission";
|
||||
}
|
||||
}
|
||||
public override string Name => "Transmission";
|
||||
}
|
||||
}
|
||||
|
@ -49,12 +49,6 @@ protected override ValidationFailure ValidateVersion()
|
||||
return null;
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Vuze";
|
||||
}
|
||||
}
|
||||
public override string Name => "Vuze";
|
||||
}
|
||||
}
|
@ -71,13 +71,7 @@ protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string
|
||||
return hash;
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "qBittorrent";
|
||||
}
|
||||
}
|
||||
public override string Name => "qBittorrent";
|
||||
|
||||
public override IEnumerable<DownloadClientItem> GetItems()
|
||||
{
|
||||
|
@ -94,21 +94,9 @@ protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string
|
||||
}
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "rTorrent";
|
||||
}
|
||||
}
|
||||
public override string Name => "rTorrent";
|
||||
|
||||
public override ProviderMessage Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ProviderMessage("Sonarr is unable to remove torrents that have finished seeding when using rTorrent", ProviderMessageType.Warning);
|
||||
}
|
||||
}
|
||||
public override ProviderMessage Message => new ProviderMessage("Sonarr is unable to remove torrents that have finished seeding when using rTorrent", ProviderMessageType.Warning);
|
||||
|
||||
public override IEnumerable<DownloadClientItem> GetItems()
|
||||
{
|
||||
|
@ -68,13 +68,7 @@ protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string
|
||||
return hash;
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "uTorrent";
|
||||
}
|
||||
}
|
||||
public override string Name => "uTorrent";
|
||||
|
||||
public override IEnumerable<DownloadClientItem> GetItems()
|
||||
{
|
||||
|
@ -24,41 +24,17 @@ public abstract class DownloadClientBase<TSettings> : IDownloadClient
|
||||
|
||||
public abstract string Name { get; }
|
||||
|
||||
public Type ConfigContract
|
||||
{
|
||||
get
|
||||
{
|
||||
return typeof(TSettings);
|
||||
}
|
||||
}
|
||||
public Type ConfigContract => typeof(TSettings);
|
||||
|
||||
public virtual ProviderMessage Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public virtual ProviderMessage Message => null;
|
||||
|
||||
public IEnumerable<ProviderDefinition> DefaultDefinitions
|
||||
{
|
||||
get
|
||||
{
|
||||
return new List<ProviderDefinition>();
|
||||
}
|
||||
}
|
||||
public IEnumerable<ProviderDefinition> DefaultDefinitions => new List<ProviderDefinition>();
|
||||
|
||||
public ProviderDefinition Definition { get; set; }
|
||||
|
||||
public virtual object RequestAction(string action, IDictionary<string, string> query) { return null; }
|
||||
|
||||
protected TSettings Settings
|
||||
{
|
||||
get
|
||||
{
|
||||
return (TSettings)Definition.Settings;
|
||||
}
|
||||
}
|
||||
protected TSettings Settings => (TSettings)Definition.Settings;
|
||||
|
||||
protected DownloadClientBase(IConfigService configService,
|
||||
IDiskProvider diskProvider,
|
||||
|
@ -34,21 +34,9 @@ protected TorrentClientBase(ITorrentFileInfoReader torrentFileInfoReader,
|
||||
_torrentFileInfoReader = torrentFileInfoReader;
|
||||
}
|
||||
|
||||
public override DownloadProtocol Protocol
|
||||
{
|
||||
get
|
||||
{
|
||||
return DownloadProtocol.Torrent;
|
||||
}
|
||||
}
|
||||
public override DownloadProtocol Protocol => DownloadProtocol.Torrent;
|
||||
|
||||
public virtual bool PreferTorrentFile
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public virtual bool PreferTorrentFile => false;
|
||||
|
||||
protected abstract string AddFromMagnetLink(RemoteEpisode remoteEpisode, string hash, string magnetLink);
|
||||
protected abstract string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, byte[] fileContent);
|
||||
|
@ -28,13 +28,7 @@ protected UsenetClientBase(IHttpClient httpClient,
|
||||
_httpClient = httpClient;
|
||||
}
|
||||
|
||||
public override DownloadProtocol Protocol
|
||||
{
|
||||
get
|
||||
{
|
||||
return DownloadProtocol.Usenet;
|
||||
}
|
||||
}
|
||||
public override DownloadProtocol Protocol => DownloadProtocol.Usenet;
|
||||
|
||||
protected abstract string AddFromNzbFile(RemoteEpisode remoteEpisode, string filename, byte[] fileContent);
|
||||
|
||||
|
@ -48,13 +48,7 @@ public ExtraFileService(IExtraFileRepository<TExtraFile> repository,
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public virtual bool PermanentlyDelete
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public virtual bool PermanentlyDelete => false;
|
||||
|
||||
public List<TExtraFile> GetFilesBySeries(int seriesId)
|
||||
{
|
||||
|
@ -23,13 +23,7 @@ public MediaBrowserMetadata(
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Emby (Legacy)";
|
||||
}
|
||||
}
|
||||
public override string Name => "Emby (Legacy)";
|
||||
|
||||
public override MetadataFile FindMetadataFile(Series series, string path)
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user