From aba613acd19f8f1975f6d59be8bece0c59c4e551 Mon Sep 17 00:00:00 2001 From: Keivan Beigi Date: Thu, 8 Dec 2016 22:54:15 -0800 Subject: [PATCH] Because it's 2016! --- .../Authentication/EnableAuthInNancy.cs | 2 +- .../Pipelines/CacheHeaderPipeline.cs | 2 +- .../Extensions/Pipelines/CorsPipeline.cs | 2 +- .../Extensions/Pipelines/GZipPipeline.cs | 2 +- .../Pipelines/IfModifiedPipeline.cs | 2 +- .../Pipelines/NzbDroneVersionPipeline.cs | 2 +- .../Pipelines/RequestLoggingPipeline.cs | 2 +- src/NzbDrone.Api/Logs/LogFileModule.cs | 9 +- src/NzbDrone.Api/Logs/UpdateLogFileModule.cs | 8 +- src/NzbDrone.Api/NancyBootstrapper.cs | 13 +- .../Profiles/Languages/LanguageResource.cs | 2 +- src/NzbDrone.Api/REST/RestResource.cs | 8 +- src/NzbDrone.Api/TinyIoCNancyBootstrapper.cs | 5 +- .../PageModel/PageBase.cs | 48 +---- src/NzbDrone.Common/Cache/CacheManager.cs | 2 +- src/NzbDrone.Common/Cache/Cached.cs | 8 +- src/NzbDrone.Common/ConsoleService.cs | 5 +- src/NzbDrone.Common/Disk/DriveInfoMount.cs | 40 +--- src/NzbDrone.Common/Disk/OsPath.cs | 39 +--- .../EnvironmentInfo/BuildInfo.cs | 5 +- .../EnvironmentInfo/RuntimeInfoBase.cs | 13 +- .../EnvironmentInfo/StartupContext.cs | 16 +- .../Exceptron/ExceptronClient.cs | 10 +- .../Exceptron/Message/ExceptionResponse.cs | 8 +- .../Exceptron/fastJSON/SafeDictionary.cs | 8 +- .../Http/Dispatchers/CurlHttpDispatcher.cs | 5 +- src/NzbDrone.Common/Http/HttpResponse.cs | 8 +- src/NzbDrone.Common/Http/HttpUri.cs | 2 +- .../Http/Proxy/HttpProxySettings.cs | 22 +-- .../LimitedConcurrencyLevelTaskScheduler.cs | 2 +- src/NzbDrone.Common/TinyIoC.cs | 176 +++--------------- src/NzbDrone.Core.Test/Framework/DbTest.cs | 24 +-- .../Framework/MigrationTest.cs | 5 +- .../IndexerTests/TestIndexer.cs | 12 +- .../DatabaseTargetFixture.cs | 8 +- .../Analytics/AnalyticsService.cs | 8 +- src/NzbDrone.Core/Backup/BackupCommand.cs | 16 +- .../Blacklisting/ClearBlacklistCommand.cs | 8 +- .../Configuration/ConfigFileProvider.cs | 74 ++------ .../Configuration/ConfigService.cs | 60 ++---- .../Configuration/ResetApiKeyCommand.cs | 8 +- .../Datastore/BasicRepository.cs | 15 +- .../Converters/BooleanIntConverter.cs | 8 +- .../Converters/EmbeddedDocumentConverter.cs | 8 +- .../Datastore/Converters/EnumIntConverter.cs | 8 +- .../Datastore/Converters/GuidConverter.cs | 5 +- .../Datastore/Converters/OsPathConverter.cs | 5 +- .../Converters/QualityIntConverter.cs | 8 +- .../Datastore/Converters/UtcConverter.cs | 8 +- src/NzbDrone.Core/Datastore/LogDatabase.cs | 5 +- src/NzbDrone.Core/Datastore/MainDatabase.cs | 5 +- .../Framework/NzbDroneSqliteProcessor.cs | 8 +- .../Migration/Framework/SqliteSyntaxReader.cs | 10 +- .../DecisionEngine/DownloadDecision.cs | 8 +- .../AcceptableSizeSpecification.cs | 2 +- .../AnimeVersionUpgradeSpecification.cs | 2 +- .../Specifications/BlacklistSpecification.cs | 2 +- .../Specifications/CutoffSpecification.cs | 2 +- .../Specifications/FullSeasonSpecification.cs | 2 +- .../Specifications/LanguageSpecification.cs | 2 +- .../Specifications/MinimumAgeSpecification.cs | 2 +- .../Specifications/NotSampleSpecification.cs | 2 +- .../Specifications/ProtocolSpecification.cs | 2 +- .../QualityAllowedByProfileSpecification.cs | 2 +- .../Specifications/QueueSpecification.cs | 2 +- .../Specifications/RawDiskSpecification.cs | 2 +- .../ReleaseRestrictionsSpecification.cs | 2 +- .../Specifications/RetentionSpecification.cs | 2 +- .../RssSync/DelaySpecification.cs | 2 +- .../RssSync/HistorySpecification.cs | 2 +- .../RssSync/MonitoredEpisodeSpecification.cs | 2 +- .../RssSync/ProperSpecification.cs | 2 +- .../SameEpisodesGrabSpecification.cs | 2 +- .../Search/DailyEpisodeMatchSpecification.cs | 2 +- .../Search/EpisodeRequestedSpecification.cs | 2 +- .../Search/SeasonMatchSpecification.cs | 2 +- .../Search/SeriesSpecification.cs | 2 +- .../SingleEpisodeSearchMatchSpecification.cs | 2 +- .../Search/TorrentSeedingSpecification.cs | 8 +- .../UpgradeDiskSpecification.cs | 2 +- .../Clients/Blackhole/TorrentBlackhole.cs | 25 +-- .../Clients/Blackhole/UsenetBlackhole.cs | 8 +- .../Download/Clients/Deluge/Deluge.cs | 8 +- .../Download/Clients/Hadouken/Hadouken.cs | 5 +- .../Download/Clients/NzbVortex/NzbVortex.cs | 8 +- .../Clients/NzbVortex/NzbVortexJsonError.cs | 10 +- .../Download/Clients/Nzbget/Nzbget.cs | 8 +- .../Download/Clients/Pneumatic/Pneumatic.cs | 24 +-- .../Download/Clients/Sabnzbd/Sabnzbd.cs | 8 +- .../Clients/Sabnzbd/SabnzbdJsonError.cs | 10 +- .../Clients/Transmission/Transmission.cs | 8 +- .../Download/Clients/Vuze/Vuze.cs | 8 +- .../Clients/qBittorrent/QBittorrent.cs | 8 +- .../Download/Clients/rTorrent/RTorrent.cs | 16 +- .../Download/Clients/uTorrent/UTorrent.cs | 8 +- .../Download/DownloadClientBase.cs | 32 +--- .../Download/TorrentClientBase.cs | 16 +- .../Download/UsenetClientBase.cs | 8 +- .../Extras/Files/ExtraFileService.cs | 8 +- .../MediaBrowser/MediaBrowserMetadata.cs | 8 +- .../MediaBrowserMetadataSettings.cs | 8 +- .../Consumers/Roksbox/RoksboxMetadata.cs | 8 +- .../Roksbox/RoksboxMetadataSettings.cs | 8 +- .../MetaData/Consumers/Wdtv/WdtvMetadata.cs | 8 +- .../Consumers/Wdtv/WdtvMetadataSettings.cs | 8 +- .../MetaData/Consumers/Xbmc/XbmcMetadata.cs | 8 +- .../Consumers/Xbmc/XbmcMetadataSettings.cs | 8 +- .../MetaData/ExistingMetadataImporter.cs | 8 +- .../MetaData/Files/MetadataFileService.cs | 8 +- .../Extras/MetaData/MetadataBase.cs | 32 +--- .../Extras/MetaData/MetadataService.cs | 8 +- .../Others/ExistingOtherExtraImporter.cs | 8 +- .../Extras/Others/OtherExtraService.cs | 8 +- .../Subtitles/ExistingSubtitleImporter.cs | 8 +- .../Subtitles/SubtitleFileExtensions.cs | 5 +- .../Extras/Subtitles/SubtitleService.cs | 8 +- .../Checks/AppDataLocationCheck.cs | 8 +- .../HealthCheck/Checks/MediaInfoDllCheck.cs | 8 +- .../HealthCheck/Checks/MonoVersionCheck.cs | 16 +- .../HealthCheck/Checks/RootFolderCheck.cs | 8 +- .../HealthCheck/Checks/UpdateCheck.cs | 8 +- .../HealthCheck/HealthCheckBase.cs | 24 +-- .../CloudFlare/CloudFlareCaptchaException.cs | 5 +- .../Definitions/SearchCriteriaBase.cs | 8 +- .../Definitions/SeasonSearchCriteria.cs | 8 +- .../IndexerSearch/EpisodeSearchCommand.cs | 8 +- .../MissingEpisodeSearchCommand.cs | 8 +- .../IndexerSearch/SeasonSearchCommand.cs | 8 +- .../IndexerSearch/SeriesSearchCommand.cs | 8 +- src/NzbDrone.Core/Indexers/BitMeTv/BitMeTv.cs | 14 +- .../Indexers/BroadcastheNet/BroadcastheNet.cs | 16 +- .../Indexers/Exceptions/IndexerException.cs | 5 +- src/NzbDrone.Core/Indexers/Fanzub/Fanzub.cs | 10 +- src/NzbDrone.Core/Indexers/HDBits/HDBits.cs | 10 +- src/NzbDrone.Core/Indexers/HttpIndexerBase.cs | 10 +- .../Indexers/IPTorrents/IPTorrents.cs | 14 +- src/NzbDrone.Core/Indexers/IndexerBase.cs | 21 +-- .../Indexers/IndexerDefinition.cs | 8 +- .../Indexers/IndexerPageableRequestChain.cs | 5 +- src/NzbDrone.Core/Indexers/IndexerRequest.cs | 5 +- src/NzbDrone.Core/Indexers/IndexerResponse.cs | 20 +- .../KickassTorrents/KickassTorrents.cs | 12 +- src/NzbDrone.Core/Indexers/Newznab/Newznab.cs | 16 +- src/NzbDrone.Core/Indexers/Nyaa/Nyaa.cs | 12 +- .../Indexers/Omgwtfnzbs/Omgwtfnzbs.cs | 10 +- src/NzbDrone.Core/Indexers/Rarbg/Rarbg.cs | 8 +- src/NzbDrone.Core/Indexers/RssSyncCommand.cs | 9 +- .../Indexers/TorrentRss/TorrentRssIndexer.cs | 14 +- .../Indexers/Torrentleech/Torrentleech.cs | 14 +- src/NzbDrone.Core/Indexers/Torznab/Torznab.cs | 15 +- src/NzbDrone.Core/Indexers/Wombles/Wombles.cs | 12 +- .../Commands/ClearLogCommand.cs | 8 +- .../Commands/DeleteLogFilesCommand.cs | 8 +- .../Commands/DeleteUpdateLogFilesCommand.cs | 8 +- .../Commands/DownloadedEpisodesScanCommand.cs | 8 +- .../MediaFiles/Commands/RenameFilesCommand.cs | 8 +- .../Commands/RenameSeriesCommand.cs | 8 +- .../Commands/RescanSeriesCommand.cs | 8 +- .../MediaFiles/EpisodeImport/DetectSample.cs | 8 +- .../EpisodeImport/ImportDecision.cs | 8 +- .../Manual/ManualImportCommand.cs | 8 +- .../SameEpisodesImportSpecification.cs | 2 +- .../MediaFiles/MediaFileExtensions.cs | 5 +- .../Messaging/Commands/Command.cs | 24 +-- .../Messaging/Commands/CommandQueue.cs | 24 +-- .../Messaging/Commands/TestCommand.cs | 10 +- .../Notifications/Boxcar/Boxcar.cs | 21 +-- .../CustomScript/CustomScript.cs | 13 +- .../Notifications/Email/Email.cs | 21 +-- .../Notifications/Growl/Growl.cs | 21 +-- .../Notifications/Growl/GrowlSettings.cs | 8 +- src/NzbDrone.Core/Notifications/Join/Join.cs | 21 +-- .../MediaBrowser/MediaBrowser.cs | 13 +- .../MediaBrowser/MediaBrowserSettings.cs | 12 +- .../Notifications/NotificationBase.cs | 40 +--- .../Notifications/NotificationDefinition.cs | 8 +- .../NotifyMyAndroid/NotifyMyAndroid.cs | 21 +-- .../NotifyMyAndroidSettings.cs | 8 +- .../Notifications/Plex/PlexClient.cs | 21 +-- .../Notifications/Plex/PlexClientSettings.cs | 8 +- .../Notifications/Plex/PlexHomeTheater.cs | 21 +-- .../Notifications/Plex/PlexServer.cs | 21 +-- .../Notifications/Plex/PlexServerSettings.cs | 8 +- .../Notifications/Prowl/Prowl.cs | 21 +-- .../Notifications/Prowl/ProwlSettings.cs | 8 +- .../Notifications/PushBullet/PushBullet.cs | 21 +-- .../Notifications/Pushalot/Pushalot.cs | 21 +-- .../Pushalot/PushalotSettings.cs | 8 +- .../Notifications/Pushover/Pushover.cs | 21 +-- .../Pushover/PushoverSettings.cs | 8 +- .../Notifications/Slack/Slack.cs | 13 +- .../Notifications/Synology/SynologyIndexer.cs | 13 +- .../Notifications/Telegram/Telegram.cs | 21 +-- .../Telegram/TelegramSettings.cs | 8 +- .../Notifications/Twitter/Twitter.cs | 21 +-- .../Notifications/Webhook/Webhook.cs | 13 +- src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs | 13 +- .../Notifications/Xbmc/XbmcSettings.cs | 2 +- src/NzbDrone.Core/Organizer/NamingConfig.cs | 26 +-- .../Parser/Model/LocalEpisode.cs | 8 +- src/NzbDrone.Core/Qualities/Quality.cs | 30 +-- .../RemotePathMappingRepository.cs | 8 +- .../RootFolders/RootFolderRepository.cs | 8 +- .../Tv/Commands/RefreshSeriesCommand.cs | 16 +- src/NzbDrone.Core/Tv/Episode.cs | 5 +- .../Commands/ApplicationUpdateCommand.cs | 16 +- .../Validation/NzbDroneValidationResult.cs | 13 +- src/NzbDrone.Host/AccessControl/UrlAcl.cs | 8 +- .../Owin/MiddleWare/NancyMiddleWare.cs | 2 +- .../MiddleWare/NzbDroneVersionMiddleWare.cs | 2 +- .../Owin/MiddleWare/SignalRMiddleWare.cs | 2 +- src/NzbDrone.Host/Owin/NlogTextWriter.cs | 8 +- .../IntegrationTest.cs | 15 +- .../IntegrationTestBase.cs | 8 +- src/NzbDrone.Mono/Disk/ProcMount.cs | 25 +-- .../NzbDronePersistentConnection.cs | 8 +- .../ConcurrencyCounter.cs | 2 +- .../EnvironmentInfo/DotNetRuntimeProvider.cs | 8 +- .../ServiceInstall/ServiceHelper.cs | 8 +- .../ServiceUninstall/ServiceHelper.cs | 8 +- 220 files changed, 450 insertions(+), 2053 deletions(-) diff --git a/src/NzbDrone.Api/Authentication/EnableAuthInNancy.cs b/src/NzbDrone.Api/Authentication/EnableAuthInNancy.cs index b4e6cce62..f6efc16ce 100644 --- a/src/NzbDrone.Api/Authentication/EnableAuthInNancy.cs +++ b/src/NzbDrone.Api/Authentication/EnableAuthInNancy.cs @@ -27,7 +27,7 @@ namespace NzbDrone.Api.Authentication _configFileProvider = configFileProvider; } - public int Order { get { return 10; } } + public int Order => 10; public void Register(IPipelines pipelines) { diff --git a/src/NzbDrone.Api/Extensions/Pipelines/CacheHeaderPipeline.cs b/src/NzbDrone.Api/Extensions/Pipelines/CacheHeaderPipeline.cs index 1ff6854d0..94c738d9b 100644 --- a/src/NzbDrone.Api/Extensions/Pipelines/CacheHeaderPipeline.cs +++ b/src/NzbDrone.Api/Extensions/Pipelines/CacheHeaderPipeline.cs @@ -14,7 +14,7 @@ namespace NzbDrone.Api.Extensions.Pipelines _cacheableSpecification = cacheableSpecification; } - public int Order { get { return 0; } } + public int Order => 0; public void Register(IPipelines pipelines) { diff --git a/src/NzbDrone.Api/Extensions/Pipelines/CorsPipeline.cs b/src/NzbDrone.Api/Extensions/Pipelines/CorsPipeline.cs index 5536388e0..b8c83298a 100644 --- a/src/NzbDrone.Api/Extensions/Pipelines/CorsPipeline.cs +++ b/src/NzbDrone.Api/Extensions/Pipelines/CorsPipeline.cs @@ -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) { diff --git a/src/NzbDrone.Api/Extensions/Pipelines/GZipPipeline.cs b/src/NzbDrone.Api/Extensions/Pipelines/GZipPipeline.cs index e7be5fd44..12293f23c 100644 --- a/src/NzbDrone.Api/Extensions/Pipelines/GZipPipeline.cs +++ b/src/NzbDrone.Api/Extensions/Pipelines/GZipPipeline.cs @@ -13,7 +13,7 @@ namespace NzbDrone.Api.Extensions.Pipelines { private readonly Logger _logger; - public int Order { get { return 0; } } + public int Order => 0; public GzipCompressionPipeline(Logger logger) { diff --git a/src/NzbDrone.Api/Extensions/Pipelines/IfModifiedPipeline.cs b/src/NzbDrone.Api/Extensions/Pipelines/IfModifiedPipeline.cs index 5a816ef37..68abf4ade 100644 --- a/src/NzbDrone.Api/Extensions/Pipelines/IfModifiedPipeline.cs +++ b/src/NzbDrone.Api/Extensions/Pipelines/IfModifiedPipeline.cs @@ -14,7 +14,7 @@ namespace NzbDrone.Api.Extensions.Pipelines _cacheableSpecification = cacheableSpecification; } - public int Order { get { return 0; } } + public int Order => 0; public void Register(IPipelines pipelines) { diff --git a/src/NzbDrone.Api/Extensions/Pipelines/NzbDroneVersionPipeline.cs b/src/NzbDrone.Api/Extensions/Pipelines/NzbDroneVersionPipeline.cs index c7ef8fd0c..00488657b 100644 --- a/src/NzbDrone.Api/Extensions/Pipelines/NzbDroneVersionPipeline.cs +++ b/src/NzbDrone.Api/Extensions/Pipelines/NzbDroneVersionPipeline.cs @@ -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) { diff --git a/src/NzbDrone.Api/Extensions/Pipelines/RequestLoggingPipeline.cs b/src/NzbDrone.Api/Extensions/Pipelines/RequestLoggingPipeline.cs index 766fa886d..4f1c01e93 100644 --- a/src/NzbDrone.Api/Extensions/Pipelines/RequestLoggingPipeline.cs +++ b/src/NzbDrone.Api/Extensions/Pipelines/RequestLoggingPipeline.cs @@ -23,7 +23,7 @@ namespace NzbDrone.Api.Extensions.Pipelines _errorPipeline = errorPipeline; } - public int Order { get { return 100; } } + public int Order => 100; public void Register(IPipelines pipelines) { diff --git a/src/NzbDrone.Api/Logs/LogFileModule.cs b/src/NzbDrone.Api/Logs/LogFileModule.cs index 464d8d041..bed6f7de2 100644 --- a/src/NzbDrone.Api/Logs/LogFileModule.cs +++ b/src/NzbDrone.Api/Logs/LogFileModule.cs @@ -31,13 +31,6 @@ namespace NzbDrone.Api.Logs return Path.Combine(_appFolderInfo.GetLogFolder(), filename); } - protected override string DownloadUrlRoot - { - get - { - return "logfile"; - } - } - + protected override string DownloadUrlRoot => "logfile"; } } \ No newline at end of file diff --git a/src/NzbDrone.Api/Logs/UpdateLogFileModule.cs b/src/NzbDrone.Api/Logs/UpdateLogFileModule.cs index f5cec860e..38cb82587 100644 --- a/src/NzbDrone.Api/Logs/UpdateLogFileModule.cs +++ b/src/NzbDrone.Api/Logs/UpdateLogFileModule.cs @@ -38,12 +38,6 @@ namespace NzbDrone.Api.Logs return Path.Combine(_appFolderInfo.GetUpdateLogFolder(), filename); } - protected override string DownloadUrlRoot - { - get - { - return "updatelogfile"; - } - } + protected override string DownloadUrlRoot => "updatelogfile"; } } \ No newline at end of file diff --git a/src/NzbDrone.Api/NancyBootstrapper.cs b/src/NzbDrone.Api/NancyBootstrapper.cs index 0fe365808..3f599e397 100644 --- a/src/NzbDrone.Api/NancyBootstrapper.cs +++ b/src/NzbDrone.Api/NancyBootstrapper.cs @@ -55,17 +55,8 @@ namespace NzbDrone.Api 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; } } \ No newline at end of file diff --git a/src/NzbDrone.Api/Profiles/Languages/LanguageResource.cs b/src/NzbDrone.Api/Profiles/Languages/LanguageResource.cs index 182e86a29..39ccf7d5f 100644 --- a/src/NzbDrone.Api/Profiles/Languages/LanguageResource.cs +++ b/src/NzbDrone.Api/Profiles/Languages/LanguageResource.cs @@ -9,6 +9,6 @@ namespace NzbDrone.Api.Profiles.Languages [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(); } } \ No newline at end of file diff --git a/src/NzbDrone.Api/REST/RestResource.cs b/src/NzbDrone.Api/REST/RestResource.cs index cf9156199..ec9f195c6 100644 --- a/src/NzbDrone.Api/REST/RestResource.cs +++ b/src/NzbDrone.Api/REST/RestResource.cs @@ -8,12 +8,6 @@ namespace NzbDrone.Api.REST 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", ""); } } \ No newline at end of file diff --git a/src/NzbDrone.Api/TinyIoCNancyBootstrapper.cs b/src/NzbDrone.Api/TinyIoCNancyBootstrapper.cs index d2474352f..5be766761 100644 --- a/src/NzbDrone.Api/TinyIoCNancyBootstrapper.cs +++ b/src/NzbDrone.Api/TinyIoCNancyBootstrapper.cs @@ -31,10 +31,7 @@ namespace NzbDrone.Api /// does not mean the assembly *will* be included, a true from another delegate will /// take precedence. /// - protected virtual IEnumerable> AutoRegisterIgnoredAssemblies - { - get { return DefaultAutoRegisterIgnoredAssemblies; } - } + protected virtual IEnumerable> AutoRegisterIgnoredAssemblies => DefaultAutoRegisterIgnoredAssemblies; /// /// Configures the container using AutoRegister followed by registration diff --git a/src/NzbDrone.Automation.Test/PageModel/PageBase.cs b/src/NzbDrone.Automation.Test/PageModel/PageBase.cs index de4485a93..f835c39a6 100644 --- a/src/NzbDrone.Automation.Test/PageModel/PageBase.cs +++ b/src/NzbDrone.Automation.Test/PageModel/PageBase.cs @@ -47,52 +47,16 @@ namespace NzbDrone.Automation.Test.PageModel }); } - 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"); } } \ No newline at end of file diff --git a/src/NzbDrone.Common/Cache/CacheManager.cs b/src/NzbDrone.Common/Cache/CacheManager.cs index ec44a8fa8..7c2ef01f3 100644 --- a/src/NzbDrone.Common/Cache/CacheManager.cs +++ b/src/NzbDrone.Common/Cache/CacheManager.cs @@ -28,7 +28,7 @@ namespace NzbDrone.Common.Cache _cache.Clear(); } - public ICollection Caches { get { return _cache.Values; } } + public ICollection Caches => _cache.Values; public ICached GetCache(Type host) { diff --git a/src/NzbDrone.Common/Cache/Cached.cs b/src/NzbDrone.Common/Cache/Cached.cs index f1dc9ab59..928809d30 100644 --- a/src/NzbDrone.Common/Cache/Cached.cs +++ b/src/NzbDrone.Common/Cache/Cached.cs @@ -67,13 +67,7 @@ namespace NzbDrone.Common.Cache _store.TryRemove(key, out value); } - public int Count - { - get - { - return _store.Count; - } - } + public int Count => _store.Count; public T Get(string key, Func function, TimeSpan? lifeTime = null) { diff --git a/src/NzbDrone.Common/ConsoleService.cs b/src/NzbDrone.Common/ConsoleService.cs index b30febb6b..321831277 100644 --- a/src/NzbDrone.Common/ConsoleService.cs +++ b/src/NzbDrone.Common/ConsoleService.cs @@ -14,10 +14,7 @@ namespace NzbDrone.Common 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() { diff --git a/src/NzbDrone.Common/Disk/DriveInfoMount.cs b/src/NzbDrone.Common/Disk/DriveInfoMount.cs index 5d53817a2..ac039d719 100644 --- a/src/NzbDrone.Common/Disk/DriveInfoMount.cs +++ b/src/NzbDrone.Common/Disk/DriveInfoMount.cs @@ -14,15 +14,9 @@ namespace NzbDrone.Common.Disk _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 @@ namespace NzbDrone.Common.Disk } } - 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 { diff --git a/src/NzbDrone.Common/Disk/OsPath.cs b/src/NzbDrone.Common/Disk/OsPath.cs index cfd439632..bed4c67c6 100644 --- a/src/NzbDrone.Common/Disk/OsPath.cs +++ b/src/NzbDrone.Common/Disk/OsPath.cs @@ -77,28 +77,13 @@ namespace NzbDrone.Common.Disk 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 @@ namespace NzbDrone.Common.Disk } } - public string FullPath - { - get - { - return _path; - } - } + public string FullPath => _path; public string FileName { @@ -162,13 +141,7 @@ namespace NzbDrone.Common.Disk } } - public bool IsValid - { - get - { - return _path.IsPathValid(); - } - } + public bool IsValid => _path.IsPathValid(); private int GetFileNameIndex() { diff --git a/src/NzbDrone.Common/EnvironmentInfo/BuildInfo.cs b/src/NzbDrone.Common/EnvironmentInfo/BuildInfo.cs index 56a010dd0..03f0cd7c9 100644 --- a/src/NzbDrone.Common/EnvironmentInfo/BuildInfo.cs +++ b/src/NzbDrone.Common/EnvironmentInfo/BuildInfo.cs @@ -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 { diff --git a/src/NzbDrone.Common/EnvironmentInfo/RuntimeInfoBase.cs b/src/NzbDrone.Common/EnvironmentInfo/RuntimeInfoBase.cs index aaff1eec0..2db303551 100644 --- a/src/NzbDrone.Common/EnvironmentInfo/RuntimeInfoBase.cs +++ b/src/NzbDrone.Common/EnvironmentInfo/RuntimeInfoBase.cs @@ -36,18 +36,9 @@ namespace NzbDrone.Common.EnvironmentInfo 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 { diff --git a/src/NzbDrone.Common/EnvironmentInfo/StartupContext.cs b/src/NzbDrone.Common/EnvironmentInfo/StartupContext.cs index 064f57253..49925b415 100644 --- a/src/NzbDrone.Common/EnvironmentInfo/StartupContext.cs +++ b/src/NzbDrone.Common/EnvironmentInfo/StartupContext.cs @@ -47,21 +47,9 @@ namespace NzbDrone.Common.EnvironmentInfo public HashSet Flags { get; private set; } public Dictionary 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 { diff --git a/src/NzbDrone.Common/Exceptron/ExceptronClient.cs b/src/NzbDrone.Common/Exceptron/ExceptronClient.cs index 5dca71a4b..e87844eb7 100644 --- a/src/NzbDrone.Common/Exceptron/ExceptronClient.cs +++ b/src/NzbDrone.Common/Exceptron/ExceptronClient.cs @@ -15,19 +15,13 @@ namespace NzbDrone.Common.Exceptron /// /// Version of Client /// - public string ClientVersion - { - get { return Assembly.GetExecutingAssembly().GetName().Version.ToString(); } - } + public string ClientVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString(); /// /// Name of Client /// - public string ClientName - { - get { return "Official .NET"; } - } + public string ClientName => "Official .NET"; /// /// Client Configuration diff --git a/src/NzbDrone.Common/Exceptron/Message/ExceptionResponse.cs b/src/NzbDrone.Common/Exceptron/Message/ExceptionResponse.cs index 92dbd2b4c..7fad1ba3f 100644 --- a/src/NzbDrone.Common/Exceptron/Message/ExceptionResponse.cs +++ b/src/NzbDrone.Common/Exceptron/Message/ExceptionResponse.cs @@ -14,13 +14,7 @@ namespace NzbDrone.Common.Exceptron.Message /// /// Was the report successfully processed on the server /// - public bool Successful - { - get - { - return !string.IsNullOrEmpty(RefId); - } - } + public bool Successful => !string.IsNullOrEmpty(RefId); /// /// Exception that caused the message to fail. diff --git a/src/NzbDrone.Common/Exceptron/fastJSON/SafeDictionary.cs b/src/NzbDrone.Common/Exceptron/fastJSON/SafeDictionary.cs index d35b98b49..a4cb5f06b 100644 --- a/src/NzbDrone.Common/Exceptron/fastJSON/SafeDictionary.cs +++ b/src/NzbDrone.Common/Exceptron/fastJSON/SafeDictionary.cs @@ -16,13 +16,7 @@ namespace NzbDrone.Common.Exceptron.fastJSON 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) { diff --git a/src/NzbDrone.Common/Http/Dispatchers/CurlHttpDispatcher.cs b/src/NzbDrone.Common/Http/Dispatchers/CurlHttpDispatcher.cs index 0399dc914..2c456536c 100644 --- a/src/NzbDrone.Common/Http/Dispatchers/CurlHttpDispatcher.cs +++ b/src/NzbDrone.Common/Http/Dispatchers/CurlHttpDispatcher.cs @@ -328,9 +328,6 @@ namespace NzbDrone.Common.Http.Dispatchers return true; } - public override bool IsInvalid - { - get { return !_initialized || !_available; } - } + public override bool IsInvalid => !_initialized || !_available; } } diff --git a/src/NzbDrone.Common/Http/HttpResponse.cs b/src/NzbDrone.Common/Http/HttpResponse.cs index bbbf71d11..dd9df22c7 100644 --- a/src/NzbDrone.Common/Http/HttpResponse.cs +++ b/src/NzbDrone.Common/Http/HttpResponse.cs @@ -49,13 +49,7 @@ namespace NzbDrone.Common.Http } - public bool HasHttpError - { - get - { - return (int)StatusCode >= 400; - } - } + public bool HasHttpError => (int)StatusCode >= 400; public Dictionary GetCookies() { diff --git a/src/NzbDrone.Common/Http/HttpUri.cs b/src/NzbDrone.Common/Http/HttpUri.cs index a52a06137..7e295780b 100644 --- a/src/NzbDrone.Common/Http/HttpUri.cs +++ b/src/NzbDrone.Common/Http/HttpUri.cs @@ -13,7 +13,7 @@ namespace NzbDrone.Common.Http private static readonly Regex RegexUri = new Regex(@"^(?:(?[a-z]+):)?(?://(?[-A-Z0-9.]+)(?::(?[0-9]{1,5}))?)?(?(?:(?:(?<=^)|/)[^/?#\r\n]+)+/?|/)?(?:\?(?[^#\r\n]*))?(?:\#(?.*))?$", RegexOptions.Compiled | RegexOptions.IgnoreCase); private readonly string _uri; - public string FullUri { get { return _uri; } } + public string FullUri => _uri; public HttpUri(string uri) { diff --git a/src/NzbDrone.Common/Http/Proxy/HttpProxySettings.cs b/src/NzbDrone.Common/Http/Proxy/HttpProxySettings.cs index 84664bf8a..28dda0abc 100644 --- a/src/NzbDrone.Common/Http/Proxy/HttpProxySettings.cs +++ b/src/NzbDrone.Common/Http/Proxy/HttpProxySettings.cs @@ -45,19 +45,13 @@ namespace NzbDrone.Common.Http.Proxy } } - 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); } } diff --git a/src/NzbDrone.Common/TPL/LimitedConcurrencyLevelTaskScheduler.cs b/src/NzbDrone.Common/TPL/LimitedConcurrencyLevelTaskScheduler.cs index bc17dcc95..8e336668e 100644 --- a/src/NzbDrone.Common/TPL/LimitedConcurrencyLevelTaskScheduler.cs +++ b/src/NzbDrone.Common/TPL/LimitedConcurrencyLevelTaskScheduler.cs @@ -111,7 +111,7 @@ namespace NzbDrone.Common.TPL } /// Gets the maximum concurrency level supported by this scheduler. - public sealed override int MaximumConcurrencyLevel { get { return _maxDegreeOfParallelism; } } + public sealed override int MaximumConcurrencyLevel => _maxDegreeOfParallelism; /// Gets an enumerable of the tasks currently scheduled on this scheduler. /// An enumerable of the tasks currently scheduled. diff --git a/src/NzbDrone.Common/TinyIoC.cs b/src/NzbDrone.Common/TinyIoC.cs index 72b55f13a..7c5d7196f 100644 --- a/src/NzbDrone.Common/TinyIoC.cs +++ b/src/NzbDrone.Common/TinyIoC.cs @@ -669,13 +669,7 @@ namespace TinyIoC 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 @@ namespace TinyIoC /// /// Gets the default options (attempt resolution of unregistered types, fail on named resolution if name not found) /// - public static ResolveOptions Default - { - get - { - return _Default; - } - } + public static ResolveOptions Default => _Default; /// /// Preconfigured option for attempting resolution of unregistered types and failing on named resolution if name not found /// - public static ResolveOptions FailNameNotFoundOnly - { - get - { - return _FailNameNotFoundOnly; - } - } + public static ResolveOptions FailNameNotFoundOnly => _FailNameNotFoundOnly; /// /// Preconfigured option for failing on resolving unregistered types and on named resolution if name not found /// - public static ResolveOptions FailUnregisteredAndNameNotFound - { - get - { - return _FailUnregisteredAndNameNotFound; - } - } + public static ResolveOptions FailUnregisteredAndNameNotFound => _FailUnregisteredAndNameNotFound; /// /// Preconfigured option for failing on resolving unregistered types, but attempting unnamed resolution if name not found /// - public static ResolveOptions FailUnregisteredOnly - { - get - { - return _FailUnregisteredOnly; - } - } + public static ResolveOptions FailUnregisteredOnly => _FailUnregisteredOnly; } #endregion @@ -2394,7 +2364,7 @@ namespace TinyIoC /// Generally set to true for delegate style factories as CanResolve cannot delve /// into the delegates they contain. /// - public virtual bool AssumeConstruction { get { return false; } } + public virtual bool AssumeConstruction => false; /// /// The type the factory instantiates @@ -2471,7 +2441,7 @@ namespace TinyIoC { 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 @@ namespace TinyIoC } } - 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; } /// @@ -2532,9 +2490,9 @@ namespace TinyIoC private Func _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 @@ namespace TinyIoC 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 @@ namespace TinyIoC 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 @@ namespace TinyIoC } } - public override ObjectFactoryBase WeakReferenceVariant - { - get - { - return this; - } - } + public override ObjectFactoryBase WeakReferenceVariant => this; public override void SetConstructor(ConstructorInfo constructor) { @@ -2657,7 +2597,7 @@ namespace TinyIoC 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 @@ namespace TinyIoC _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 @@ namespace TinyIoC _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 @@ namespace TinyIoC 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 @@ namespace TinyIoC 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 @@ namespace TinyIoC 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 @@ namespace TinyIoC _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 @@ namespace TinyIoC /// /// Lazy created Singleton instance of the container for simple scenarios /// - public static TinyIoCContainer Current - { - get - { - return _Current; - } - } + public static TinyIoCContainer Current => _Current; + #endregion #region Type Registrations diff --git a/src/NzbDrone.Core.Test/Framework/DbTest.cs b/src/NzbDrone.Core.Test/Framework/DbTest.cs index ae59fbe23..f1ee43be5 100644 --- a/src/NzbDrone.Core.Test/Framework/DbTest.cs +++ b/src/NzbDrone.Core.Test/Framework/DbTest.cs @@ -23,21 +23,9 @@ namespace NzbDrone.Core.Test.Framework protected BasicRepository Storage { get; private set; } - protected IList AllStoredModels - { - get - { - return Storage.All().ToList(); - } - } + protected IList 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 @@ namespace NzbDrone.Core.Test.Framework { private ITestDatabase _db; - protected virtual MigrationType MigrationType - { - get - { - return MigrationType.Main; - } - } + protected virtual MigrationType MigrationType => MigrationType.Main; protected ITestDatabase Db { diff --git a/src/NzbDrone.Core.Test/Framework/MigrationTest.cs b/src/NzbDrone.Core.Test/Framework/MigrationTest.cs index 1a49bedfd..c1d0bfb21 100644 --- a/src/NzbDrone.Core.Test/Framework/MigrationTest.cs +++ b/src/NzbDrone.Core.Test/Framework/MigrationTest.cs @@ -45,9 +45,6 @@ namespace NzbDrone.Core.Test.Framework } [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; } } \ No newline at end of file diff --git a/src/NzbDrone.Core.Test/IndexerTests/TestIndexer.cs b/src/NzbDrone.Core.Test/IndexerTests/TestIndexer.cs index 528a88104..856f1900a 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/TestIndexer.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/TestIndexer.cs @@ -9,18 +9,12 @@ namespace NzbDrone.Core.Test.IndexerTests { public class TestIndexer : HttpIndexerBase { - 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) diff --git a/src/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs b/src/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs index ae7393eee..ad614e646 100644 --- a/src/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs +++ b/src/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs @@ -20,14 +20,8 @@ namespace NzbDrone.Core.Test.InstrumentationTests private static string _uniqueMessage; Logger _logger; - protected override MigrationType MigrationType - { - get - { - return MigrationType.Log; + protected override MigrationType MigrationType => MigrationType.Log; - } - } [SetUp] public void Setup() { diff --git a/src/NzbDrone.Core/Analytics/AnalyticsService.cs b/src/NzbDrone.Core/Analytics/AnalyticsService.cs index 8901817a9..0ddb9813d 100644 --- a/src/NzbDrone.Core/Analytics/AnalyticsService.cs +++ b/src/NzbDrone.Core/Analytics/AnalyticsService.cs @@ -17,12 +17,6 @@ namespace NzbDrone.Core.Analytics _configFileProvider = configFileProvider; } - public bool IsEnabled - { - get - { - return _configFileProvider.AnalyticsEnabled && RuntimeInfoBase.IsProduction; - } - } + public bool IsEnabled => _configFileProvider.AnalyticsEnabled && RuntimeInfoBase.IsProduction; } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Backup/BackupCommand.cs b/src/NzbDrone.Core/Backup/BackupCommand.cs index 72fd2ddcc..3a852cf7a 100644 --- a/src/NzbDrone.Core/Backup/BackupCommand.cs +++ b/src/NzbDrone.Core/Backup/BackupCommand.cs @@ -6,21 +6,9 @@ namespace NzbDrone.Core.Backup { 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 diff --git a/src/NzbDrone.Core/Blacklisting/ClearBlacklistCommand.cs b/src/NzbDrone.Core/Blacklisting/ClearBlacklistCommand.cs index 03e9b2e5e..d8aa3af0a 100644 --- a/src/NzbDrone.Core/Blacklisting/ClearBlacklistCommand.cs +++ b/src/NzbDrone.Core/Blacklisting/ClearBlacklistCommand.cs @@ -4,12 +4,6 @@ namespace NzbDrone.Core.Blacklisting { public class ClearBlacklistCommand : Command { - public override bool SendUpdatesToClient - { - get - { - return true; - } - } + public override bool SendUpdatesToClient => true; } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs index a9bad109d..fa6d8a914 100644 --- a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs +++ b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs @@ -133,33 +133,15 @@ namespace NzbDrone.Core.Configuration } } - 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 @@ namespace NzbDrone.Core.Configuration } } - 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 @@ namespace NzbDrone.Core.Configuration } } - 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) { diff --git a/src/NzbDrone.Core/Configuration/ConfigService.cs b/src/NzbDrone.Core/Configuration/ConfigService.cs index e1ac74ee8..4eae607ae 100644 --- a/src/NzbDrone.Core/Configuration/ConfigService.cs +++ b/src/NzbDrone.Core/Configuration/ConfigService.cs @@ -300,65 +300,29 @@ namespace NzbDrone.Core.Configuration 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.Http); } - } + public ProxyType ProxyType => GetValueEnum("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) { diff --git a/src/NzbDrone.Core/Configuration/ResetApiKeyCommand.cs b/src/NzbDrone.Core/Configuration/ResetApiKeyCommand.cs index 54ab97643..f8bf1b5d8 100644 --- a/src/NzbDrone.Core/Configuration/ResetApiKeyCommand.cs +++ b/src/NzbDrone.Core/Configuration/ResetApiKeyCommand.cs @@ -4,12 +4,6 @@ namespace NzbDrone.Core.Configuration { public class ResetApiKeyCommand : Command { - public override bool SendUpdatesToClient - { - get - { - return true; - } - } + public override bool SendUpdatesToClient => true; } } diff --git a/src/NzbDrone.Core/Datastore/BasicRepository.cs b/src/NzbDrone.Core/Datastore/BasicRepository.cs index 0e7531580..db36edc1e 100644 --- a/src/NzbDrone.Core/Datastore/BasicRepository.cs +++ b/src/NzbDrone.Core/Datastore/BasicRepository.cs @@ -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 @@ namespace NzbDrone.Core.Datastore _eventAggregator = eventAggregator; } - protected QueryBuilder Query - { - get { return DataMapper.Query(); } - } + protected QueryBuilder Query => DataMapper.Query(); protected void Delete(Expression> filter) { @@ -289,9 +283,6 @@ namespace NzbDrone.Core.Datastore } } - protected virtual bool PublishModelEvents - { - get { return false; } - } + protected virtual bool PublishModelEvents => false; } } diff --git a/src/NzbDrone.Core/Datastore/Converters/BooleanIntConverter.cs b/src/NzbDrone.Core/Datastore/Converters/BooleanIntConverter.cs index df5980e08..397746b23 100644 --- a/src/NzbDrone.Core/Datastore/Converters/BooleanIntConverter.cs +++ b/src/NzbDrone.Core/Datastore/Converters/BooleanIntConverter.cs @@ -46,12 +46,6 @@ namespace NzbDrone.Core.Datastore.Converters } } - public Type DbType - { - get - { - return typeof(int); - } - } + public Type DbType => typeof(int); } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Datastore/Converters/EmbeddedDocumentConverter.cs b/src/NzbDrone.Core/Datastore/Converters/EmbeddedDocumentConverter.cs index 222c53b2a..d5321d794 100644 --- a/src/NzbDrone.Core/Datastore/Converters/EmbeddedDocumentConverter.cs +++ b/src/NzbDrone.Core/Datastore/Converters/EmbeddedDocumentConverter.cs @@ -60,12 +60,6 @@ namespace NzbDrone.Core.Datastore.Converters return JsonConvert.SerializeObject(clrValue, SerializerSetting); } - public Type DbType - { - get - { - return typeof(string); - } - } + public Type DbType => typeof(string); } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Datastore/Converters/EnumIntConverter.cs b/src/NzbDrone.Core/Datastore/Converters/EnumIntConverter.cs index e7a17ed1e..22d6b5336 100644 --- a/src/NzbDrone.Core/Datastore/Converters/EnumIntConverter.cs +++ b/src/NzbDrone.Core/Datastore/Converters/EnumIntConverter.cs @@ -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) { diff --git a/src/NzbDrone.Core/Datastore/Converters/GuidConverter.cs b/src/NzbDrone.Core/Datastore/Converters/GuidConverter.cs index d26cb9928..b2bf33526 100644 --- a/src/NzbDrone.Core/Datastore/Converters/GuidConverter.cs +++ b/src/NzbDrone.Core/Datastore/Converters/GuidConverter.cs @@ -30,9 +30,6 @@ namespace NzbDrone.Core.Datastore.Converters return value.ToString(); } - public Type DbType - { - get { return typeof(string); } - } + public Type DbType => typeof(string); } } diff --git a/src/NzbDrone.Core/Datastore/Converters/OsPathConverter.cs b/src/NzbDrone.Core/Datastore/Converters/OsPathConverter.cs index ba35fef3d..ba2b239fd 100644 --- a/src/NzbDrone.Core/Datastore/Converters/OsPathConverter.cs +++ b/src/NzbDrone.Core/Datastore/Converters/OsPathConverter.cs @@ -31,9 +31,6 @@ namespace NzbDrone.Core.Datastore.Converters return value.FullPath; } - public Type DbType - { - get { return typeof(string); } - } + public Type DbType => typeof(string); } } diff --git a/src/NzbDrone.Core/Datastore/Converters/QualityIntConverter.cs b/src/NzbDrone.Core/Datastore/Converters/QualityIntConverter.cs index 18fd52eb2..254dde15e 100644 --- a/src/NzbDrone.Core/Datastore/Converters/QualityIntConverter.cs +++ b/src/NzbDrone.Core/Datastore/Converters/QualityIntConverter.cs @@ -38,13 +38,7 @@ namespace NzbDrone.Core.Datastore.Converters return (int)quality; } - public Type DbType - { - get - { - return typeof(int); - } - } + public Type DbType => typeof(int); public override bool CanConvert(Type objectType) { diff --git a/src/NzbDrone.Core/Datastore/Converters/UtcConverter.cs b/src/NzbDrone.Core/Datastore/Converters/UtcConverter.cs index 25d313a6c..1225f0806 100644 --- a/src/NzbDrone.Core/Datastore/Converters/UtcConverter.cs +++ b/src/NzbDrone.Core/Datastore/Converters/UtcConverter.cs @@ -27,12 +27,6 @@ namespace NzbDrone.Core.Datastore.Converters return dateTime.ToUniversalTime(); } - public Type DbType - { - get - { - return typeof(DateTime); - } - } + public Type DbType => typeof(DateTime); } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Datastore/LogDatabase.cs b/src/NzbDrone.Core/Datastore/LogDatabase.cs index a76183ae0..403d495e6 100644 --- a/src/NzbDrone.Core/Datastore/LogDatabase.cs +++ b/src/NzbDrone.Core/Datastore/LogDatabase.cs @@ -25,10 +25,7 @@ namespace NzbDrone.Core.Datastore return _database.GetDataMapper(); } - public Version Version - { - get { return _database.Version; } - } + public Version Version => _database.Version; public void Vacuum() { diff --git a/src/NzbDrone.Core/Datastore/MainDatabase.cs b/src/NzbDrone.Core/Datastore/MainDatabase.cs index 6b3406151..632e569ce 100644 --- a/src/NzbDrone.Core/Datastore/MainDatabase.cs +++ b/src/NzbDrone.Core/Datastore/MainDatabase.cs @@ -25,10 +25,7 @@ namespace NzbDrone.Core.Datastore return _database.GetDataMapper(); } - public Version Version - { - get { return _database.Version; } - } + public Version Version => _database.Version; public void Vacuum() { diff --git a/src/NzbDrone.Core/Datastore/Migration/Framework/NzbDroneSqliteProcessor.cs b/src/NzbDrone.Core/Datastore/Migration/Framework/NzbDroneSqliteProcessor.cs index 8c42dbc6c..79a9eca45 100644 --- a/src/NzbDrone.Core/Datastore/Migration/Framework/NzbDroneSqliteProcessor.cs +++ b/src/NzbDrone.Core/Datastore/Migration/Framework/NzbDroneSqliteProcessor.cs @@ -18,13 +18,7 @@ namespace NzbDrone.Core.Datastore.Migration.Framework } - public override bool SupportsTransactions - { - get - { - return true; - } - } + public override bool SupportsTransactions => true; public override void Process(AlterColumnExpression expression) { diff --git a/src/NzbDrone.Core/Datastore/Migration/Framework/SqliteSyntaxReader.cs b/src/NzbDrone.Core/Datastore/Migration/Framework/SqliteSyntaxReader.cs index 3eb4b3ffd..e60ef4c70 100644 --- a/src/NzbDrone.Core/Datastore/Migration/Framework/SqliteSyntaxReader.cs +++ b/src/NzbDrone.Core/Datastore/Migration/Framework/SqliteSyntaxReader.cs @@ -16,15 +16,9 @@ namespace NzbDrone.Core.Datastore.Migration.Framework 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 { diff --git a/src/NzbDrone.Core/DecisionEngine/DownloadDecision.cs b/src/NzbDrone.Core/DecisionEngine/DownloadDecision.cs index b10ed9d09..cad8177cb 100644 --- a/src/NzbDrone.Core/DecisionEngine/DownloadDecision.cs +++ b/src/NzbDrone.Core/DecisionEngine/DownloadDecision.cs @@ -9,13 +9,7 @@ namespace NzbDrone.Core.DecisionEngine public RemoteEpisode RemoteEpisode { get; private set; } public IEnumerable Rejections { get; private set; } - public bool Approved - { - get - { - return !Rejections.Any(); - } - } + public bool Approved => !Rejections.Any(); public bool TemporarilyRejected { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs index 6e05e7717..4ab566d2e 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs @@ -22,7 +22,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/AnimeVersionUpgradeSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/AnimeVersionUpgradeSpecification.cs index 13e632daa..c2f93f7c0 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/AnimeVersionUpgradeSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/AnimeVersionUpgradeSpecification.cs @@ -18,7 +18,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/BlacklistSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/BlacklistSpecification.cs index d3b1bd523..9bbf12732 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/BlacklistSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/BlacklistSpecification.cs @@ -17,7 +17,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/CutoffSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/CutoffSpecification.cs index a45d27fba..6dfdbc64c 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/CutoffSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/CutoffSpecification.cs @@ -16,7 +16,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/FullSeasonSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/FullSeasonSpecification.cs index 301e28077..023b6be60 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/FullSeasonSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/FullSeasonSpecification.cs @@ -19,7 +19,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications _episodeService = episodeService; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/LanguageSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/LanguageSpecification.cs index 54bbecce1..9f7f75038 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/LanguageSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/LanguageSpecification.cs @@ -13,7 +13,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/MinimumAgeSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/MinimumAgeSpecification.cs index a46b3f0fc..449d7be76 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/MinimumAgeSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/MinimumAgeSpecification.cs @@ -16,7 +16,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications _logger = logger; } - public RejectionType Type { get { return RejectionType.Temporary; } } + public RejectionType Type => RejectionType.Temporary; public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/NotSampleSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/NotSampleSpecification.cs index da2c4bc35..02ff7653a 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/NotSampleSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/NotSampleSpecification.cs @@ -8,7 +8,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications { private readonly Logger _logger; - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public NotSampleSpecification(Logger logger) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/ProtocolSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/ProtocolSpecification.cs index 60df58f61..008e58812 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/ProtocolSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/ProtocolSpecification.cs @@ -18,7 +18,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/QualityAllowedByProfileSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/QualityAllowedByProfileSpecification.cs index 3e8b7259d..7913e0e7e 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/QualityAllowedByProfileSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/QualityAllowedByProfileSpecification.cs @@ -13,7 +13,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/QueueSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/QueueSpecification.cs index 9c2c31a3e..09431855a 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/QueueSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/QueueSpecification.cs @@ -23,7 +23,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/RawDiskSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/RawDiskSpecification.cs index e4a1995c7..7f278cb7e 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/RawDiskSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/RawDiskSpecification.cs @@ -19,7 +19,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/ReleaseRestrictionsSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/ReleaseRestrictionsSpecification.cs index 4fe6e5643..9fb8c13f5 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/ReleaseRestrictionsSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/ReleaseRestrictionsSpecification.cs @@ -20,7 +20,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/RetentionSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/RetentionSpecification.cs index 449b1c4ab..97802f871 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/RetentionSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/RetentionSpecification.cs @@ -16,7 +16,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/DelaySpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/DelaySpecification.cs index 1f440b41e..68551c66c 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/DelaySpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/DelaySpecification.cs @@ -26,7 +26,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync _logger = logger; } - public RejectionType Type { get { return RejectionType.Temporary; } } + public RejectionType Type => RejectionType.Temporary; public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/HistorySpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/HistorySpecification.cs index 159678d88..9aa4fabf1 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/HistorySpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/HistorySpecification.cs @@ -26,7 +26,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/MonitoredEpisodeSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/MonitoredEpisodeSpecification.cs index 94739b1e9..f56f26478 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/MonitoredEpisodeSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/MonitoredEpisodeSpecification.cs @@ -14,7 +14,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/ProperSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/ProperSpecification.cs index 151b45e46..0c6632d25 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/ProperSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/ProperSpecification.cs @@ -20,7 +20,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/SameEpisodesGrabSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/SameEpisodesGrabSpecification.cs index 2afea3032..1a8c5db5b 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/SameEpisodesGrabSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/SameEpisodesGrabSpecification.cs @@ -15,7 +15,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs index fe21a2537..50fd9b3cc 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs @@ -16,7 +16,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.Search _episodeService = episodeService; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public Decision IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/EpisodeRequestedSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/EpisodeRequestedSpecification.cs index fa4538546..60640442f 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/EpisodeRequestedSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/EpisodeRequestedSpecification.cs @@ -15,7 +15,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.Search _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public Decision IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SeasonMatchSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SeasonMatchSpecification.cs index 6a3cad319..b09d888ec 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SeasonMatchSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SeasonMatchSpecification.cs @@ -13,7 +13,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.Search _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public Decision IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SeriesSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SeriesSpecification.cs index 2ce382f6a..7f1201b33 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SeriesSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SeriesSpecification.cs @@ -13,7 +13,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.Search _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public Decision IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SingleEpisodeSearchMatchSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SingleEpisodeSearchMatchSpecification.cs index 3ac1a6991..fb056734f 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SingleEpisodeSearchMatchSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SingleEpisodeSearchMatchSpecification.cs @@ -14,7 +14,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.Search _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public Decision IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/TorrentSeedingSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/TorrentSeedingSpecification.cs index ab8571cdb..87c244b53 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/TorrentSeedingSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/TorrentSeedingSpecification.cs @@ -13,13 +13,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.Search _logger = logger; } - public RejectionType Type - { - get - { - return RejectionType.Permanent; - } - } + public RejectionType Type => RejectionType.Permanent; public Decision IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteria) diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs index 3520f6d6a..5a24b6305 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs @@ -16,7 +16,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { diff --git a/src/NzbDrone.Core/Download/Clients/Blackhole/TorrentBlackhole.cs b/src/NzbDrone.Core/Download/Clients/Blackhole/TorrentBlackhole.cs index 5617df565..1aba08bca 100644 --- a/src/NzbDrone.Core/Download/Clients/Blackhole/TorrentBlackhole.cs +++ b/src/NzbDrone.Core/Download/Clients/Blackhole/TorrentBlackhole.cs @@ -24,13 +24,7 @@ namespace NzbDrone.Core.Download.Clients.Blackhole 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 @@ namespace NzbDrone.Core.Download.Clients.Blackhole 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 GetItems() diff --git a/src/NzbDrone.Core/Download/Clients/Blackhole/UsenetBlackhole.cs b/src/NzbDrone.Core/Download/Clients/Blackhole/UsenetBlackhole.cs index 52377e339..9dce62231 100644 --- a/src/NzbDrone.Core/Download/Clients/Blackhole/UsenetBlackhole.cs +++ b/src/NzbDrone.Core/Download/Clients/Blackhole/UsenetBlackhole.cs @@ -52,13 +52,7 @@ namespace NzbDrone.Core.Download.Clients.Blackhole return null; } - public override string Name - { - get - { - return "Usenet Blackhole"; - } - } + public override string Name => "Usenet Blackhole"; public override IEnumerable GetItems() { diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs index 6d2b81cba..39174d3b8 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs @@ -75,13 +75,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge return actualHash.ToUpper(); } - public override string Name - { - get - { - return "Deluge"; - } - } + public override string Name => "Deluge"; public override IEnumerable GetItems() { diff --git a/src/NzbDrone.Core/Download/Clients/Hadouken/Hadouken.cs b/src/NzbDrone.Core/Download/Clients/Hadouken/Hadouken.cs index 51881debc..5727dea8b 100644 --- a/src/NzbDrone.Core/Download/Clients/Hadouken/Hadouken.cs +++ b/src/NzbDrone.Core/Download/Clients/Hadouken/Hadouken.cs @@ -31,10 +31,7 @@ namespace NzbDrone.Core.Download.Clients.Hadouken _proxy = proxy; } - public override string Name - { - get { return "Hadouken"; } - } + public override string Name => "Hadouken"; public override IEnumerable GetItems() { diff --git a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs index 3d8017d57..6d45f0386 100644 --- a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs +++ b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs @@ -43,13 +43,7 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex return response; } - public override string Name - { - get - { - return "NZBVortex"; - } - } + public override string Name => "NZBVortex"; public override IEnumerable GetItems() { diff --git a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexJsonError.cs b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexJsonError.cs index 47017cee0..487c8390e 100644 --- a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexJsonError.cs +++ b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexJsonError.cs @@ -7,13 +7,7 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex 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); } } diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs index 8a3ae8884..5b6d756cc 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs @@ -194,13 +194,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget return historyItems; } - public override string Name - { - get - { - return "NZBGet"; - } - } + public override string Name => "NZBGet"; public override IEnumerable GetItems() { diff --git a/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs b/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs index 5fc631ecd..5eab58b3b 100644 --- a/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs +++ b/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs @@ -28,21 +28,9 @@ namespace NzbDrone.Core.Download.Clients.Pneumatic _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 @@ namespace NzbDrone.Core.Download.Clients.Pneumatic return GetDownloadClientId(strmFile); } - public bool IsConfigured - { - get - { - return !string.IsNullOrWhiteSpace(Settings.NzbFolder); - } - } + public bool IsConfigured => !string.IsNullOrWhiteSpace(Settings.NzbFolder); public override IEnumerable GetItems() { diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs index 89de6f527..64a5e23de 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs @@ -189,13 +189,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd return historyItems; } - public override string Name - { - get - { - return "SABnzbd"; - } - } + public override string Name => "SABnzbd"; public override IEnumerable GetItems() { diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdJsonError.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdJsonError.cs index 1054cf393..d723e710b 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdJsonError.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdJsonError.cs @@ -7,13 +7,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd 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); } } diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/Transmission.cs b/src/NzbDrone.Core/Download/Clients/Transmission/Transmission.cs index 4ea717d49..058023d0c 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/Transmission.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/Transmission.cs @@ -40,12 +40,6 @@ namespace NzbDrone.Core.Download.Clients.Transmission return null; } - public override string Name - { - get - { - return "Transmission"; - } - } + public override string Name => "Transmission"; } } diff --git a/src/NzbDrone.Core/Download/Clients/Vuze/Vuze.cs b/src/NzbDrone.Core/Download/Clients/Vuze/Vuze.cs index 79721b120..7643d6653 100644 --- a/src/NzbDrone.Core/Download/Clients/Vuze/Vuze.cs +++ b/src/NzbDrone.Core/Download/Clients/Vuze/Vuze.cs @@ -49,12 +49,6 @@ namespace NzbDrone.Core.Download.Clients.Vuze return null; } - public override string Name - { - get - { - return "Vuze"; - } - } + public override string Name => "Vuze"; } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Download/Clients/qBittorrent/QBittorrent.cs b/src/NzbDrone.Core/Download/Clients/qBittorrent/QBittorrent.cs index 1e82cb196..ecd75c911 100644 --- a/src/NzbDrone.Core/Download/Clients/qBittorrent/QBittorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/qBittorrent/QBittorrent.cs @@ -71,13 +71,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent return hash; } - public override string Name - { - get - { - return "qBittorrent"; - } - } + public override string Name => "qBittorrent"; public override IEnumerable GetItems() { diff --git a/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs b/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs index 58b0f15c6..041708a93 100644 --- a/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs @@ -94,21 +94,9 @@ namespace NzbDrone.Core.Download.Clients.RTorrent } } - 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 GetItems() { diff --git a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs index 3e76ad4eb..da942b7f1 100644 --- a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs @@ -68,13 +68,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent return hash; } - public override string Name - { - get - { - return "uTorrent"; - } - } + public override string Name => "uTorrent"; public override IEnumerable GetItems() { diff --git a/src/NzbDrone.Core/Download/DownloadClientBase.cs b/src/NzbDrone.Core/Download/DownloadClientBase.cs index a7d85f2f6..98ade2a69 100644 --- a/src/NzbDrone.Core/Download/DownloadClientBase.cs +++ b/src/NzbDrone.Core/Download/DownloadClientBase.cs @@ -24,41 +24,17 @@ namespace NzbDrone.Core.Download 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 DefaultDefinitions - { - get - { - return new List(); - } - } + public IEnumerable DefaultDefinitions => new List(); public ProviderDefinition Definition { get; set; } public virtual object RequestAction(string action, IDictionary query) { return null; } - protected TSettings Settings - { - get - { - return (TSettings)Definition.Settings; - } - } + protected TSettings Settings => (TSettings)Definition.Settings; protected DownloadClientBase(IConfigService configService, IDiskProvider diskProvider, diff --git a/src/NzbDrone.Core/Download/TorrentClientBase.cs b/src/NzbDrone.Core/Download/TorrentClientBase.cs index 68b78b40c..b1fcd7e2e 100644 --- a/src/NzbDrone.Core/Download/TorrentClientBase.cs +++ b/src/NzbDrone.Core/Download/TorrentClientBase.cs @@ -34,21 +34,9 @@ namespace NzbDrone.Core.Download _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); diff --git a/src/NzbDrone.Core/Download/UsenetClientBase.cs b/src/NzbDrone.Core/Download/UsenetClientBase.cs index 5c9103581..9edd2a3ef 100644 --- a/src/NzbDrone.Core/Download/UsenetClientBase.cs +++ b/src/NzbDrone.Core/Download/UsenetClientBase.cs @@ -28,13 +28,7 @@ namespace NzbDrone.Core.Download _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); diff --git a/src/NzbDrone.Core/Extras/Files/ExtraFileService.cs b/src/NzbDrone.Core/Extras/Files/ExtraFileService.cs index d8e6b3fa7..54d86e908 100644 --- a/src/NzbDrone.Core/Extras/Files/ExtraFileService.cs +++ b/src/NzbDrone.Core/Extras/Files/ExtraFileService.cs @@ -48,13 +48,7 @@ namespace NzbDrone.Core.Extras.Files _logger = logger; } - public virtual bool PermanentlyDelete - { - get - { - return false; - } - } + public virtual bool PermanentlyDelete => false; public List GetFilesBySeries(int seriesId) { diff --git a/src/NzbDrone.Core/Extras/MetaData/Consumers/MediaBrowser/MediaBrowserMetadata.cs b/src/NzbDrone.Core/Extras/MetaData/Consumers/MediaBrowser/MediaBrowserMetadata.cs index 38d999886..d2ea82bae 100644 --- a/src/NzbDrone.Core/Extras/MetaData/Consumers/MediaBrowser/MediaBrowserMetadata.cs +++ b/src/NzbDrone.Core/Extras/MetaData/Consumers/MediaBrowser/MediaBrowserMetadata.cs @@ -23,13 +23,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.MediaBrowser _logger = logger; } - public override string Name - { - get - { - return "Emby (Legacy)"; - } - } + public override string Name => "Emby (Legacy)"; public override MetadataFile FindMetadataFile(Series series, string path) { diff --git a/src/NzbDrone.Core/Extras/MetaData/Consumers/MediaBrowser/MediaBrowserMetadataSettings.cs b/src/NzbDrone.Core/Extras/MetaData/Consumers/MediaBrowser/MediaBrowserMetadataSettings.cs index c0e5d75bc..11899124f 100644 --- a/src/NzbDrone.Core/Extras/MetaData/Consumers/MediaBrowser/MediaBrowserMetadataSettings.cs +++ b/src/NzbDrone.Core/Extras/MetaData/Consumers/MediaBrowser/MediaBrowserMetadataSettings.cs @@ -24,13 +24,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.MediaBrowser [FieldDefinition(0, Label = "Series Metadata", Type = FieldType.Checkbox)] public bool SeriesMetadata { get; set; } - public bool IsValid - { - get - { - return true; - } - } + public bool IsValid => true; public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Extras/MetaData/Consumers/Roksbox/RoksboxMetadata.cs b/src/NzbDrone.Core/Extras/MetaData/Consumers/Roksbox/RoksboxMetadata.cs index de6b17a97..a96ae4edf 100644 --- a/src/NzbDrone.Core/Extras/MetaData/Consumers/Roksbox/RoksboxMetadata.cs +++ b/src/NzbDrone.Core/Extras/MetaData/Consumers/Roksbox/RoksboxMetadata.cs @@ -35,13 +35,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Roksbox private static List ValidCertification = new List { "G", "NC-17", "PG", "PG-13", "R", "UR", "UNRATED", "NR", "TV-Y", "TV-Y7", "TV-Y7-FV", "TV-G", "TV-PG", "TV-14", "TV-MA" }; private static readonly Regex SeasonImagesRegex = new Regex(@"^(season (?\d+))|(?specials)", RegexOptions.Compiled | RegexOptions.IgnoreCase); - public override string Name - { - get - { - return "Roksbox"; - } - } + public override string Name => "Roksbox"; public override string GetFilenameAfterMove(Series series, EpisodeFile episodeFile, MetadataFile metadataFile) { diff --git a/src/NzbDrone.Core/Extras/MetaData/Consumers/Roksbox/RoksboxMetadataSettings.cs b/src/NzbDrone.Core/Extras/MetaData/Consumers/Roksbox/RoksboxMetadataSettings.cs index 5ac09ef78..f0da481bf 100644 --- a/src/NzbDrone.Core/Extras/MetaData/Consumers/Roksbox/RoksboxMetadataSettings.cs +++ b/src/NzbDrone.Core/Extras/MetaData/Consumers/Roksbox/RoksboxMetadataSettings.cs @@ -36,13 +36,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Roksbox [FieldDefinition(3, Label = "Episode Images", Type = FieldType.Checkbox)] public bool EpisodeImages { get; set; } - public bool IsValid - { - get - { - return true; - } - } + public bool IsValid => true; public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Extras/MetaData/Consumers/Wdtv/WdtvMetadata.cs b/src/NzbDrone.Core/Extras/MetaData/Consumers/Wdtv/WdtvMetadata.cs index 4964caeb4..ab031c396 100644 --- a/src/NzbDrone.Core/Extras/MetaData/Consumers/Wdtv/WdtvMetadata.cs +++ b/src/NzbDrone.Core/Extras/MetaData/Consumers/Wdtv/WdtvMetadata.cs @@ -34,13 +34,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Wdtv private static readonly Regex SeasonImagesRegex = new Regex(@"^(season (?\d+))|(?specials)", RegexOptions.Compiled | RegexOptions.IgnoreCase); - public override string Name - { - get - { - return "WDTV"; - } - } + public override string Name => "WDTV"; public override string GetFilenameAfterMove(Series series, EpisodeFile episodeFile, MetadataFile metadataFile) { diff --git a/src/NzbDrone.Core/Extras/MetaData/Consumers/Wdtv/WdtvMetadataSettings.cs b/src/NzbDrone.Core/Extras/MetaData/Consumers/Wdtv/WdtvMetadataSettings.cs index 052c6deae..e010ff7e5 100644 --- a/src/NzbDrone.Core/Extras/MetaData/Consumers/Wdtv/WdtvMetadataSettings.cs +++ b/src/NzbDrone.Core/Extras/MetaData/Consumers/Wdtv/WdtvMetadataSettings.cs @@ -36,13 +36,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Wdtv [FieldDefinition(3, Label = "Episode Images", Type = FieldType.Checkbox)] public bool EpisodeImages { get; set; } - public bool IsValid - { - get - { - return true; - } - } + public bool IsValid => true; public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Extras/MetaData/Consumers/Xbmc/XbmcMetadata.cs b/src/NzbDrone.Core/Extras/MetaData/Consumers/Xbmc/XbmcMetadata.cs index 355f2a0fb..662b843c0 100644 --- a/src/NzbDrone.Core/Extras/MetaData/Consumers/Xbmc/XbmcMetadata.cs +++ b/src/NzbDrone.Core/Extras/MetaData/Consumers/Xbmc/XbmcMetadata.cs @@ -33,13 +33,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc private static readonly Regex SeasonImagesRegex = new Regex(@"^season(?\d{2,}|-all|-specials)-(?poster|banner|fanart)\.(?:png|jpg)", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex EpisodeImageRegex = new Regex(@"-thumb\.(?:png|jpg)", RegexOptions.Compiled | RegexOptions.IgnoreCase); - public override string Name - { - get - { - return "Kodi (XBMC) / Emby"; - } - } + public override string Name => "Kodi (XBMC) / Emby"; public override string GetFilenameAfterMove(Series series, EpisodeFile episodeFile, MetadataFile metadataFile) { diff --git a/src/NzbDrone.Core/Extras/MetaData/Consumers/Xbmc/XbmcMetadataSettings.cs b/src/NzbDrone.Core/Extras/MetaData/Consumers/Xbmc/XbmcMetadataSettings.cs index 35ec5ee32..cd4b833ae 100644 --- a/src/NzbDrone.Core/Extras/MetaData/Consumers/Xbmc/XbmcMetadataSettings.cs +++ b/src/NzbDrone.Core/Extras/MetaData/Consumers/Xbmc/XbmcMetadataSettings.cs @@ -40,13 +40,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc [FieldDefinition(4, Label = "Episode Images", Type = FieldType.Checkbox)] public bool EpisodeImages { get; set; } - public bool IsValid - { - get - { - return true; - } - } + public bool IsValid => true; public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Extras/MetaData/ExistingMetadataImporter.cs b/src/NzbDrone.Core/Extras/MetaData/ExistingMetadataImporter.cs index ca5696ef1..fa271f575 100644 --- a/src/NzbDrone.Core/Extras/MetaData/ExistingMetadataImporter.cs +++ b/src/NzbDrone.Core/Extras/MetaData/ExistingMetadataImporter.cs @@ -30,13 +30,7 @@ namespace NzbDrone.Core.Extras.Metadata _consumers = consumers.ToList(); } - public override int Order - { - get - { - return 0; - } - } + public override int Order => 0; public override IEnumerable ProcessFiles(Series series, List filesOnDisk, List importedFiles) { diff --git a/src/NzbDrone.Core/Extras/MetaData/Files/MetadataFileService.cs b/src/NzbDrone.Core/Extras/MetaData/Files/MetadataFileService.cs index ae14676c1..f5fc2ba69 100644 --- a/src/NzbDrone.Core/Extras/MetaData/Files/MetadataFileService.cs +++ b/src/NzbDrone.Core/Extras/MetaData/Files/MetadataFileService.cs @@ -17,12 +17,6 @@ namespace NzbDrone.Core.Extras.Metadata.Files { } - public override bool PermanentlyDelete - { - get - { - return true; - } - } + public override bool PermanentlyDelete => true; } } diff --git a/src/NzbDrone.Core/Extras/MetaData/MetadataBase.cs b/src/NzbDrone.Core/Extras/MetaData/MetadataBase.cs index 39a4162ce..a5673798b 100644 --- a/src/NzbDrone.Core/Extras/MetaData/MetadataBase.cs +++ b/src/NzbDrone.Core/Extras/MetaData/MetadataBase.cs @@ -14,29 +14,11 @@ namespace NzbDrone.Core.Extras.Metadata { 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 DefaultDefinitions - { - get - { - return new List(); - } - } + public IEnumerable DefaultDefinitions => new List(); public ProviderDefinition Definition { get; set; } @@ -64,13 +46,7 @@ namespace NzbDrone.Core.Extras.Metadata public virtual object RequestAction(string action, IDictionary query) { return null; } - protected TSettings Settings - { - get - { - return (TSettings)Definition.Settings; - } - } + protected TSettings Settings => (TSettings)Definition.Settings; public override string ToString() { diff --git a/src/NzbDrone.Core/Extras/MetaData/MetadataService.cs b/src/NzbDrone.Core/Extras/MetaData/MetadataService.cs index 278ceeab1..95198f2f0 100644 --- a/src/NzbDrone.Core/Extras/MetaData/MetadataService.cs +++ b/src/NzbDrone.Core/Extras/MetaData/MetadataService.cs @@ -47,13 +47,7 @@ namespace NzbDrone.Core.Extras.Metadata _logger = logger; } - public override int Order - { - get - { - return 0; - } - } + public override int Order => 0; public override IEnumerable CreateAfterSeriesScan(Series series, List episodeFiles) { diff --git a/src/NzbDrone.Core/Extras/Others/ExistingOtherExtraImporter.cs b/src/NzbDrone.Core/Extras/Others/ExistingOtherExtraImporter.cs index 6b3d3682b..6315daeb1 100644 --- a/src/NzbDrone.Core/Extras/Others/ExistingOtherExtraImporter.cs +++ b/src/NzbDrone.Core/Extras/Others/ExistingOtherExtraImporter.cs @@ -25,13 +25,7 @@ namespace NzbDrone.Core.Extras.Others _logger = logger; } - public override int Order - { - get - { - return 2; - } - } + public override int Order => 2; public override IEnumerable ProcessFiles(Series series, List filesOnDisk, List importedFiles) { diff --git a/src/NzbDrone.Core/Extras/Others/OtherExtraService.cs b/src/NzbDrone.Core/Extras/Others/OtherExtraService.cs index d1eb1f0cc..71b635710 100644 --- a/src/NzbDrone.Core/Extras/Others/OtherExtraService.cs +++ b/src/NzbDrone.Core/Extras/Others/OtherExtraService.cs @@ -30,13 +30,7 @@ namespace NzbDrone.Core.Extras.Others _logger = logger; } - public override int Order - { - get - { - return 2; - } - } + public override int Order => 2; public override IEnumerable CreateAfterSeriesScan(Series series, List episodeFiles) { diff --git a/src/NzbDrone.Core/Extras/Subtitles/ExistingSubtitleImporter.cs b/src/NzbDrone.Core/Extras/Subtitles/ExistingSubtitleImporter.cs index eb095123e..d3ae8d46b 100644 --- a/src/NzbDrone.Core/Extras/Subtitles/ExistingSubtitleImporter.cs +++ b/src/NzbDrone.Core/Extras/Subtitles/ExistingSubtitleImporter.cs @@ -25,13 +25,7 @@ namespace NzbDrone.Core.Extras.Subtitles _logger = logger; } - public override int Order - { - get - { - return 1; - } - } + public override int Order => 1; public override IEnumerable ProcessFiles(Series series, List filesOnDisk, List importedFiles) { diff --git a/src/NzbDrone.Core/Extras/Subtitles/SubtitleFileExtensions.cs b/src/NzbDrone.Core/Extras/Subtitles/SubtitleFileExtensions.cs index 92f07a11a..423d14656 100644 --- a/src/NzbDrone.Core/Extras/Subtitles/SubtitleFileExtensions.cs +++ b/src/NzbDrone.Core/Extras/Subtitles/SubtitleFileExtensions.cs @@ -27,9 +27,6 @@ namespace NzbDrone.Core.Extras.Subtitles }; } - public static HashSet Extensions - { - get { return _fileExtensions; } - } + public static HashSet Extensions => _fileExtensions; } } diff --git a/src/NzbDrone.Core/Extras/Subtitles/SubtitleService.cs b/src/NzbDrone.Core/Extras/Subtitles/SubtitleService.cs index 6361b7d84..0371efd66 100644 --- a/src/NzbDrone.Core/Extras/Subtitles/SubtitleService.cs +++ b/src/NzbDrone.Core/Extras/Subtitles/SubtitleService.cs @@ -33,13 +33,7 @@ namespace NzbDrone.Core.Extras.Subtitles _logger = logger; } - public override int Order - { - get - { - return 1; - } - } + public override int Order => 1; public override IEnumerable CreateAfterSeriesScan(Series series, List episodeFiles) { diff --git a/src/NzbDrone.Core/HealthCheck/Checks/AppDataLocationCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/AppDataLocationCheck.cs index 88b7e94b3..ad4f2db9e 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/AppDataLocationCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/AppDataLocationCheck.cs @@ -23,12 +23,6 @@ namespace NzbDrone.Core.HealthCheck.Checks return new HealthCheck(GetType()); } - public override bool CheckOnConfigChange - { - get - { - return false; - } - } + public override bool CheckOnConfigChange => false; } } diff --git a/src/NzbDrone.Core/HealthCheck/Checks/MediaInfoDllCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/MediaInfoDllCheck.cs index d52e6e58f..94ea38710 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/MediaInfoDllCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/MediaInfoDllCheck.cs @@ -21,12 +21,6 @@ namespace NzbDrone.Core.HealthCheck.Checks return new HealthCheck(GetType()); } - public override bool CheckOnConfigChange - { - get - { - return false; - } - } + public override bool CheckOnConfigChange => false; } } diff --git a/src/NzbDrone.Core/HealthCheck/Checks/MonoVersionCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/MonoVersionCheck.cs index 113af9b37..f74156cb3 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/MonoVersionCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/MonoVersionCheck.cs @@ -55,21 +55,9 @@ namespace NzbDrone.Core.HealthCheck.Checks return new HealthCheck(GetType(), HealthCheckResult.Warning, "mono version is less than 3.10, upgrade for improved stability"); } - public override bool CheckOnConfigChange - { - get - { - return false; - } - } + public override bool CheckOnConfigChange => false; - public override bool CheckOnSchedule - { - get - { - return false; - } - } + public override bool CheckOnSchedule => false; private bool HasMonoBug18599() { diff --git a/src/NzbDrone.Core/HealthCheck/Checks/RootFolderCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/RootFolderCheck.cs index f84d0054b..e35ad32e7 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/RootFolderCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/RootFolderCheck.cs @@ -38,12 +38,6 @@ namespace NzbDrone.Core.HealthCheck.Checks return new HealthCheck(GetType()); } - public override bool CheckOnConfigChange - { - get - { - return false; - } - } + public override bool CheckOnConfigChange => false; } } diff --git a/src/NzbDrone.Core/HealthCheck/Checks/UpdateCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/UpdateCheck.cs index a27fab3c1..c0d7a5c31 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/UpdateCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/UpdateCheck.cs @@ -67,12 +67,6 @@ namespace NzbDrone.Core.HealthCheck.Checks return new HealthCheck(GetType()); } - public override bool CheckOnConfigChange - { - get - { - return false; - } - } + public override bool CheckOnConfigChange => false; } } diff --git a/src/NzbDrone.Core/HealthCheck/HealthCheckBase.cs b/src/NzbDrone.Core/HealthCheck/HealthCheckBase.cs index 156a925a2..5e1700ac6 100644 --- a/src/NzbDrone.Core/HealthCheck/HealthCheckBase.cs +++ b/src/NzbDrone.Core/HealthCheck/HealthCheckBase.cs @@ -4,28 +4,10 @@ { public abstract HealthCheck Check(); - public virtual bool CheckOnStartup - { - get - { - return true; - } - } + public virtual bool CheckOnStartup => true; - public virtual bool CheckOnConfigChange - { - get - { - return true; - } - } + public virtual bool CheckOnConfigChange => true; - public virtual bool CheckOnSchedule - { - get - { - return true; - } - } + public virtual bool CheckOnSchedule => true; } } diff --git a/src/NzbDrone.Core/Http/CloudFlare/CloudFlareCaptchaException.cs b/src/NzbDrone.Core/Http/CloudFlare/CloudFlareCaptchaException.cs index 3368bd9ce..db88d5c7b 100644 --- a/src/NzbDrone.Core/Http/CloudFlare/CloudFlareCaptchaException.cs +++ b/src/NzbDrone.Core/Http/CloudFlare/CloudFlareCaptchaException.cs @@ -16,9 +16,6 @@ namespace NzbDrone.Core.Http.CloudFlare CaptchaRequest = captchaRequest; } - public bool IsExpired - { - get { return Response.Request.Cookies.ContainsKey("cf_clearance"); } - } + public bool IsExpired => Response.Request.Cookies.ContainsKey("cf_clearance"); } } diff --git a/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs b/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs index ea0048a11..48cb001b2 100644 --- a/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs +++ b/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs @@ -20,13 +20,7 @@ namespace NzbDrone.Core.IndexerSearch.Definitions public virtual bool MonitoredEpisodesOnly { get; set; } public virtual bool UserInvokedSearch { get; set; } - public List QueryTitles - { - get - { - return SceneTitles.Select(GetQueryTitle).ToList(); - } - } + public List QueryTitles => SceneTitles.Select(GetQueryTitle).ToList(); public static string GetQueryTitle(string title) { diff --git a/src/NzbDrone.Core/IndexerSearch/Definitions/SeasonSearchCriteria.cs b/src/NzbDrone.Core/IndexerSearch/Definitions/SeasonSearchCriteria.cs index bf36769dc..122df795d 100644 --- a/src/NzbDrone.Core/IndexerSearch/Definitions/SeasonSearchCriteria.cs +++ b/src/NzbDrone.Core/IndexerSearch/Definitions/SeasonSearchCriteria.cs @@ -4,13 +4,7 @@ namespace NzbDrone.Core.IndexerSearch.Definitions { public int SeasonNumber { get; set; } - public override bool MonitoredEpisodesOnly - { - get - { - return true; - } - } + public override bool MonitoredEpisodesOnly => true; public override string ToString() { diff --git a/src/NzbDrone.Core/IndexerSearch/EpisodeSearchCommand.cs b/src/NzbDrone.Core/IndexerSearch/EpisodeSearchCommand.cs index 78f7ad038..dfb4f3648 100644 --- a/src/NzbDrone.Core/IndexerSearch/EpisodeSearchCommand.cs +++ b/src/NzbDrone.Core/IndexerSearch/EpisodeSearchCommand.cs @@ -8,13 +8,7 @@ namespace NzbDrone.Core.IndexerSearch { public List EpisodeIds { get; set; } - public override bool SendUpdatesToClient - { - get - { - return true; - } - } + public override bool SendUpdatesToClient => true; public EpisodeSearchCommand() { diff --git a/src/NzbDrone.Core/IndexerSearch/MissingEpisodeSearchCommand.cs b/src/NzbDrone.Core/IndexerSearch/MissingEpisodeSearchCommand.cs index 978b3ab64..3e2097be3 100644 --- a/src/NzbDrone.Core/IndexerSearch/MissingEpisodeSearchCommand.cs +++ b/src/NzbDrone.Core/IndexerSearch/MissingEpisodeSearchCommand.cs @@ -6,13 +6,7 @@ namespace NzbDrone.Core.IndexerSearch { public int? SeriesId { get; set; } - public override bool SendUpdatesToClient - { - get - { - return true; - } - } + public override bool SendUpdatesToClient => true; public MissingEpisodeSearchCommand() { diff --git a/src/NzbDrone.Core/IndexerSearch/SeasonSearchCommand.cs b/src/NzbDrone.Core/IndexerSearch/SeasonSearchCommand.cs index 56be0e0d9..2ac6cd439 100644 --- a/src/NzbDrone.Core/IndexerSearch/SeasonSearchCommand.cs +++ b/src/NzbDrone.Core/IndexerSearch/SeasonSearchCommand.cs @@ -7,12 +7,6 @@ namespace NzbDrone.Core.IndexerSearch public int SeriesId { get; set; } public int SeasonNumber { get; set; } - public override bool SendUpdatesToClient - { - get - { - return true; - } - } + public override bool SendUpdatesToClient => true; } } \ No newline at end of file diff --git a/src/NzbDrone.Core/IndexerSearch/SeriesSearchCommand.cs b/src/NzbDrone.Core/IndexerSearch/SeriesSearchCommand.cs index 36b75f316..bc1a0a51a 100644 --- a/src/NzbDrone.Core/IndexerSearch/SeriesSearchCommand.cs +++ b/src/NzbDrone.Core/IndexerSearch/SeriesSearchCommand.cs @@ -6,12 +6,6 @@ namespace NzbDrone.Core.IndexerSearch { public int SeriesId { get; set; } - public override bool SendUpdatesToClient - { - get - { - return true; - } - } + public override bool SendUpdatesToClient => true; } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Indexers/BitMeTv/BitMeTv.cs b/src/NzbDrone.Core/Indexers/BitMeTv/BitMeTv.cs index cb9a0b2cc..b4ae2fc13 100644 --- a/src/NzbDrone.Core/Indexers/BitMeTv/BitMeTv.cs +++ b/src/NzbDrone.Core/Indexers/BitMeTv/BitMeTv.cs @@ -8,17 +8,11 @@ namespace NzbDrone.Core.Indexers.BitMeTv { public class BitMeTv : HttpIndexerBase { - public override string Name - { - get - { - return "BitMeTV"; - } - } + public override string Name => "BitMeTV"; - public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } } - public override bool SupportsSearch { get { return false; } } - public override int PageSize { get { return 0; } } + public override DownloadProtocol Protocol => DownloadProtocol.Torrent; + public override bool SupportsSearch => false; + public override int PageSize => 0; public BitMeTv(IHttpClient httpClient, IIndexerStatusService indexerStatusService, IConfigService configService, IParsingService parsingService, Logger logger) : base(httpClient, indexerStatusService, configService, parsingService, logger) diff --git a/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNet.cs b/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNet.cs index 95cd232fc..fec611710 100644 --- a/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNet.cs +++ b/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNet.cs @@ -7,18 +7,12 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet { public class BroadcastheNet : HttpIndexerBase { - public override string Name - { - get - { - return "BroadcastheNet"; - } - } + public override string Name => "BroadcastheNet"; - public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } } - public override bool SupportsRss { get { return true; } } - public override bool SupportsSearch { get { return true; } } - public override int PageSize { get { return 100; } } + public override DownloadProtocol Protocol => DownloadProtocol.Torrent; + public override bool SupportsRss => true; + public override bool SupportsSearch => true; + public override int PageSize => 100; public BroadcastheNet(IHttpClient httpClient, IIndexerStatusService indexerStatusService, IConfigService configService, IParsingService parsingService, Logger logger) : base(httpClient, indexerStatusService, configService, parsingService, logger) diff --git a/src/NzbDrone.Core/Indexers/Exceptions/IndexerException.cs b/src/NzbDrone.Core/Indexers/Exceptions/IndexerException.cs index f93ef990e..629f596a8 100644 --- a/src/NzbDrone.Core/Indexers/Exceptions/IndexerException.cs +++ b/src/NzbDrone.Core/Indexers/Exceptions/IndexerException.cs @@ -18,9 +18,6 @@ namespace NzbDrone.Core.Indexers.Exceptions _indexerResponse = response; } - public IndexerResponse Response - { - get { return _indexerResponse; } - } + public IndexerResponse Response => _indexerResponse; } } diff --git a/src/NzbDrone.Core/Indexers/Fanzub/Fanzub.cs b/src/NzbDrone.Core/Indexers/Fanzub/Fanzub.cs index ad1231aeb..fc66a83f1 100644 --- a/src/NzbDrone.Core/Indexers/Fanzub/Fanzub.cs +++ b/src/NzbDrone.Core/Indexers/Fanzub/Fanzub.cs @@ -7,15 +7,9 @@ namespace NzbDrone.Core.Indexers.Fanzub { public class Fanzub : HttpIndexerBase { - public override string Name - { - get - { - return "Fanzub"; - } - } + public override string Name => "Fanzub"; - public override DownloadProtocol Protocol { get { return DownloadProtocol.Usenet; } } + public override DownloadProtocol Protocol => DownloadProtocol.Usenet; public Fanzub(IHttpClient httpClient, IIndexerStatusService indexerStatusService, IConfigService configService, IParsingService parsingService, Logger logger) : base(httpClient, indexerStatusService, configService, parsingService, logger) diff --git a/src/NzbDrone.Core/Indexers/HDBits/HDBits.cs b/src/NzbDrone.Core/Indexers/HDBits/HDBits.cs index 7cdf779e9..97ddeadf5 100644 --- a/src/NzbDrone.Core/Indexers/HDBits/HDBits.cs +++ b/src/NzbDrone.Core/Indexers/HDBits/HDBits.cs @@ -8,11 +8,11 @@ namespace NzbDrone.Core.Indexers.HDBits { public class HDBits : HttpIndexerBase { - public override string Name { get { return "HDBits"; } } - public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } } - public override bool SupportsRss { get { return true; } } - public override bool SupportsSearch { get { return true; } } - public override int PageSize { get { return 30; } } + public override string Name => "HDBits"; + public override DownloadProtocol Protocol => DownloadProtocol.Torrent; + public override bool SupportsRss => true; + public override bool SupportsSearch => true; + public override int PageSize => 30; public HDBits(IHttpClient httpClient, IIndexerStatusService indexerStatusService, IConfigService configService, IParsingService parsingService, Logger logger) : base(httpClient, indexerStatusService, configService, parsingService, logger) diff --git a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs index c9cfff122..f91bc17a7 100644 --- a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs +++ b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs @@ -24,12 +24,12 @@ namespace NzbDrone.Core.Indexers protected readonly IHttpClient _httpClient; - public override bool SupportsRss { get { return true; } } - public override bool SupportsSearch { get { return true; } } - public bool SupportsPaging { get { return PageSize > 0; } } + public override bool SupportsRss => true; + public override bool SupportsSearch => true; + public bool SupportsPaging => PageSize > 0; - public virtual int PageSize { get { return 0; } } - public virtual TimeSpan RateLimit { get { return TimeSpan.FromSeconds(2); } } + public virtual int PageSize => 0; + public virtual TimeSpan RateLimit => TimeSpan.FromSeconds(2); public abstract IIndexerRequestGenerator GetRequestGenerator(); public abstract IParseIndexerResponse GetParser(); diff --git a/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrents.cs b/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrents.cs index 0e602bafc..2042a6268 100644 --- a/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrents.cs +++ b/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrents.cs @@ -8,17 +8,11 @@ namespace NzbDrone.Core.Indexers.IPTorrents { public class IPTorrents : HttpIndexerBase { - public override string Name - { - get - { - return "IP Torrents"; - } - } + public override string Name => "IP Torrents"; - public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } } - public override bool SupportsSearch { get { return false; } } - public override int PageSize { get { return 0; } } + public override DownloadProtocol Protocol => DownloadProtocol.Torrent; + public override bool SupportsSearch => false; + public override int PageSize => 0; public IPTorrents(IHttpClient httpClient, IIndexerStatusService indexerStatusService, IConfigService configService, IParsingService parsingService, Logger logger) : base(httpClient, indexerStatusService, configService, parsingService, logger) diff --git a/src/NzbDrone.Core/Indexers/IndexerBase.cs b/src/NzbDrone.Core/Indexers/IndexerBase.cs index 17a73c398..4e08e5aad 100644 --- a/src/NzbDrone.Core/Indexers/IndexerBase.cs +++ b/src/NzbDrone.Core/Indexers/IndexerBase.cs @@ -34,18 +34,9 @@ namespace NzbDrone.Core.Indexers _logger = logger; } - 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 virtual IEnumerable DefaultDefinitions { @@ -68,13 +59,7 @@ namespace NzbDrone.Core.Indexers public virtual object RequestAction(string action, IDictionary query) { return null; } - protected TSettings Settings - { - get - { - return (TSettings)Definition.Settings; - } - } + protected TSettings Settings => (TSettings)Definition.Settings; public abstract IList FetchRecent(); public abstract IList Fetch(SeasonSearchCriteria searchCriteria); diff --git a/src/NzbDrone.Core/Indexers/IndexerDefinition.cs b/src/NzbDrone.Core/Indexers/IndexerDefinition.cs index 499487b15..b4f1d7ddb 100644 --- a/src/NzbDrone.Core/Indexers/IndexerDefinition.cs +++ b/src/NzbDrone.Core/Indexers/IndexerDefinition.cs @@ -11,13 +11,7 @@ namespace NzbDrone.Core.Indexers public bool SupportsRss { get; set; } public bool SupportsSearch { get; set; } - public override bool Enable - { - get - { - return EnableRss || EnableSearch; - } - } + public override bool Enable => EnableRss || EnableSearch; public IndexerStatus Status { get; set; } } diff --git a/src/NzbDrone.Core/Indexers/IndexerPageableRequestChain.cs b/src/NzbDrone.Core/Indexers/IndexerPageableRequestChain.cs index 498f21ec1..b44cfaf76 100644 --- a/src/NzbDrone.Core/Indexers/IndexerPageableRequestChain.cs +++ b/src/NzbDrone.Core/Indexers/IndexerPageableRequestChain.cs @@ -13,10 +13,7 @@ namespace NzbDrone.Core.Indexers _chains.Add(new List()); } - public int Tiers - { - get { return _chains.Count; } - } + public int Tiers => _chains.Count; public IEnumerable GetAllTiers() { diff --git a/src/NzbDrone.Core/Indexers/IndexerRequest.cs b/src/NzbDrone.Core/Indexers/IndexerRequest.cs index 187e46954..d2eb6a9f3 100644 --- a/src/NzbDrone.Core/Indexers/IndexerRequest.cs +++ b/src/NzbDrone.Core/Indexers/IndexerRequest.cs @@ -17,9 +17,6 @@ namespace NzbDrone.Core.Indexers HttpRequest = httpRequest; } - public HttpUri Url - { - get { return HttpRequest.Url; } - } + public HttpUri Url => HttpRequest.Url; } } diff --git a/src/NzbDrone.Core/Indexers/IndexerResponse.cs b/src/NzbDrone.Core/Indexers/IndexerResponse.cs index ffc4dc5e2..fd3d3d90c 100644 --- a/src/NzbDrone.Core/Indexers/IndexerResponse.cs +++ b/src/NzbDrone.Core/Indexers/IndexerResponse.cs @@ -14,24 +14,12 @@ namespace NzbDrone.Core.Indexers _httpResponse = httpResponse; } - public IndexerRequest Request - { - get { return _indexerRequest; } - } + public IndexerRequest Request => _indexerRequest; - public HttpRequest HttpRequest - { - get { return _httpResponse.Request; } - } + public HttpRequest HttpRequest => _httpResponse.Request; - public HttpResponse HttpResponse - { - get { return _httpResponse; } - } + public HttpResponse HttpResponse => _httpResponse; - public string Content - { - get { return _httpResponse.Content; } - } + public string Content => _httpResponse.Content; } } diff --git a/src/NzbDrone.Core/Indexers/KickassTorrents/KickassTorrents.cs b/src/NzbDrone.Core/Indexers/KickassTorrents/KickassTorrents.cs index 34a545b78..74f537aa7 100644 --- a/src/NzbDrone.Core/Indexers/KickassTorrents/KickassTorrents.cs +++ b/src/NzbDrone.Core/Indexers/KickassTorrents/KickassTorrents.cs @@ -8,16 +8,10 @@ namespace NzbDrone.Core.Indexers.KickassTorrents { public class KickassTorrents : HttpIndexerBase { - public override string Name - { - get - { - return "Kickass Torrents"; - } - } + public override string Name => "Kickass Torrents"; - public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } } - public override int PageSize { get { return 25; } } + public override DownloadProtocol Protocol => DownloadProtocol.Torrent; + public override int PageSize => 25; public KickassTorrents(IHttpClient httpClient, IIndexerStatusService indexerStatusService, IConfigService configService, IParsingService parsingService, Logger logger) : base(httpClient, indexerStatusService, configService, parsingService, logger) diff --git a/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs b/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs index 9733dc0e5..bd75f0382 100644 --- a/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs +++ b/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs @@ -15,19 +15,11 @@ namespace NzbDrone.Core.Indexers.Newznab { private readonly INewznabCapabilitiesProvider _capabilitiesProvider; - public override string Name - { - get - { - return "Newznab"; - } - } + public override string Name => "Newznab"; - public override DownloadProtocol Protocol { get { return DownloadProtocol.Usenet; } } - public override int PageSize - { - get { return _capabilitiesProvider.GetCapabilities(Settings).DefaultPageSize; } - } + public override DownloadProtocol Protocol => DownloadProtocol.Usenet; + + public override int PageSize => _capabilitiesProvider.GetCapabilities(Settings).DefaultPageSize; public override IIndexerRequestGenerator GetRequestGenerator() { diff --git a/src/NzbDrone.Core/Indexers/Nyaa/Nyaa.cs b/src/NzbDrone.Core/Indexers/Nyaa/Nyaa.cs index 12ad72197..fc16dfb91 100644 --- a/src/NzbDrone.Core/Indexers/Nyaa/Nyaa.cs +++ b/src/NzbDrone.Core/Indexers/Nyaa/Nyaa.cs @@ -8,16 +8,10 @@ namespace NzbDrone.Core.Indexers.Nyaa { public class Nyaa : HttpIndexerBase { - public override string Name - { - get - { - return "Nyaa"; - } - } + public override string Name => "Nyaa"; - public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } } - public override int PageSize { get { return 100; } } + public override DownloadProtocol Protocol => DownloadProtocol.Torrent; + public override int PageSize => 100; public Nyaa(IHttpClient httpClient, IIndexerStatusService indexerStatusService, IConfigService configService, IParsingService parsingService, Logger logger) : base(httpClient, indexerStatusService, configService, parsingService, logger) diff --git a/src/NzbDrone.Core/Indexers/Omgwtfnzbs/Omgwtfnzbs.cs b/src/NzbDrone.Core/Indexers/Omgwtfnzbs/Omgwtfnzbs.cs index 473802994..d957b5cbd 100644 --- a/src/NzbDrone.Core/Indexers/Omgwtfnzbs/Omgwtfnzbs.cs +++ b/src/NzbDrone.Core/Indexers/Omgwtfnzbs/Omgwtfnzbs.cs @@ -7,15 +7,9 @@ namespace NzbDrone.Core.Indexers.Omgwtfnzbs { public class Omgwtfnzbs : HttpIndexerBase { - public override string Name - { - get - { - return "omgwtfnzbs"; - } - } + public override string Name => "omgwtfnzbs"; - public override DownloadProtocol Protocol { get { return DownloadProtocol.Usenet; } } + public override DownloadProtocol Protocol => DownloadProtocol.Usenet; public Omgwtfnzbs(IHttpClient httpClient, IIndexerStatusService indexerStatusService, IConfigService configService, IParsingService parsingService, Logger logger) : base(httpClient, indexerStatusService, configService, parsingService, logger) diff --git a/src/NzbDrone.Core/Indexers/Rarbg/Rarbg.cs b/src/NzbDrone.Core/Indexers/Rarbg/Rarbg.cs index f300caf96..049809dce 100644 --- a/src/NzbDrone.Core/Indexers/Rarbg/Rarbg.cs +++ b/src/NzbDrone.Core/Indexers/Rarbg/Rarbg.cs @@ -15,10 +15,10 @@ namespace NzbDrone.Core.Indexers.Rarbg { private readonly IRarbgTokenProvider _tokenProvider; - public override string Name { get { return "Rarbg"; } } - - public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } } - public override TimeSpan RateLimit { get { return TimeSpan.FromSeconds(2); } } + public override string Name => "Rarbg"; + + public override DownloadProtocol Protocol => DownloadProtocol.Torrent; + public override TimeSpan RateLimit => TimeSpan.FromSeconds(2); public Rarbg(IRarbgTokenProvider tokenProvider, IHttpClient httpClient, IIndexerStatusService indexerStatusService, IConfigService configService, IParsingService parsingService, Logger logger) : base(httpClient, indexerStatusService, configService, parsingService, logger) diff --git a/src/NzbDrone.Core/Indexers/RssSyncCommand.cs b/src/NzbDrone.Core/Indexers/RssSyncCommand.cs index 56b4532bf..308a9de2e 100644 --- a/src/NzbDrone.Core/Indexers/RssSyncCommand.cs +++ b/src/NzbDrone.Core/Indexers/RssSyncCommand.cs @@ -5,13 +5,6 @@ namespace NzbDrone.Core.Indexers public class RssSyncCommand : Command { - public override bool SendUpdatesToClient - { - get - { - return true; - } - } - + public override bool SendUpdatesToClient => true; } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssIndexer.cs b/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssIndexer.cs index f67506bf3..b5537f2d7 100644 --- a/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssIndexer.cs +++ b/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssIndexer.cs @@ -8,17 +8,11 @@ namespace NzbDrone.Core.Indexers.TorrentRss { public class TorrentRssIndexer : HttpIndexerBase { - public override string Name - { - get - { - return "Torrent RSS Feed"; - } - } + public override string Name => "Torrent RSS Feed"; - public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } } - public override bool SupportsSearch { get { return false; } } - public override int PageSize { get { return 0; } } + public override DownloadProtocol Protocol => DownloadProtocol.Torrent; + public override bool SupportsSearch => false; + public override int PageSize => 0; private readonly ITorrentRssParserFactory _torrentRssParserFactory; diff --git a/src/NzbDrone.Core/Indexers/Torrentleech/Torrentleech.cs b/src/NzbDrone.Core/Indexers/Torrentleech/Torrentleech.cs index f7ef5366c..62f18ef34 100644 --- a/src/NzbDrone.Core/Indexers/Torrentleech/Torrentleech.cs +++ b/src/NzbDrone.Core/Indexers/Torrentleech/Torrentleech.cs @@ -8,17 +8,11 @@ namespace NzbDrone.Core.Indexers.Torrentleech { public class Torrentleech : HttpIndexerBase { - public override string Name - { - get - { - return "TorrentLeech"; - } - } + public override string Name => "TorrentLeech"; - public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } } - public override bool SupportsSearch { get { return false; } } - public override int PageSize { get { return 0; } } + public override DownloadProtocol Protocol => DownloadProtocol.Torrent; + public override bool SupportsSearch => false; + public override int PageSize => 0; public Torrentleech(IHttpClient httpClient, IIndexerStatusService indexerStatusService, IConfigService configService, IParsingService parsingService, Logger logger) : base(httpClient, indexerStatusService, configService, parsingService, logger) diff --git a/src/NzbDrone.Core/Indexers/Torznab/Torznab.cs b/src/NzbDrone.Core/Indexers/Torznab/Torznab.cs index 840c3b51e..8d2649c2d 100644 --- a/src/NzbDrone.Core/Indexers/Torznab/Torznab.cs +++ b/src/NzbDrone.Core/Indexers/Torznab/Torznab.cs @@ -16,19 +16,10 @@ namespace NzbDrone.Core.Indexers.Torznab { private readonly INewznabCapabilitiesProvider _capabilitiesProvider; - public override string Name - { - get - { - return "Torznab"; - } - } + public override string Name => "Torznab"; - public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } } - public override int PageSize - { - get { return _capabilitiesProvider.GetCapabilities(Settings).DefaultPageSize; } - } + public override DownloadProtocol Protocol => DownloadProtocol.Torrent; + public override int PageSize => _capabilitiesProvider.GetCapabilities(Settings).DefaultPageSize; public override IIndexerRequestGenerator GetRequestGenerator() { diff --git a/src/NzbDrone.Core/Indexers/Wombles/Wombles.cs b/src/NzbDrone.Core/Indexers/Wombles/Wombles.cs index dd33c38af..571a85288 100644 --- a/src/NzbDrone.Core/Indexers/Wombles/Wombles.cs +++ b/src/NzbDrone.Core/Indexers/Wombles/Wombles.cs @@ -8,16 +8,10 @@ namespace NzbDrone.Core.Indexers.Wombles { public class Wombles : HttpIndexerBase { - public override string Name - { - get - { - return "Womble's"; - } - } + public override string Name => "Womble's"; - public override DownloadProtocol Protocol { get { return DownloadProtocol.Usenet; } } - public override bool SupportsSearch { get { return false; } } + public override DownloadProtocol Protocol => DownloadProtocol.Usenet; + public override bool SupportsSearch => false; public override IParseIndexerResponse GetParser() { diff --git a/src/NzbDrone.Core/Instrumentation/Commands/ClearLogCommand.cs b/src/NzbDrone.Core/Instrumentation/Commands/ClearLogCommand.cs index 986331002..f8eb71ee7 100644 --- a/src/NzbDrone.Core/Instrumentation/Commands/ClearLogCommand.cs +++ b/src/NzbDrone.Core/Instrumentation/Commands/ClearLogCommand.cs @@ -4,12 +4,6 @@ namespace NzbDrone.Core.Instrumentation.Commands { public class ClearLogCommand : Command { - public override bool SendUpdatesToClient - { - get - { - return true; - } - } + public override bool SendUpdatesToClient => true; } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Instrumentation/Commands/DeleteLogFilesCommand.cs b/src/NzbDrone.Core/Instrumentation/Commands/DeleteLogFilesCommand.cs index 1a331247e..7676baa52 100644 --- a/src/NzbDrone.Core/Instrumentation/Commands/DeleteLogFilesCommand.cs +++ b/src/NzbDrone.Core/Instrumentation/Commands/DeleteLogFilesCommand.cs @@ -4,12 +4,6 @@ namespace NzbDrone.Core.Instrumentation.Commands { public class DeleteLogFilesCommand : Command { - public override bool SendUpdatesToClient - { - get - { - return true; - } - } + public override bool SendUpdatesToClient => true; } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Instrumentation/Commands/DeleteUpdateLogFilesCommand.cs b/src/NzbDrone.Core/Instrumentation/Commands/DeleteUpdateLogFilesCommand.cs index a55e91502..5a909bdf6 100644 --- a/src/NzbDrone.Core/Instrumentation/Commands/DeleteUpdateLogFilesCommand.cs +++ b/src/NzbDrone.Core/Instrumentation/Commands/DeleteUpdateLogFilesCommand.cs @@ -4,12 +4,6 @@ namespace NzbDrone.Core.Instrumentation.Commands { public class DeleteUpdateLogFilesCommand : Command { - public override bool SendUpdatesToClient - { - get - { - return true; - } - } + public override bool SendUpdatesToClient => true; } } \ No newline at end of file diff --git a/src/NzbDrone.Core/MediaFiles/Commands/DownloadedEpisodesScanCommand.cs b/src/NzbDrone.Core/MediaFiles/Commands/DownloadedEpisodesScanCommand.cs index a36e6a093..36c0386bd 100644 --- a/src/NzbDrone.Core/MediaFiles/Commands/DownloadedEpisodesScanCommand.cs +++ b/src/NzbDrone.Core/MediaFiles/Commands/DownloadedEpisodesScanCommand.cs @@ -6,13 +6,7 @@ namespace NzbDrone.Core.MediaFiles.Commands { public class DownloadedEpisodesScanCommand : Command { - public override bool SendUpdatesToClient - { - get - { - return SendUpdates; - } - } + public override bool SendUpdatesToClient => SendUpdates; public bool SendUpdates { get; set; } diff --git a/src/NzbDrone.Core/MediaFiles/Commands/RenameFilesCommand.cs b/src/NzbDrone.Core/MediaFiles/Commands/RenameFilesCommand.cs index 2003a3e9f..e0dc34e10 100644 --- a/src/NzbDrone.Core/MediaFiles/Commands/RenameFilesCommand.cs +++ b/src/NzbDrone.Core/MediaFiles/Commands/RenameFilesCommand.cs @@ -8,13 +8,7 @@ namespace NzbDrone.Core.MediaFiles.Commands public int SeriesId { get; set; } public List Files { get; set; } - public override bool SendUpdatesToClient - { - get - { - return true; - } - } + public override bool SendUpdatesToClient => true; public RenameFilesCommand() { diff --git a/src/NzbDrone.Core/MediaFiles/Commands/RenameSeriesCommand.cs b/src/NzbDrone.Core/MediaFiles/Commands/RenameSeriesCommand.cs index e50cc18e0..a2bcda88c 100644 --- a/src/NzbDrone.Core/MediaFiles/Commands/RenameSeriesCommand.cs +++ b/src/NzbDrone.Core/MediaFiles/Commands/RenameSeriesCommand.cs @@ -7,13 +7,7 @@ namespace NzbDrone.Core.MediaFiles.Commands { public List SeriesIds { get; set; } - public override bool SendUpdatesToClient - { - get - { - return true; - } - } + public override bool SendUpdatesToClient => true; public RenameSeriesCommand() { diff --git a/src/NzbDrone.Core/MediaFiles/Commands/RescanSeriesCommand.cs b/src/NzbDrone.Core/MediaFiles/Commands/RescanSeriesCommand.cs index 4523b1deb..6330574ab 100644 --- a/src/NzbDrone.Core/MediaFiles/Commands/RescanSeriesCommand.cs +++ b/src/NzbDrone.Core/MediaFiles/Commands/RescanSeriesCommand.cs @@ -6,13 +6,7 @@ namespace NzbDrone.Core.MediaFiles.Commands { public int? SeriesId { get; set; } - public override bool SendUpdatesToClient - { - get - { - return true; - } - } + public override bool SendUpdatesToClient => true; public RescanSeriesCommand() { diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/DetectSample.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/DetectSample.cs index 6b7b3d69e..b517cd76c 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/DetectSample.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/DetectSample.cs @@ -26,13 +26,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport _logger = logger; } - public static long SampleSizeLimit - { - get - { - return 70.Megabytes(); - } - } + public static long SampleSizeLimit => 70.Megabytes(); public bool IsSample(Series series, QualityModel quality, string path, long size, bool isSpecial) { diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecision.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecision.cs index ba55a4aec..5e4e2ede2 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecision.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecision.cs @@ -11,13 +11,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport public LocalEpisode LocalEpisode { get; private set; } public IEnumerable Rejections { get; private set; } - public bool Approved - { - get - { - return Rejections.Empty(); - } - } + public bool Approved => Rejections.Empty(); public ImportDecision(LocalEpisode localEpisode, params Rejection[] rejections) { diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportCommand.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportCommand.cs index c3c077609..38ed485b7 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportCommand.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportCommand.cs @@ -7,13 +7,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Manual { public List Files { get; set; } - public override bool SendUpdatesToClient - { - get - { - return true; - } - } + public override bool SendUpdatesToClient => true; public ImportMode ImportMode { get; set; } } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/SameEpisodesImportSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/SameEpisodesImportSpecification.cs index da909fb79..ee6c02c53 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/SameEpisodesImportSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/SameEpisodesImportSpecification.cs @@ -15,7 +15,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications _logger = logger; } - public RejectionType Type { get { return RejectionType.Permanent; } } + public RejectionType Type => RejectionType.Permanent; public Decision IsSatisfiedBy(LocalEpisode localEpisode) { diff --git a/src/NzbDrone.Core/MediaFiles/MediaFileExtensions.cs b/src/NzbDrone.Core/MediaFiles/MediaFileExtensions.cs index 2d78b4b56..56413b564 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaFileExtensions.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaFileExtensions.cs @@ -71,10 +71,7 @@ namespace NzbDrone.Core.MediaFiles }; } - public static HashSet Extensions - { - get { return new HashSet(_fileExtensions.Keys); } - } + public static HashSet Extensions => new HashSet(_fileExtensions.Keys); public static Quality GetQualityForExtension(string extension) { diff --git a/src/NzbDrone.Core/Messaging/Commands/Command.cs b/src/NzbDrone.Core/Messaging/Commands/Command.cs index 7dd845a04..20becd1f0 100644 --- a/src/NzbDrone.Core/Messaging/Commands/Command.cs +++ b/src/NzbDrone.Core/Messaging/Commands/Command.cs @@ -4,29 +4,11 @@ namespace NzbDrone.Core.Messaging.Commands { public abstract class Command { - public virtual bool SendUpdatesToClient - { - get - { - return false; - } - } + public virtual bool SendUpdatesToClient => false; - public virtual bool UpdateScheduledTask - { - get - { - return true; - } - } + public virtual bool UpdateScheduledTask => true; - public virtual string CompletionMessage - { - get - { - return "Completed"; - } - } + public virtual string CompletionMessage => "Completed"; public string Name { get; private set; } public DateTime? LastExecutionTime { get; set; } diff --git a/src/NzbDrone.Core/Messaging/Commands/CommandQueue.cs b/src/NzbDrone.Core/Messaging/Commands/CommandQueue.cs index 1301ef245..ad555fe6c 100644 --- a/src/NzbDrone.Core/Messaging/Commands/CommandQueue.cs +++ b/src/NzbDrone.Core/Messaging/Commands/CommandQueue.cs @@ -42,29 +42,11 @@ namespace NzbDrone.Core.Messaging.Commands } } - public int Count - { - get - { - return _items.Count; - } - } + public int Count => _items.Count; - public object SyncRoot - { - get - { - return Mutex; - } - } + public object SyncRoot => Mutex; - public bool IsSynchronized - { - get - { - return true; - } - } + public bool IsSynchronized => true; public void CopyTo(CommandModel[] array, int index) { diff --git a/src/NzbDrone.Core/Messaging/Commands/TestCommand.cs b/src/NzbDrone.Core/Messaging/Commands/TestCommand.cs index 616c99ee7..f52fdeae7 100644 --- a/src/NzbDrone.Core/Messaging/Commands/TestCommand.cs +++ b/src/NzbDrone.Core/Messaging/Commands/TestCommand.cs @@ -4,14 +4,8 @@ namespace NzbDrone.Core.Messaging.Commands { public int Duration { get; set; } - public override bool SendUpdatesToClient - { - get - { - return true; - } - } - + public override bool SendUpdatesToClient => true; + public TestCommand() { Duration = 4000; diff --git a/src/NzbDrone.Core/Notifications/Boxcar/Boxcar.cs b/src/NzbDrone.Core/Notifications/Boxcar/Boxcar.cs index fd238b7f5..c3443c33b 100644 --- a/src/NzbDrone.Core/Notifications/Boxcar/Boxcar.cs +++ b/src/NzbDrone.Core/Notifications/Boxcar/Boxcar.cs @@ -14,10 +14,7 @@ namespace NzbDrone.Core.Notifications.Boxcar _proxy = proxy; } - public override string Link - { - get { return "https://boxcar.io/client"; } - } + public override string Link => "https://boxcar.io/client"; public override void OnGrab(GrabMessage grabMessage) { @@ -37,21 +34,9 @@ namespace NzbDrone.Core.Notifications.Boxcar { } - public override string Name - { - get - { - return "Boxcar"; - } - } + public override string Name => "Boxcar"; - public override bool SupportsOnRename - { - get - { - return false; - } - } + public override bool SupportsOnRename => false; public override ValidationResult Test() { diff --git a/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs b/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs index 87f4d7c75..a160963c7 100644 --- a/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs +++ b/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs @@ -24,10 +24,7 @@ namespace NzbDrone.Core.Notifications.CustomScript _logger = logger; } - public override string Link - { - get { return "https://github.com/Sonarr/Sonarr/wiki/Custom-Post-Processing-Scripts"; } - } + public override string Link => "https://github.com/Sonarr/Sonarr/wiki/Custom-Post-Processing-Scripts"; public override void OnGrab(GrabMessage message) { @@ -98,13 +95,7 @@ namespace NzbDrone.Core.Notifications.CustomScript ExecuteScript(environmentVariables); } - public override string Name - { - get - { - return "Custom Script"; - } - } + public override string Name => "Custom Script"; public override ValidationResult Test() { diff --git a/src/NzbDrone.Core/Notifications/Email/Email.cs b/src/NzbDrone.Core/Notifications/Email/Email.cs index bc49e6c71..e71ad171a 100644 --- a/src/NzbDrone.Core/Notifications/Email/Email.cs +++ b/src/NzbDrone.Core/Notifications/Email/Email.cs @@ -15,10 +15,7 @@ namespace NzbDrone.Core.Notifications.Email _emailService = emailService; } - public override string Link - { - get { return null; } - } + public override string Link => null; public override void OnGrab(GrabMessage grabMessage) { @@ -40,21 +37,9 @@ namespace NzbDrone.Core.Notifications.Email { } - public override string Name - { - get - { - return "Email"; - } - } + public override string Name => "Email"; - public override bool SupportsOnRename - { - get - { - return false; - } - } + public override bool SupportsOnRename => false; public override ValidationResult Test() { diff --git a/src/NzbDrone.Core/Notifications/Growl/Growl.cs b/src/NzbDrone.Core/Notifications/Growl/Growl.cs index c2bf31fa5..99b43f625 100644 --- a/src/NzbDrone.Core/Notifications/Growl/Growl.cs +++ b/src/NzbDrone.Core/Notifications/Growl/Growl.cs @@ -14,10 +14,7 @@ namespace NzbDrone.Core.Notifications.Growl _growlService = growlService; } - public override string Link - { - get { return "http://growl.info/"; } - } + public override string Link => "http://growl.info/"; public override void OnGrab(GrabMessage grabMessage) { @@ -37,21 +34,9 @@ namespace NzbDrone.Core.Notifications.Growl { } - public override string Name - { - get - { - return "Growl"; - } - } + public override string Name => "Growl"; - public override bool SupportsOnRename - { - get - { - return false; - } - } + public override bool SupportsOnRename => false; public override ValidationResult Test() { diff --git a/src/NzbDrone.Core/Notifications/Growl/GrowlSettings.cs b/src/NzbDrone.Core/Notifications/Growl/GrowlSettings.cs index a6cab3db9..eaf960355 100644 --- a/src/NzbDrone.Core/Notifications/Growl/GrowlSettings.cs +++ b/src/NzbDrone.Core/Notifications/Growl/GrowlSettings.cs @@ -33,13 +33,7 @@ namespace NzbDrone.Core.Notifications.Growl [FieldDefinition(2, Label = "Password")] public string Password { get; set; } - public bool IsValid - { - get - { - return !string.IsNullOrWhiteSpace(Host) && !string.IsNullOrWhiteSpace(Password) && Port > 0; - } - } + public bool IsValid => !string.IsNullOrWhiteSpace(Host) && !string.IsNullOrWhiteSpace(Password) && Port > 0; public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Notifications/Join/Join.cs b/src/NzbDrone.Core/Notifications/Join/Join.cs index 78a47dd5e..747a141e1 100644 --- a/src/NzbDrone.Core/Notifications/Join/Join.cs +++ b/src/NzbDrone.Core/Notifications/Join/Join.cs @@ -14,10 +14,7 @@ namespace NzbDrone.Core.Notifications.Join _proxy = proxy; } - public override string Link - { - get { return "https://joinjoaomgcd.appspot.com/"; } - } + public override string Link => "https://joinjoaomgcd.appspot.com/"; public override void OnGrab(GrabMessage grabMessage) { @@ -37,21 +34,9 @@ namespace NzbDrone.Core.Notifications.Join { } - public override string Name - { - get - { - return "Join"; - } - } + public override string Name => "Join"; - public override bool SupportsOnRename - { - get - { - return false; - } - } + public override bool SupportsOnRename => false; public override ValidationResult Test() { diff --git a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowser.cs b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowser.cs index 7102da090..44d4d2508 100644 --- a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowser.cs +++ b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowser.cs @@ -15,10 +15,7 @@ namespace NzbDrone.Core.Notifications.MediaBrowser _mediaBrowserService = mediaBrowserService; } - public override string Link - { - get { return "http://mediabrowser.tv/"; } - } + public override string Link => "http://mediabrowser.tv/"; public override void OnGrab(GrabMessage grabMessage) { @@ -53,13 +50,7 @@ namespace NzbDrone.Core.Notifications.MediaBrowser } } - public override string Name - { - get - { - return "Emby (Media Browser)"; - } - } + public override string Name => "Emby (Media Browser)"; public override ValidationResult Test() { diff --git a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserSettings.cs b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserSettings.cs index f80800b40..ef51e4913 100644 --- a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserSettings.cs +++ b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserSettings.cs @@ -41,15 +41,9 @@ namespace NzbDrone.Core.Notifications.MediaBrowser public bool UpdateLibrary { get; set; } [JsonIgnore] - public string Address { get { return string.Format("{0}:{1}", Host, Port); } } - - public bool IsValid - { - get - { - return !string.IsNullOrWhiteSpace(Host) && Port > 0; - } - } + public string Address => string.Format("{0}:{1}", Host, Port); + + public bool IsValid => !string.IsNullOrWhiteSpace(Host) && Port > 0; public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Notifications/NotificationBase.cs b/src/NzbDrone.Core/Notifications/NotificationBase.cs index 49d28f169..197fadae0 100644 --- a/src/NzbDrone.Core/Notifications/NotificationBase.cs +++ b/src/NzbDrone.Core/Notifications/NotificationBase.cs @@ -10,29 +10,11 @@ namespace NzbDrone.Core.Notifications { 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 DefaultDefinitions - { - get - { - return new List(); - } - } + public IEnumerable DefaultDefinitions => new List(); public ProviderDefinition Definition { get; set; } public abstract ValidationResult Test(); @@ -43,18 +25,12 @@ namespace NzbDrone.Core.Notifications public abstract void OnDownload(DownloadMessage message); public abstract void OnRename(Series series); - public virtual bool SupportsOnGrab { get { return true; } } - public virtual bool SupportsOnDownload { get { return true; } } - public virtual bool SupportsOnUpgrade { get { return true; } } - public virtual bool SupportsOnRename { get { return true; } } + public virtual bool SupportsOnGrab => true; + public virtual bool SupportsOnDownload => true; + public virtual bool SupportsOnUpgrade => true; + public virtual bool SupportsOnRename => true; - protected TSettings Settings - { - get - { - return (TSettings)Definition.Settings; - } - } + protected TSettings Settings => (TSettings)Definition.Settings; public override string ToString() { diff --git a/src/NzbDrone.Core/Notifications/NotificationDefinition.cs b/src/NzbDrone.Core/Notifications/NotificationDefinition.cs index df1b89e0e..dc4248289 100644 --- a/src/NzbDrone.Core/Notifications/NotificationDefinition.cs +++ b/src/NzbDrone.Core/Notifications/NotificationDefinition.cs @@ -21,12 +21,6 @@ namespace NzbDrone.Core.Notifications public bool SupportsOnRename { get; set; } public HashSet Tags { get; set; } - public override bool Enable - { - get - { - return OnGrab || OnDownload || (OnDownload && OnUpgrade); - } - } + public override bool Enable => OnGrab || OnDownload || (OnDownload && OnUpgrade); } } diff --git a/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroid.cs b/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroid.cs index 3d4a7f813..176612065 100644 --- a/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroid.cs +++ b/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroid.cs @@ -15,10 +15,7 @@ namespace NzbDrone.Core.Notifications.NotifyMyAndroid _proxy = proxy; } - public override string Link - { - get { return "http://www.notifymyandroid.com/"; } - } + public override string Link => "http://www.notifymyandroid.com/"; public override void OnGrab(GrabMessage grabMessage) { @@ -38,21 +35,9 @@ namespace NzbDrone.Core.Notifications.NotifyMyAndroid { } - public override string Name - { - get - { - return "Notify My Android"; - } - } + public override string Name => "Notify My Android"; - public override bool SupportsOnRename - { - get - { - return false; - } - } + public override bool SupportsOnRename => false; public override ValidationResult Test() { diff --git a/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidSettings.cs b/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidSettings.cs index f8b99cfa1..e369ddee0 100644 --- a/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidSettings.cs +++ b/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidSettings.cs @@ -24,13 +24,7 @@ namespace NzbDrone.Core.Notifications.NotifyMyAndroid [FieldDefinition(1, Label = "Priority", Type = FieldType.Select, SelectOptions = typeof(NotifyMyAndroidPriority))] public int Priority { get; set; } - public bool IsValid - { - get - { - return !string.IsNullOrWhiteSpace(ApiKey) && Priority >= -1 && Priority <= 2; - } - } + public bool IsValid => !string.IsNullOrWhiteSpace(ApiKey) && Priority >= -1 && Priority <= 2; public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexClient.cs b/src/NzbDrone.Core/Notifications/Plex/PlexClient.cs index 3b5a25b6d..844b3bb0a 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexClient.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexClient.cs @@ -14,10 +14,7 @@ namespace NzbDrone.Core.Notifications.Plex _plexClientService = plexClientService; } - public override string Link - { - get { return "http://www.plexapp.com/"; } - } + public override string Link => "http://www.plexapp.com/"; public override void OnGrab(GrabMessage grabMessage) { @@ -35,21 +32,9 @@ namespace NzbDrone.Core.Notifications.Plex { } - public override string Name - { - get - { - return "Plex Media Center"; - } - } + public override string Name => "Plex Media Center"; - public override bool SupportsOnRename - { - get - { - return false; - } - } + public override bool SupportsOnRename => false; public override ValidationResult Test() { diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexClientSettings.cs b/src/NzbDrone.Core/Notifications/Plex/PlexClientSettings.cs index e1b1e0499..e972993e9 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexClientSettings.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexClientSettings.cs @@ -36,13 +36,7 @@ namespace NzbDrone.Core.Notifications.Plex [FieldDefinition(3, Label = "Password")] public string Password { get; set; } - public bool IsValid - { - get - { - return !string.IsNullOrWhiteSpace(Host); - } - } + public bool IsValid => !string.IsNullOrWhiteSpace(Host); public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexHomeTheater.cs b/src/NzbDrone.Core/Notifications/Plex/PlexHomeTheater.cs index 42b5098d8..12aed9928 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexHomeTheater.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexHomeTheater.cs @@ -20,10 +20,7 @@ namespace NzbDrone.Core.Notifications.Plex _logger = logger; } - public override string Link - { - get { return "https://plex.tv/"; } - } + public override string Link => "https://plex.tv/"; public override void OnGrab(GrabMessage grabMessage) { @@ -44,21 +41,9 @@ namespace NzbDrone.Core.Notifications.Plex } - public override string Name - { - get - { - return "Plex Home Theater"; - } - } + public override string Name => "Plex Home Theater"; - public override bool SupportsOnRename - { - get - { - return false; - } - } + public override bool SupportsOnRename => false; public override ValidationResult Test() { diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexServer.cs b/src/NzbDrone.Core/Notifications/Plex/PlexServer.cs index cf7f7acd8..2f3da8822 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexServer.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexServer.cs @@ -14,10 +14,7 @@ namespace NzbDrone.Core.Notifications.Plex _plexServerService = plexServerService; } - public override string Link - { - get { return "http://www.plexapp.com/"; } - } + public override string Link => "http://www.plexapp.com/"; public override void OnGrab(GrabMessage grabMessage) { @@ -41,21 +38,9 @@ namespace NzbDrone.Core.Notifications.Plex } } - public override string Name - { - get - { - return "Plex Media Server"; - } - } + public override string Name => "Plex Media Server"; - public override bool SupportsOnGrab - { - get - { - return false; - } - } + public override bool SupportsOnGrab => false; public override ValidationResult Test() { diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexServerSettings.cs b/src/NzbDrone.Core/Notifications/Plex/PlexServerSettings.cs index 983a6d16b..8c5fe6087 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexServerSettings.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexServerSettings.cs @@ -44,13 +44,7 @@ namespace NzbDrone.Core.Notifications.Plex [FieldDefinition(5, Label = "Use SSL", Type = FieldType.Checkbox, HelpText = "Connect to Plex over HTTPS instead of HTTP")] public bool UseSsl { get; set; } - public bool IsValid - { - get - { - return !string.IsNullOrWhiteSpace(Host); - } - } + public bool IsValid => !string.IsNullOrWhiteSpace(Host); public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Notifications/Prowl/Prowl.cs b/src/NzbDrone.Core/Notifications/Prowl/Prowl.cs index fe31abace..59bba6f43 100644 --- a/src/NzbDrone.Core/Notifications/Prowl/Prowl.cs +++ b/src/NzbDrone.Core/Notifications/Prowl/Prowl.cs @@ -15,10 +15,7 @@ namespace NzbDrone.Core.Notifications.Prowl _prowlService = prowlService; } - public override string Link - { - get { return "http://www.prowlapp.com/"; } - } + public override string Link => "http://www.prowlapp.com/"; public override void OnGrab(GrabMessage grabMessage) { @@ -38,21 +35,9 @@ namespace NzbDrone.Core.Notifications.Prowl { } - public override string Name - { - get - { - return "Prowl"; - } - } + public override string Name => "Prowl"; - public override bool SupportsOnRename - { - get - { - return false; - } - } + public override bool SupportsOnRename => false; public override ValidationResult Test() { diff --git a/src/NzbDrone.Core/Notifications/Prowl/ProwlSettings.cs b/src/NzbDrone.Core/Notifications/Prowl/ProwlSettings.cs index b6cd2ae2e..f705dcf1b 100644 --- a/src/NzbDrone.Core/Notifications/Prowl/ProwlSettings.cs +++ b/src/NzbDrone.Core/Notifications/Prowl/ProwlSettings.cs @@ -24,13 +24,7 @@ namespace NzbDrone.Core.Notifications.Prowl [FieldDefinition(1, Label = "Priority", Type = FieldType.Select, SelectOptions= typeof(ProwlPriority) )] public int Priority { get; set; } - public bool IsValid - { - get - { - return !string.IsNullOrWhiteSpace(ApiKey) && Priority >= -2 && Priority <= 2; - } - } + public bool IsValid => !string.IsNullOrWhiteSpace(ApiKey) && Priority >= -2 && Priority <= 2; public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Notifications/PushBullet/PushBullet.cs b/src/NzbDrone.Core/Notifications/PushBullet/PushBullet.cs index ec2c997ac..684ff702b 100644 --- a/src/NzbDrone.Core/Notifications/PushBullet/PushBullet.cs +++ b/src/NzbDrone.Core/Notifications/PushBullet/PushBullet.cs @@ -14,10 +14,7 @@ namespace NzbDrone.Core.Notifications.PushBullet _proxy = proxy; } - public override string Link - { - get { return "https://www.pushbullet.com/"; } - } + public override string Link => "https://www.pushbullet.com/"; public override void OnGrab(GrabMessage grabMessage) { @@ -37,21 +34,9 @@ namespace NzbDrone.Core.Notifications.PushBullet { } - public override string Name - { - get - { - return "Pushbullet"; - } - } + public override string Name => "Pushbullet"; - public override bool SupportsOnRename - { - get - { - return false; - } - } + public override bool SupportsOnRename => false; public override ValidationResult Test() { diff --git a/src/NzbDrone.Core/Notifications/Pushalot/Pushalot.cs b/src/NzbDrone.Core/Notifications/Pushalot/Pushalot.cs index 67484a92d..a57eb0eb2 100644 --- a/src/NzbDrone.Core/Notifications/Pushalot/Pushalot.cs +++ b/src/NzbDrone.Core/Notifications/Pushalot/Pushalot.cs @@ -15,10 +15,7 @@ namespace NzbDrone.Core.Notifications.Pushalot _proxy = proxy; } - public override string Link - { - get { return "https://www.Pushalot.com/"; } - } + public override string Link => "https://www.Pushalot.com/"; public override void OnGrab(GrabMessage grabMessage) { @@ -38,21 +35,9 @@ namespace NzbDrone.Core.Notifications.Pushalot { } - public override string Name - { - get - { - return "Pushalot"; - } - } + public override string Name => "Pushalot"; - public override bool SupportsOnRename - { - get - { - return false; - } - } + public override bool SupportsOnRename => false; public override ValidationResult Test() { diff --git a/src/NzbDrone.Core/Notifications/Pushalot/PushalotSettings.cs b/src/NzbDrone.Core/Notifications/Pushalot/PushalotSettings.cs index 8112a224f..29f067e75 100644 --- a/src/NzbDrone.Core/Notifications/Pushalot/PushalotSettings.cs +++ b/src/NzbDrone.Core/Notifications/Pushalot/PushalotSettings.cs @@ -32,13 +32,7 @@ namespace NzbDrone.Core.Notifications.Pushalot [FieldDefinition(2, Label = "Image", Type = FieldType.Checkbox, HelpText = "Include Sonarr logo with notifications")] public bool Image { get; set; } - public bool IsValid - { - get - { - return !string.IsNullOrWhiteSpace(AuthToken); - } - } + public bool IsValid => !string.IsNullOrWhiteSpace(AuthToken); public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Notifications/Pushover/Pushover.cs b/src/NzbDrone.Core/Notifications/Pushover/Pushover.cs index c61320d46..ee8f61053 100644 --- a/src/NzbDrone.Core/Notifications/Pushover/Pushover.cs +++ b/src/NzbDrone.Core/Notifications/Pushover/Pushover.cs @@ -14,10 +14,7 @@ namespace NzbDrone.Core.Notifications.Pushover _proxy = proxy; } - public override string Link - { - get { return "https://pushover.net/"; } - } + public override string Link => "https://pushover.net/"; public override void OnGrab(GrabMessage grabMessage) { @@ -37,21 +34,9 @@ namespace NzbDrone.Core.Notifications.Pushover { } - public override string Name - { - get - { - return "Pushover"; - } - } + public override string Name => "Pushover"; - public override bool SupportsOnRename - { - get - { - return false; - } - } + public override bool SupportsOnRename => false; public override ValidationResult Test() { diff --git a/src/NzbDrone.Core/Notifications/Pushover/PushoverSettings.cs b/src/NzbDrone.Core/Notifications/Pushover/PushoverSettings.cs index d985baeed..c03ea7cc6 100644 --- a/src/NzbDrone.Core/Notifications/Pushover/PushoverSettings.cs +++ b/src/NzbDrone.Core/Notifications/Pushover/PushoverSettings.cs @@ -43,13 +43,7 @@ namespace NzbDrone.Core.Notifications.Pushover [FieldDefinition(5, Label = "Sound", Type = FieldType.Textbox, HelpText = "Notification sound, leave blank to use the default", HelpLink = "https://pushover.net/api#sounds")] public string Sound { get; set; } - public bool IsValid - { - get - { - return !string.IsNullOrWhiteSpace(UserKey) && Priority >= -1 && Priority <= 2; - } - } + public bool IsValid => !string.IsNullOrWhiteSpace(UserKey) && Priority >= -1 && Priority <= 2; public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Notifications/Slack/Slack.cs b/src/NzbDrone.Core/Notifications/Slack/Slack.cs index 203d0d7ec..498d17349 100644 --- a/src/NzbDrone.Core/Notifications/Slack/Slack.cs +++ b/src/NzbDrone.Core/Notifications/Slack/Slack.cs @@ -21,18 +21,9 @@ namespace NzbDrone.Core.Notifications.Slack _logger = logger; } - public override string Name - { - get - { - return "Slack"; - } - } + public override string Name => "Slack"; - public override string Link - { - get { return "https://my.slack.com/services/new/incoming-webhook/"; } - } + public override string Link => "https://my.slack.com/services/new/incoming-webhook/"; public override void OnGrab(GrabMessage message) { diff --git a/src/NzbDrone.Core/Notifications/Synology/SynologyIndexer.cs b/src/NzbDrone.Core/Notifications/Synology/SynologyIndexer.cs index ed9bd2a08..4994ce00a 100644 --- a/src/NzbDrone.Core/Notifications/Synology/SynologyIndexer.cs +++ b/src/NzbDrone.Core/Notifications/Synology/SynologyIndexer.cs @@ -16,10 +16,7 @@ namespace NzbDrone.Core.Notifications.Synology _indexerProxy = indexerProxy; } - public override string Link - { - get { return "http://www.synology.com"; } - } + public override string Link => "http://www.synology.com"; public override void OnGrab(GrabMessage grabMessage) { @@ -53,13 +50,7 @@ namespace NzbDrone.Core.Notifications.Synology } } - public override string Name - { - get - { - return "Synology Indexer"; - } - } + public override string Name => "Synology Indexer"; public override ValidationResult Test() { diff --git a/src/NzbDrone.Core/Notifications/Telegram/Telegram.cs b/src/NzbDrone.Core/Notifications/Telegram/Telegram.cs index 837599d76..240008c5e 100644 --- a/src/NzbDrone.Core/Notifications/Telegram/Telegram.cs +++ b/src/NzbDrone.Core/Notifications/Telegram/Telegram.cs @@ -14,10 +14,7 @@ namespace NzbDrone.Core.Notifications.Telegram _proxy = proxy; } - public override string Link - { - get { return "https://telegram.org/"; } - } + public override string Link => "https://telegram.org/"; public override void OnGrab(GrabMessage grabMessage) { @@ -37,21 +34,9 @@ namespace NzbDrone.Core.Notifications.Telegram { } - public override string Name - { - get - { - return "Telegram"; - } - } + public override string Name => "Telegram"; - public override bool SupportsOnRename - { - get - { - return false; - } - } + public override bool SupportsOnRename => false; public override ValidationResult Test() { diff --git a/src/NzbDrone.Core/Notifications/Telegram/TelegramSettings.cs b/src/NzbDrone.Core/Notifications/Telegram/TelegramSettings.cs index dcd1559ee..58f04709e 100644 --- a/src/NzbDrone.Core/Notifications/Telegram/TelegramSettings.cs +++ b/src/NzbDrone.Core/Notifications/Telegram/TelegramSettings.cs @@ -24,13 +24,7 @@ namespace NzbDrone.Core.Notifications.Telegram [FieldDefinition(1, Label = "Chat ID", HelpLink = "http://stackoverflow.com/a/37396871/882971", HelpText = "You must start a conversation with the bot or add it to your group to receive messages")] public string ChatId { get; set; } - public bool IsValid - { - get - { - return !string.IsNullOrWhiteSpace(ChatId) && !string.IsNullOrWhiteSpace(BotToken); - } - } + public bool IsValid => !string.IsNullOrWhiteSpace(ChatId) && !string.IsNullOrWhiteSpace(BotToken); public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Notifications/Twitter/Twitter.cs b/src/NzbDrone.Core/Notifications/Twitter/Twitter.cs index 40a0c74c0..b19c7725f 100644 --- a/src/NzbDrone.Core/Notifications/Twitter/Twitter.cs +++ b/src/NzbDrone.Core/Notifications/Twitter/Twitter.cs @@ -17,10 +17,7 @@ namespace NzbDrone.Core.Notifications.Twitter _twitterService = twitterService; } - public override string Link - { - get { return "https://twitter.com/"; } - } + public override string Link => "https://twitter.com/"; public override void OnGrab(GrabMessage message) { @@ -77,21 +74,9 @@ namespace NzbDrone.Core.Notifications.Twitter return new { }; } - public override string Name - { - get - { - return "Twitter"; - } - } + public override string Name => "Twitter"; - public override bool SupportsOnRename - { - get - { - return false; - } - } + public override bool SupportsOnRename => false; public override ValidationResult Test() { diff --git a/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs b/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs index 12f72dd91..4bfcb867c 100644 --- a/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs +++ b/src/NzbDrone.Core/Notifications/Webhook/Webhook.cs @@ -15,10 +15,7 @@ namespace NzbDrone.Core.Notifications.Webhook _service = service; } - public override string Link - { - get { return "https://github.com/Sonarr/Sonarr/wiki/Webhook"; } - } + public override string Link => "https://github.com/Sonarr/Sonarr/wiki/Webhook"; public override void OnGrab(GrabMessage message) { @@ -35,13 +32,7 @@ namespace NzbDrone.Core.Notifications.Webhook _service.OnRename(series, Settings); } - public override string Name - { - get - { - return "Webhook"; - } - } + public override string Name => "Webhook"; public override ValidationResult Test() { diff --git a/src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs b/src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs index 2712f2faa..93b58e355 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs @@ -20,10 +20,7 @@ namespace NzbDrone.Core.Notifications.Xbmc _logger = logger; } - public override string Link - { - get { return "http://xbmc.org/"; } - } + public override string Link => "http://xbmc.org/"; public override void OnGrab(GrabMessage grabMessage) { @@ -45,13 +42,7 @@ namespace NzbDrone.Core.Notifications.Xbmc UpdateAndClean(series); } - public override string Name - { - get - { - return "Kodi (XBMC)"; - } - } + public override string Name => "Kodi (XBMC)"; public override ValidationResult Test() { diff --git a/src/NzbDrone.Core/Notifications/Xbmc/XbmcSettings.cs b/src/NzbDrone.Core/Notifications/Xbmc/XbmcSettings.cs index 79d7a7749..a078e18ae 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/XbmcSettings.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/XbmcSettings.cs @@ -56,7 +56,7 @@ namespace NzbDrone.Core.Notifications.Xbmc public bool AlwaysUpdate { get; set; } [JsonIgnore] - public string Address { get { return string.Format("{0}:{1}", Host, Port); } } + public string Address => string.Format("{0}:{1}", Host, Port); public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Organizer/NamingConfig.cs b/src/NzbDrone.Core/Organizer/NamingConfig.cs index 63a8e2ec8..5de62a090 100644 --- a/src/NzbDrone.Core/Organizer/NamingConfig.cs +++ b/src/NzbDrone.Core/Organizer/NamingConfig.cs @@ -4,23 +4,17 @@ namespace NzbDrone.Core.Organizer { public class NamingConfig : ModelBase { - public static NamingConfig Default + public static NamingConfig Default => new NamingConfig { - get - { - return new NamingConfig - { - RenameEpisodes = false, - ReplaceIllegalCharacters = true, - MultiEpisodeStyle = 0, - StandardEpisodeFormat = "{Series Title} - S{season:00}E{episode:00} - {Episode Title} {Quality Full}", - DailyEpisodeFormat = "{Series Title} - {Air-Date} - {Episode Title} {Quality Full}", - AnimeEpisodeFormat = "{Series Title} - S{season:00}E{episode:00} - {Episode Title} {Quality Full}", - SeriesFolderFormat = "{Series Title}", - SeasonFolderFormat = "Season {season}" - }; - } - } + RenameEpisodes = false, + ReplaceIllegalCharacters = true, + MultiEpisodeStyle = 0, + StandardEpisodeFormat = "{Series Title} - S{season:00}E{episode:00} - {Episode Title} {Quality Full}", + DailyEpisodeFormat = "{Series Title} - {Air-Date} - {Episode Title} {Quality Full}", + AnimeEpisodeFormat = "{Series Title} - S{season:00}E{episode:00} - {Episode Title} {Quality Full}", + SeriesFolderFormat = "{Series Title}", + SeasonFolderFormat = "Season {season}" + }; public bool RenameEpisodes { get; set; } public bool ReplaceIllegalCharacters { get; set; } diff --git a/src/NzbDrone.Core/Parser/Model/LocalEpisode.cs b/src/NzbDrone.Core/Parser/Model/LocalEpisode.cs index f099c036e..62e3a75c2 100644 --- a/src/NzbDrone.Core/Parser/Model/LocalEpisode.cs +++ b/src/NzbDrone.Core/Parser/Model/LocalEpisode.cs @@ -31,13 +31,7 @@ namespace NzbDrone.Core.Parser.Model } } - public bool IsSpecial - { - get - { - return SeasonNumber == 0; - } - } + public bool IsSpecial => SeasonNumber == 0; public override string ToString() { diff --git a/src/NzbDrone.Core/Qualities/Quality.cs b/src/NzbDrone.Core/Qualities/Quality.cs index 64ea2cd56..102b87bc5 100644 --- a/src/NzbDrone.Core/Qualities/Quality.cs +++ b/src/NzbDrone.Core/Qualities/Quality.cs @@ -56,27 +56,27 @@ namespace NzbDrone.Core.Qualities return !Equals(left, right); } - public static Quality Unknown { get { return new Quality(0, "Unknown"); } } - public static Quality SDTV { get { return new Quality(1, "SDTV"); } } - public static Quality DVD { get { return new Quality(2, "DVD"); } } - public static Quality WEBDL1080p { get { return new Quality(3, "WEBDL-1080p"); } } - public static Quality HDTV720p { get { return new Quality(4, "HDTV-720p"); } } - public static Quality WEBDL720p { get { return new Quality(5, "WEBDL-720p"); } } - public static Quality Bluray720p { get { return new Quality(6, "Bluray-720p"); } } - public static Quality Bluray1080p { get { return new Quality(7, "Bluray-1080p"); } } - public static Quality WEBDL480p { get { return new Quality(8, "WEBDL-480p"); } } - public static Quality HDTV1080p { get { return new Quality(9, "HDTV-1080p"); } } - public static Quality RAWHD { get { return new Quality(10, "Raw-HD"); } } + public static Quality Unknown => new Quality(0, "Unknown"); + public static Quality SDTV => new Quality(1, "SDTV"); + public static Quality DVD => new Quality(2, "DVD"); + public static Quality WEBDL1080p => new Quality(3, "WEBDL-1080p"); + public static Quality HDTV720p => new Quality(4, "HDTV-720p"); + public static Quality WEBDL720p => new Quality(5, "WEBDL-720p"); + public static Quality Bluray720p => new Quality(6, "Bluray-720p"); + public static Quality Bluray1080p => new Quality(7, "Bluray-1080p"); + public static Quality WEBDL480p => new Quality(8, "WEBDL-480p"); + public static Quality HDTV1080p => new Quality(9, "HDTV-1080p"); + public static Quality RAWHD => new Quality(10, "Raw-HD"); //public static Quality HDTV480p { get { return new Quality(11, "HDTV-480p"); } } //public static Quality WEBRip480p { get { return new Quality(12, "WEBRip-480p"); } } //public static Quality Bluray480p { get { return new Quality(13, "Bluray-480p"); } } //public static Quality WEBRip720p { get { return new Quality(14, "WEBRip-720p"); } } //public static Quality WEBRip1080p { get { return new Quality(15, "WEBRip-1080p"); } } - public static Quality HDTV2160p { get { return new Quality(16, "HDTV-2160p"); } } + public static Quality HDTV2160p => new Quality(16, "HDTV-2160p"); //public static Quality WEBRip2160p { get { return new Quality(17, "WEBRip-2160p"); } } - public static Quality WEBDL2160p { get { return new Quality(18, "WEBDL-2160p"); } } - public static Quality Bluray2160p { get { return new Quality(19, "Bluray-2160p"); } } - + public static Quality WEBDL2160p => new Quality(18, "WEBDL-2160p"); + public static Quality Bluray2160p => new Quality(19, "Bluray-2160p"); + static Quality() { All = new List diff --git a/src/NzbDrone.Core/RemotePathMappings/RemotePathMappingRepository.cs b/src/NzbDrone.Core/RemotePathMappings/RemotePathMappingRepository.cs index 880b030c5..a7df3c35a 100644 --- a/src/NzbDrone.Core/RemotePathMappings/RemotePathMappingRepository.cs +++ b/src/NzbDrone.Core/RemotePathMappings/RemotePathMappingRepository.cs @@ -16,12 +16,6 @@ namespace NzbDrone.Core.RemotePathMappings { } - protected override bool PublishModelEvents - { - get - { - return true; - } - } + protected override bool PublishModelEvents => true; } } \ No newline at end of file diff --git a/src/NzbDrone.Core/RootFolders/RootFolderRepository.cs b/src/NzbDrone.Core/RootFolders/RootFolderRepository.cs index cca568596..6983b67fc 100644 --- a/src/NzbDrone.Core/RootFolders/RootFolderRepository.cs +++ b/src/NzbDrone.Core/RootFolders/RootFolderRepository.cs @@ -16,12 +16,6 @@ namespace NzbDrone.Core.RootFolders { } - protected override bool PublishModelEvents - { - get - { - return true; - } - } + protected override bool PublishModelEvents => true; } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Tv/Commands/RefreshSeriesCommand.cs b/src/NzbDrone.Core/Tv/Commands/RefreshSeriesCommand.cs index fbe346a26..4cae630cd 100644 --- a/src/NzbDrone.Core/Tv/Commands/RefreshSeriesCommand.cs +++ b/src/NzbDrone.Core/Tv/Commands/RefreshSeriesCommand.cs @@ -15,20 +15,8 @@ namespace NzbDrone.Core.Tv.Commands SeriesId = seriesId; } - public override bool SendUpdatesToClient - { - get - { - return true; - } - } + public override bool SendUpdatesToClient => true; - public override bool UpdateScheduledTask - { - get - { - return !SeriesId.HasValue; - } - } + public override bool UpdateScheduledTask => !SeriesId.HasValue; } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Tv/Episode.cs b/src/NzbDrone.Core/Tv/Episode.cs index fdbd22704..dcb95069e 100644 --- a/src/NzbDrone.Core/Tv/Episode.cs +++ b/src/NzbDrone.Core/Tv/Episode.cs @@ -39,10 +39,7 @@ namespace NzbDrone.Core.Tv public Series Series { get; set; } - public bool HasFile - { - get { return EpisodeFileId > 0; } - } + public bool HasFile => EpisodeFileId > 0; public override string ToString() { diff --git a/src/NzbDrone.Core/Update/Commands/ApplicationUpdateCommand.cs b/src/NzbDrone.Core/Update/Commands/ApplicationUpdateCommand.cs index aef7533c8..5911a9a13 100644 --- a/src/NzbDrone.Core/Update/Commands/ApplicationUpdateCommand.cs +++ b/src/NzbDrone.Core/Update/Commands/ApplicationUpdateCommand.cs @@ -4,20 +4,8 @@ namespace NzbDrone.Core.Update.Commands { public class ApplicationUpdateCommand : Command { - public override bool SendUpdatesToClient - { - get - { - return true; - } - } + public override bool SendUpdatesToClient => true; - public override string CompletionMessage - { - get - { - return "Restarting Sonarr to apply updates"; - } - } + public override string CompletionMessage => "Restarting Sonarr to apply updates"; } } diff --git a/src/NzbDrone.Core/Validation/NzbDroneValidationResult.cs b/src/NzbDrone.Core/Validation/NzbDroneValidationResult.cs index a0b16e860..d675fbb7a 100644 --- a/src/NzbDrone.Core/Validation/NzbDroneValidationResult.cs +++ b/src/NzbDrone.Core/Validation/NzbDroneValidationResult.cs @@ -51,17 +51,8 @@ namespace NzbDrone.Core.Validation public new IList Errors { get; private set; } public IList Warnings { get; private set; } - public virtual bool HasWarnings - { - get { return Warnings.Any(); } - } + public virtual bool HasWarnings => Warnings.Any(); - public override bool IsValid - { - get - { - return Errors.Empty(); - } - } + public override bool IsValid => Errors.Empty(); } } \ No newline at end of file diff --git a/src/NzbDrone.Host/AccessControl/UrlAcl.cs b/src/NzbDrone.Host/AccessControl/UrlAcl.cs index cfcbd855a..6ef028b91 100644 --- a/src/NzbDrone.Host/AccessControl/UrlAcl.cs +++ b/src/NzbDrone.Host/AccessControl/UrlAcl.cs @@ -9,12 +9,6 @@ namespace NzbDrone.Host.AccessControl public int Port { get; set; } public string UrlBase { get; set; } - public string Url - { - get - { - return string.Format("{0}://{1}:{2}/{3}", Scheme, Address, Port, UrlBase); - } - } + public string Url => string.Format("{0}://{1}:{2}/{3}", Scheme, Address, Port, UrlBase); } } diff --git a/src/NzbDrone.Host/Owin/MiddleWare/NancyMiddleWare.cs b/src/NzbDrone.Host/Owin/MiddleWare/NancyMiddleWare.cs index c6116a46a..89f664864 100644 --- a/src/NzbDrone.Host/Owin/MiddleWare/NancyMiddleWare.cs +++ b/src/NzbDrone.Host/Owin/MiddleWare/NancyMiddleWare.cs @@ -13,7 +13,7 @@ namespace NzbDrone.Host.Owin.MiddleWare _nancyBootstrapper = nancyBootstrapper; } - public int Order { get { return 2; } } + public int Order => 2; public void Attach(IAppBuilder appBuilder) { diff --git a/src/NzbDrone.Host/Owin/MiddleWare/NzbDroneVersionMiddleWare.cs b/src/NzbDrone.Host/Owin/MiddleWare/NzbDroneVersionMiddleWare.cs index 83c8678ec..a74d9b1d3 100644 --- a/src/NzbDrone.Host/Owin/MiddleWare/NzbDroneVersionMiddleWare.cs +++ b/src/NzbDrone.Host/Owin/MiddleWare/NzbDroneVersionMiddleWare.cs @@ -8,7 +8,7 @@ namespace NzbDrone.Host.Owin.MiddleWare { public class NzbDroneVersionMiddleWare : IOwinMiddleWare { - public int Order { get { return 0; } } + public int Order => 0; public void Attach(IAppBuilder appBuilder) { diff --git a/src/NzbDrone.Host/Owin/MiddleWare/SignalRMiddleWare.cs b/src/NzbDrone.Host/Owin/MiddleWare/SignalRMiddleWare.cs index 395ff6f2f..0df60a326 100644 --- a/src/NzbDrone.Host/Owin/MiddleWare/SignalRMiddleWare.cs +++ b/src/NzbDrone.Host/Owin/MiddleWare/SignalRMiddleWare.cs @@ -8,7 +8,7 @@ namespace NzbDrone.Host.Owin.MiddleWare { public class SignalRMiddleWare : IOwinMiddleWare { - public int Order { get { return 1; } } + public int Order => 1; public SignalRMiddleWare(IContainer container) { diff --git a/src/NzbDrone.Host/Owin/NlogTextWriter.cs b/src/NzbDrone.Host/Owin/NlogTextWriter.cs index 17c0ce8e9..2d04acf1a 100644 --- a/src/NzbDrone.Host/Owin/NlogTextWriter.cs +++ b/src/NzbDrone.Host/Owin/NlogTextWriter.cs @@ -13,13 +13,7 @@ namespace NzbDrone.Host.Owin _logger = logger; } - public override Encoding Encoding - { - get - { - return Encoding.Default; - } - } + public override Encoding Encoding => Encoding.Default; public override void Write(char[] buffer, int index, int count) { diff --git a/src/NzbDrone.Integration.Test/IntegrationTest.cs b/src/NzbDrone.Integration.Test/IntegrationTest.cs index 64efaa527..7e0e96dcd 100644 --- a/src/NzbDrone.Integration.Test/IntegrationTest.cs +++ b/src/NzbDrone.Integration.Test/IntegrationTest.cs @@ -11,20 +11,11 @@ namespace NzbDrone.Integration.Test { protected NzbDroneRunner _runner; - public override string SeriesRootFolder - { - get { return GetTempDirectory("SeriesRootFolder") ; } - } + public override string SeriesRootFolder => GetTempDirectory("SeriesRootFolder"); - protected override string RootUrl - { - get { return "http://localhost:8989/"; } - } + protected override string RootUrl => "http://localhost:8989/"; - protected override string ApiKey - { - get { return _runner.ApiKey; } - } + protected override string ApiKey => _runner.ApiKey; protected override void StartTestTarget() { diff --git a/src/NzbDrone.Integration.Test/IntegrationTestBase.cs b/src/NzbDrone.Integration.Test/IntegrationTestBase.cs index e587a9aef..4f6a78a0b 100644 --- a/src/NzbDrone.Integration.Test/IntegrationTestBase.cs +++ b/src/NzbDrone.Integration.Test/IntegrationTestBase.cs @@ -59,13 +59,7 @@ namespace NzbDrone.Integration.Test private List _signalRReceived; private Connection _signalrConnection; - protected IEnumerable SignalRMessages - { - get - { - return _signalRReceived; - } - } + protected IEnumerable SignalRMessages => _signalRReceived; public IntegrationTestBase() { diff --git a/src/NzbDrone.Mono/Disk/ProcMount.cs b/src/NzbDrone.Mono/Disk/ProcMount.cs index 586cba170..87e428112 100644 --- a/src/NzbDrone.Mono/Disk/ProcMount.cs +++ b/src/NzbDrone.Mono/Disk/ProcMount.cs @@ -20,38 +20,23 @@ namespace NzbDrone.Mono.Disk _unixDriveInfo = new UnixDriveInfo(mount); } - public long AvailableFreeSpace - { - get { return _unixDriveInfo.AvailableFreeSpace; } - } + public long AvailableFreeSpace => _unixDriveInfo.AvailableFreeSpace; public string DriveFormat { get; private set; } public DriveType DriveType { get; private set; } - public bool IsReady - { - get { return _unixDriveInfo.IsReady; } - } + public bool IsReady => _unixDriveInfo.IsReady; public string Name { get; private set; } public string RootDirectory { get; private set; } - public long TotalFreeSpace - { - get { return _unixDriveInfo.TotalFreeSpace; } - } + public long TotalFreeSpace => _unixDriveInfo.TotalFreeSpace; - public long TotalSize - { - get { return _unixDriveInfo.TotalSize; } - } + public long TotalSize => _unixDriveInfo.TotalSize; - public string VolumeLabel - { - get { return _unixDriveInfo.VolumeLabel; } - } + public string VolumeLabel => _unixDriveInfo.VolumeLabel; public string VolumeName { diff --git a/src/NzbDrone.SignalR/NzbDronePersistentConnection.cs b/src/NzbDrone.SignalR/NzbDronePersistentConnection.cs index 914c66cee..dfa063a0e 100644 --- a/src/NzbDrone.SignalR/NzbDronePersistentConnection.cs +++ b/src/NzbDrone.SignalR/NzbDronePersistentConnection.cs @@ -10,13 +10,7 @@ namespace NzbDrone.SignalR public sealed class NzbDronePersistentConnection : PersistentConnection, IBroadcastSignalRMessage { - private IPersistentConnectionContext Context - { - get - { - return ((ConnectionManager)GlobalHost.ConnectionManager).GetConnection(GetType()); - } - } + private IPersistentConnectionContext Context => ((ConnectionManager)GlobalHost.ConnectionManager).GetConnection(GetType()); public void BroadcastMessage(SignalRMessage message) { diff --git a/src/NzbDrone.Test.Common/ConcurrencyCounter.cs b/src/NzbDrone.Test.Common/ConcurrencyCounter.cs index 2cc1f08ad..03586ad60 100644 --- a/src/NzbDrone.Test.Common/ConcurrencyCounter.cs +++ b/src/NzbDrone.Test.Common/ConcurrencyCounter.cs @@ -10,7 +10,7 @@ namespace NzbDrone.Test.Common readonly object _mutex = new object(); readonly Dictionary _threads = new Dictionary(); - public int MaxThreads { get { return _threads.Count; } } + public int MaxThreads => _threads.Count; public ConcurrencyCounter(int items) { diff --git a/src/NzbDrone.Windows/EnvironmentInfo/DotNetRuntimeProvider.cs b/src/NzbDrone.Windows/EnvironmentInfo/DotNetRuntimeProvider.cs index a1d1f75ad..8e0330f1f 100644 --- a/src/NzbDrone.Windows/EnvironmentInfo/DotNetRuntimeProvider.cs +++ b/src/NzbDrone.Windows/EnvironmentInfo/DotNetRuntimeProvider.cs @@ -11,12 +11,6 @@ namespace NzbDrone.Windows.EnvironmentInfo { } - public override string RuntimeVersion - { - get - { - return Environment.Version.ToString(); - } - } + public override string RuntimeVersion => Environment.Version.ToString(); } } diff --git a/src/ServiceHelpers/ServiceInstall/ServiceHelper.cs b/src/ServiceHelpers/ServiceInstall/ServiceHelper.cs index e7715cbb8..78e881170 100644 --- a/src/ServiceHelpers/ServiceInstall/ServiceHelper.cs +++ b/src/ServiceHelpers/ServiceInstall/ServiceHelper.cs @@ -8,13 +8,7 @@ namespace ServiceInstall { public static class ServiceHelper { - private static string NzbDroneExe - { - get - { - return Path.Combine(new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName, "NzbDrone.Console.exe"); - } - } + private static string NzbDroneExe => Path.Combine(new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName, "NzbDrone.Console.exe"); private static bool IsAnAdministrator() { diff --git a/src/ServiceHelpers/ServiceUninstall/ServiceHelper.cs b/src/ServiceHelpers/ServiceUninstall/ServiceHelper.cs index fe2457794..e5fedb19e 100644 --- a/src/ServiceHelpers/ServiceUninstall/ServiceHelper.cs +++ b/src/ServiceHelpers/ServiceUninstall/ServiceHelper.cs @@ -8,13 +8,7 @@ namespace ServiceUninstall { public static class ServiceHelper { - private static string NzbDroneExe - { - get - { - return Path.Combine(new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName, "NzbDrone.Console.exe"); - } - } + private static string NzbDroneExe => Path.Combine(new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName, "NzbDrone.Console.exe"); private static bool IsAnAdministrator() {