From ccfa13e383e81fb4d93314ae010597ef311d6922 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Sat, 3 Oct 2015 19:45:26 +0200 Subject: [PATCH] Replaced built-in valuetypes with language keywords. --- .../Authentication/AuthenticationService.cs | 2 +- src/NzbDrone.Api/ClientSchema/Field.cs | 16 +-- .../ClientSchema/SchemaBuilder.cs | 10 +- src/NzbDrone.Api/Commands/CommandResource.cs | 10 +- .../Config/DownloadClientConfigModule.cs | 2 +- .../Config/DownloadClientConfigResource.cs | 14 +-- src/NzbDrone.Api/Config/HostConfigResource.cs | 32 ++--- .../Config/IndexerConfigResource.cs | 6 +- .../Config/MediaManagementConfigModule.cs | 2 +- .../Config/MediaManagementConfigResource.cs | 24 ++-- src/NzbDrone.Api/Config/NamingConfigModule.cs | 2 +- .../Config/NamingConfigResource.cs | 4 +- src/NzbDrone.Api/Config/UiConfigResource.cs | 14 +-- .../DiskSpace/DiskSpaceResource.cs | 4 +- .../DownloadClient/DownloadClientResource.cs | 2 +- .../EpisodeFiles/EpisodeFileResource.cs | 14 +-- .../Episodes/EpisodeModuleWithSignalR.cs | 2 +- src/NzbDrone.Api/Episodes/EpisodeResource.cs | 24 ++-- .../Episodes/RenameEpisodeResource.cs | 12 +- .../ErrorManagement/NzbDroneErrorPipeline.cs | 2 +- src/NzbDrone.Api/Extensions/LazyExtensions.cs | 2 +- .../Extensions/Pipelines/CorsPipeline.cs | 2 +- .../Frontend/Mappers/IndexHtmlMapper.cs | 6 +- .../Frontend/Mappers/LoginHtmlMapper.cs | 2 +- .../Frontend/StaticResourceModule.cs | 2 +- src/NzbDrone.Api/Health/HealthResource.cs | 2 +- src/NzbDrone.Api/History/HistoryModule.cs | 2 +- src/NzbDrone.Api/History/HistoryResource.cs | 2 +- src/NzbDrone.Api/Indexers/IndexerResource.cs | 8 +- src/NzbDrone.Api/Indexers/ReleaseResource.cs | 62 ++++----- src/NzbDrone.Api/Logs/LogFileModuleBase.cs | 14 +-- src/NzbDrone.Api/Logs/LogFileResource.cs | 6 +- src/NzbDrone.Api/Logs/LogResource.cs | 12 +- src/NzbDrone.Api/Logs/UpdateLogFileModule.cs | 8 +- .../Mapping/ResourceMappingException.cs | 2 +- src/NzbDrone.Api/Metadata/MetadataResource.cs | 2 +- .../Profiles/Languages/LanguageResource.cs | 6 +- .../Profiles/LegacyProfileModule.cs | 2 +- src/NzbDrone.Api/Profiles/ProfileResource.cs | 2 +- src/NzbDrone.Api/ProviderModuleBase.cs | 2 +- src/NzbDrone.Api/Queue/QueueResource.cs | 12 +- src/NzbDrone.Api/REST/RestModule.cs | 4 +- .../RemotePathMappingResource.cs | 6 +- .../Restrictions/RestrictionModule.cs | 6 +- .../Restrictions/RestrictionResource.cs | 10 +- .../RootFolders/RootFolderResource.cs | 4 +- .../Series/AlternateTitleResource.cs | 4 +- src/NzbDrone.Api/Series/SeriesResource.cs | 58 ++++----- .../System/Backup/BackupResource.cs | 4 +- src/NzbDrone.Api/System/Tasks/TaskResource.cs | 6 +- src/NzbDrone.Api/Tags/TagModule.cs | 6 +- src/NzbDrone.Api/Tags/TagResource.cs | 2 +- src/NzbDrone.Api/Update/UpdateResource.cs | 14 +-- .../Wanted/LegacyMissingModule.cs | 2 +- .../NzbDroneProcessServiceFixture.cs | 2 +- .../DirectoryLookupServiceFixture.cs | 8 +- .../DiskTests/DiskTransferServiceFixture.cs | 12 +- .../Http/HttpClientFixture.cs | 2 +- .../CleanseLogMessageFixture.cs | 2 +- .../LevenshteinDistanceFixture.cs | 4 +- src/NzbDrone.Common.Test/OsPathFixture.cs | 16 +-- src/NzbDrone.Common/ArchiveService.cs | 4 +- src/NzbDrone.Common/ConvertBase32.cs | 2 +- .../Disk/DiskTransferService.cs | 20 +-- .../Disk/FileSystemLookupService.cs | 4 +- src/NzbDrone.Common/Disk/FileSystemResult.cs | 2 +- src/NzbDrone.Common/Disk/OsPath.cs | 74 +++++------ .../EnvironmentInfo/AppFolderInfo.cs | 2 +- .../EnvironmentInfo/IRuntimeInfo.cs | 16 +-- .../Exceptron/fastJSON/JSON.cs | 2 +- .../Exceptron/fastJSON/JsonSerializer.cs | 2 +- src/NzbDrone.Common/Expansive/Expansive.cs | 4 +- .../Extensions/Int64Extensions.cs | 2 +- .../Extensions/LevenstheinExtensions.cs | 12 +- .../Extensions/PathExtensions.cs | 2 +- .../Extensions/ResourceExtensions.cs | 4 +- .../Extensions/StringExtensions.cs | 6 +- .../Extensions/TryParseExtensions.cs | 8 +- src/NzbDrone.Common/HashUtil.cs | 2 +- src/NzbDrone.Common/Http/HttpAccept.cs | 4 +- src/NzbDrone.Common/Http/HttpClient.cs | 2 +- src/NzbDrone.Common/Http/HttpProvider.cs | 2 +- src/NzbDrone.Common/Http/HttpResponse.cs | 10 +- .../Http/JsonRpcRequestBuilder.cs | 12 +- src/NzbDrone.Common/Http/JsonRpcResponse.cs | 4 +- src/NzbDrone.Common/Http/UserAgentBuilder.cs | 2 +- .../Extensions/LoggerProgressExtensions.cs | 6 +- .../Instrumentation/LogEventExtensions.cs | 4 +- src/NzbDrone.Common/PathEqualityComparer.cs | 2 +- .../Processes/ProcessOutputLine.cs | 2 +- .../Processes/ProcessProvider.cs | 8 +- .../Reflection/ReflectionExtensions.cs | 4 +- .../Serializer/IntConverter.cs | 4 +- src/NzbDrone.Common/ServiceProvider.cs | 10 +- src/NzbDrone.Common/TinyIoC.cs | 54 ++++---- .../Scene/SceneMappingServiceFixture.cs | 4 +- .../Datastore/MappingExtentionFixture.cs | 2 +- .../SqliteSchemaDumperFixture.cs | 6 +- ...AnimeVersionUpgradeSpecificationFixture.cs | 4 +- .../QualityUpgradeSpecificationFixture.cs | 2 +- ...ReleaseRestrictionsSpecificationFixture.cs | 14 +-- .../Blackhole/TorrentBlackholeFixture.cs | 8 +- .../DelugeTests/DelugeFixture.cs | 24 ++-- .../DownloadClientFixtureBase.cs | 6 +- .../NzbgetTests/NzbgetFixture.cs | 8 +- .../RTorrentTests/RTorrentFixture.cs | 6 +- .../SabnzbdTests/SabnzbdFixture.cs | 12 +- .../TransmissionTests/TransmissionFixture.cs | 24 ++-- .../UTorrentTests/UTorrentFixture.cs | 16 +-- .../PendingReleaseServiceTests/AddFixture.cs | 4 +- .../RemoveGrabbedFixture.cs | 2 +- .../RemovePendingFixture.cs | 12 +- .../RemoveRejectedFixture.cs | 4 +- .../Checks/DroneFactoryCheckFixture.cs | 2 +- .../HealthCheck/Checks/IndexerCheckFixture.cs | 2 +- .../Checks/MonoVersionCheckFixture.cs | 2 +- .../Checks/RootFolderCheckFixture.cs | 2 +- .../CleanupOrphanedBlacklistFixture.cs | 4 +- .../NzbSearchServiceFixture.cs | 6 +- .../SeriesSearchServiceFixture.cs | 10 +- .../BroadcastheNetFixture.cs | 8 +- .../KickassTorrentsFixture.cs | 2 +- .../NewznabTests/NewznabFixture.cs | 2 +- .../NewznabRequestGeneratorFixture.cs | 2 +- .../IndexerTests/TestIndexer.cs | 4 +- .../TitansOfTvTests/TitansOfTvFixture.cs | 8 +- .../TorznabTests/TorznabFixture.cs | 2 +- .../DatabaseTargetFixture.cs | 4 +- .../DownloadedEpisodesImportServiceFixture.cs | 50 ++++---- .../MoveEpisodeFileFixture.cs | 8 +- .../ImportDecisionMakerFixture.cs | 14 +-- .../EpisodeImport/SampleServiceFixture.cs | 8 +- .../FreeSpaceSpecificationFixture.cs | 10 +- .../ImportApprovedEpisodesFixture.cs | 2 +- .../MediaFileTableCleanupServiceFixture.cs | 2 +- .../UpdateMediaInfoServiceFixture.cs | 6 +- .../SkyHook/SkyHookProxyFixture.cs | 6 +- .../PlexClientServiceTest.cs | 4 +- .../Xbmc/Http/ActivePlayersFixture.cs | 2 +- .../Xbmc/Http/CheckForErrorFixture.cs | 2 +- .../Xbmc/Http/GetSeriesPathFixture.cs | 6 +- .../Xbmc/Json/UpdateFixture.cs | 2 +- .../FileNameBuilderFixture.cs | 6 +- .../OrganizerTests/GetSeasonFolderFixture.cs | 2 +- .../OrganizerTests/GetSeriesFolderFixture.cs | 2 +- .../AbsoluteEpisodeNumberParserFixture.cs | 2 +- .../ParserTests/ExtendedQualityParserRegex.cs | 4 +- .../MiniSeriesEpisodeParserFixture.cs | 2 +- .../ParserTests/NormalizeTitleFixture.cs | 8 +- .../ParserTests/ParserFixture.cs | 8 +- .../ParsingServiceTests/GetEpisodesFixture.cs | 44 +++---- .../ParsingServiceTests/MapFixture.cs | 22 ++-- .../ParserTests/QualityParserFixture.cs | 4 +- .../GetVideoFilesFixture.cs | 2 +- .../RecycleBinProviderTests/CleanupFixture.cs | 20 +-- .../DeleteDirectoryFixture.cs | 4 +- .../DeleteFileFixture.cs | 2 +- .../RecycleBinProviderTests/EmptyFixture.cs | 8 +- .../RemotePathMappingServiceFixture.cs | 10 +- .../TvTests/MoveSeriesServiceFixture.cs | 4 +- .../TvTests/RefreshEpisodeServiceFixture.cs | 36 +++--- .../TvTests/SeriesTitleNormalizerFixture.cs | 2 +- .../UpdateTests/UpdateServiceFixture.cs | 16 +-- .../Annotations/FieldDefinitionAttribute.cs | 2 +- src/NzbDrone.Core/Backup/Backup.cs | 2 +- src/NzbDrone.Core/Backup/BackupService.cs | 6 +- .../Blacklisting/BlacklistService.cs | 2 +- .../Configuration/ConfigFileProvider.cs | 6 +- .../Configuration/ConfigService.cs | 74 +++++------ .../Configuration/IConfigService.cs | 68 +++++----- .../Scene/SceneMappingService.cs | 8 +- .../DataAugmentation/Xem/XemProxy.cs | 6 +- .../DataAugmentation/Xem/XemService.cs | 2 +- .../Datastore/BasicRepository.cs | 2 +- .../Converters/BooleanIntConverter.cs | 2 +- .../Datastore/Converters/DoubleConverter.cs | 4 +- .../Datastore/Converters/EnumIntConverter.cs | 2 +- .../Datastore/Converters/GuidConverter.cs | 6 +- .../Datastore/Converters/Int32Converter.cs | 4 +- .../Datastore/Converters/OsPathConverter.cs | 10 +- .../Datastore/Extensions/MappingExtensions.cs | 2 +- .../Migration/018_remove_duplicates.cs | 14 +-- .../020_add_year_and_seasons_to_series.cs | 4 +- .../029_add_formats_to_naming_config.cs | 6 +- ...d_season_folder_format_to_naming_config.cs | 2 +- .../Migration/033_add_api_key_to_pushover.cs | 8 +- .../036_update_with_quality_converters.cs | 8 +- .../043_convert_config_to_download_clients.cs | 24 ++-- .../Migration/051_download_client_import.cs | 18 +-- .../Migration/062_convert_quality_models.cs | 10 +- .../Datastore/Migration/069_quality_proper.cs | 10 +- .../Datastore/Migration/070_delay_profile.cs | 10 +- .../Datastore/Migration/079_dedupe_tags.cs | 6 +- .../Framework/NzbDroneSqliteProcessor.cs | 10 +- .../NzbDroneSqliteProcessorFactory.cs | 2 +- .../Migration/Framework/SqliteSchemaDumper.cs | 6 +- .../Migration/Framework/SqliteSyntaxReader.cs | 22 ++-- src/NzbDrone.Core/Datastore/TableMapping.cs | 14 +-- src/NzbDrone.Core/DecisionEngine/Decision.cs | 10 +- .../DecisionEngine/DownloadDecisionMaker.cs | 4 +- src/NzbDrone.Core/DecisionEngine/Rejection.cs | 4 +- src/NzbDrone.Core/DiskSpace/DiskSpace.cs | 4 +- .../DiskSpace/DiskSpaceService.cs | 4 +- .../Download/Clients/Deluge/Deluge.cs | 10 +- .../Download/Clients/Deluge/DelugeError.cs | 4 +- .../Clients/Deluge/DelugeException.cs | 4 +- .../Download/Clients/Deluge/DelugeProxy.cs | 118 +++++++++--------- .../Download/Clients/Deluge/DelugeResponse.cs | 2 +- .../Download/Clients/Deluge/DelugeSettings.cs | 16 +-- .../Download/Clients/Deluge/DelugeTorrent.cs | 34 ++--- .../Clients/Deluge/DelugeTorrentStatus.cs | 12 +- .../Clients/Deluge/DelugeUpdateUIResult.cs | 6 +- .../Download/Clients/Nzbget/ErrorModel.cs | 8 +- .../Download/Clients/Nzbget/JsonError.cs | 2 +- .../Download/Clients/Nzbget/JsonRequest.cs | 2 +- .../Download/Clients/Nzbget/Nzbget.cs | 16 +-- .../Download/Clients/Nzbget/NzbgetCategory.cs | 10 +- .../Clients/Nzbget/NzbgetConfigItem.cs | 4 +- .../Clients/Nzbget/NzbgetHistoryItem.cs | 24 ++-- .../Clients/Nzbget/NzbgetParameter.cs | 2 +- .../Clients/Nzbget/NzbgetPostQueueItem.cs | 16 +-- .../Download/Clients/Nzbget/NzbgetProxy.cs | 20 +-- .../Clients/Nzbget/NzbgetQueueItem.cs | 28 ++--- .../Download/Clients/Nzbget/NzbgetResponse.cs | 2 +- .../Download/Clients/Nzbget/NzbgetSettings.cs | 20 +-- .../Download/Clients/Pneumatic/Pneumatic.cs | 8 +- .../Clients/Pneumatic/PneumaticSettings.cs | 4 +- .../Responses/SabnzbdCategoryResponse.cs | 4 +- .../Download/Clients/Sabnzbd/Sabnzbd.cs | 8 +- .../Clients/Sabnzbd/SabnzbdCategory.cs | 20 +-- .../Clients/Sabnzbd/SabnzbdHistoryItem.cs | 2 +- .../Clients/Sabnzbd/SabnzbdJsonError.cs | 2 +- .../Download/Clients/Sabnzbd/SabnzbdProxy.cs | 20 +-- .../Clients/Sabnzbd/SabnzbdSettings.cs | 24 ++-- .../TorrentBlackhole/TorrentBlackhole.cs | 2 +- .../TorrentBlackholeSettings.cs | 4 +- .../Clients/TorrentSeedConfiguration.cs | 2 +- .../Clients/Transmission/Transmission.cs | 18 +-- .../Transmission/TransmissionException.cs | 2 +- .../Clients/Transmission/TransmissionProxy.cs | 66 +++++----- .../Transmission/TransmissionResponse.cs | 4 +- .../Transmission/TransmissionSettings.cs | 18 +-- .../Transmission/TransmissionTorrent.cs | 20 +-- .../UsenetBlackholeSettings.cs | 4 +- .../Clients/rTorrent/RTorrentProxy.cs | 2 +- .../Download/Clients/uTorrent/UTorrent.cs | 10 +- .../Clients/uTorrent/UTorrentProxy.cs | 62 ++++----- .../Clients/uTorrent/UTorrentResponse.cs | 12 +- .../Clients/uTorrent/UTorrentSettings.cs | 14 +-- .../Clients/uTorrent/UTorrentTorrent.cs | 66 +++++----- .../Download/DownloadClientBase.cs | 4 +- .../Download/DownloadClientItem.cs | 18 +-- .../Download/DownloadClientStatus.cs | 2 +- .../Download/DownloadFailedEvent.cs | 12 +- src/NzbDrone.Core/Download/DownloadService.cs | 2 +- .../Download/EpisodeGrabbedEvent.cs | 4 +- src/NzbDrone.Core/Download/IDownloadClient.cs | 2 +- .../Download/Pending/PendingRelease.cs | 4 +- .../Pending/PendingReleaseRepository.cs | 8 +- .../Download/Pending/PendingReleaseService.cs | 2 +- .../Download/TorrentClientBase.cs | 30 ++--- .../TrackedDownloads/TrackedDownload.cs | 6 +- .../TrackedDownloadStatusMessage.cs | 10 +- .../Download/UsenetClientBase.cs | 10 +- .../Exceptions/ReleaseDownloadException.cs | 8 +- .../Exceptions/StatusCodeToExceptions.cs | 2 +- src/NzbDrone.Core/Fluent.cs | 14 +-- .../HealthCheck/Checks/RootFolderCheck.cs | 2 +- src/NzbDrone.Core/HealthCheck/HealthCheck.cs | 10 +- .../HealthCheck/IProvideHealthCheck.cs | 6 +- .../Definitions/SearchCriteriaBase.cs | 6 +- .../SpecialEpisodeSearchCriteria.cs | 2 +- .../IndexerSearch/EpisodeSearchCommand.cs | 4 +- .../IndexerSearch/NzbSearchService.cs | 2 +- src/NzbDrone.Core/Indexers/BitMeTv/BitMeTv.cs | 4 +- .../BitMeTv/BitMeTvRequestGenerator.cs | 2 +- .../Indexers/BitMeTv/BitMeTvSettings.cs | 8 +- .../BroadcastheNetRequestGenerator.cs | 26 ++-- .../BroadcastheNet/BroadcastheNetSettings.cs | 4 +- .../BroadcastheNet/BroadcastheNetTorrent.cs | 50 ++++---- .../BroadcastheNetTorrentQuery.cs | 26 ++-- .../BroadcastheNet/BroadcastheNetTorrents.cs | 4 +- .../Indexers/EzrssTorrentRssParser.cs | 20 +-- .../Indexers/Fanzub/FanzubRequestGenerator.cs | 12 +- .../Indexers/Fanzub/FanzubSettings.cs | 2 +- .../Indexers/HDBits/HDBitsRequestGenerator.cs | 2 +- src/NzbDrone.Core/Indexers/HttpIndexerBase.cs | 10 +- src/NzbDrone.Core/Indexers/IIndexer.cs | 4 +- .../Indexers/IPTorrents/IPTorrents.cs | 4 +- .../Indexers/IPTorrents/IPTorrentsSettings.cs | 2 +- src/NzbDrone.Core/Indexers/IndexerBase.cs | 4 +- .../Indexers/IndexerDefinition.cs | 10 +- src/NzbDrone.Core/Indexers/IndexerRequest.cs | 2 +- src/NzbDrone.Core/Indexers/IndexerResponse.cs | 2 +- .../KickassTorrents/KickassTorrents.cs | 2 +- .../KickassTorrentsRequestGenerator.cs | 30 ++--- .../KickassTorrentsSettings.cs | 4 +- src/NzbDrone.Core/Indexers/Newznab/Newznab.cs | 6 +- .../Indexers/Newznab/NewznabRssParser.cs | 20 +-- src/NzbDrone.Core/Indexers/Nyaa/Nyaa.cs | 2 +- .../Indexers/Nyaa/NyaaRequestGenerator.cs | 20 +-- .../Indexers/Nyaa/NyaaSettings.cs | 4 +- .../Omgwtfnzbs/OmgwtfnzbsRequestGenerator.cs | 10 +- .../Omgwtfnzbs/OmgwtfnzbsRssParser.cs | 2 +- .../Indexers/RssIndexerRequestGenerator.cs | 4 +- src/NzbDrone.Core/Indexers/RssParser.cs | 24 ++-- src/NzbDrone.Core/Indexers/RssSyncService.cs | 2 +- .../Indexers/TorrentRss/TorrentRssIndexer.cs | 4 +- .../TorrentRssIndexerRequestGenerator.cs | 2 +- .../TorrentRss/TorrentRssSettingsDetector.cs | 2 +- .../Indexers/TorrentRssParser.cs | 20 +-- .../Indexers/Torrentleech/Torrentleech.cs | 4 +- .../TorrentleechRequestGenerator.cs | 4 +- .../Torrentleech/TorrentleechSettings.cs | 4 +- src/NzbDrone.Core/Indexers/Torznab/Torznab.cs | 6 +- .../Indexers/Torznab/TorznabRssParser.cs | 12 +- .../Indexers/XElementExtensions.cs | 2 +- .../Instrumentation/DatabaseTarget.cs | 2 +- src/NzbDrone.Core/Instrumentation/Log.cs | 2 +- src/NzbDrone.Core/Jobs/ScheduledTask.cs | 4 +- .../Commands/DownloadedEpisodesScanCommand.cs | 6 +- .../MediaFiles/DiskScanService.cs | 2 +- .../DownloadedEpisodesCommandService.cs | 2 +- .../DownloadedEpisodesImportService.cs | 2 +- src/NzbDrone.Core/MediaFiles/EpisodeFile.cs | 18 +-- .../EpisodeImport/ImportDecisionMaker.cs | 4 +- .../MatchesFolderSpecification.cs | 4 +- .../MediaFiles/Events/EpisodeImportedEvent.cs | 6 +- .../MediaFiles/MediaFileExtensions.cs | 8 +- .../MediaFileTableCleanupService.cs | 4 +- .../MediaFiles/MediaInfo/MediaInfoLib.cs | 10 +- .../MediaInfo/VideoFileInfoReader.cs | 26 ++-- .../MediaFiles/RecycleBinProvider.cs | 10 +- .../MediaFiles/RenameEpisodeFilePreview.cs | 12 +- .../MediaFiles/SameFilenameException.cs | 2 +- .../TorrentInfo/TorrentFileInfoReader.cs | 4 +- .../Messaging/Commands/Command.cs | 2 +- .../Messaging/Events/EventAggregator.cs | 2 +- .../MediaBrowserMetadataSettings.cs | 2 +- .../Consumers/Roksbox/RoksboxMetadata.cs | 14 +-- .../Roksbox/RoksboxMetadataSettings.cs | 8 +- .../Metadata/Consumers/Wdtv/WdtvMetadata.cs | 14 +-- .../Consumers/Wdtv/WdtvMetadataSettings.cs | 8 +- .../Metadata/Consumers/Xbmc/XbmcMetadata.cs | 10 +- .../Consumers/Xbmc/XbmcMetadataSettings.cs | 10 +- .../Metadata/Files/ImageFileResult.cs | 4 +- .../Metadata/Files/MetadataFile.cs | 12 +- .../Metadata/Files/MetadataFileResult.cs | 4 +- src/NzbDrone.Core/Metadata/MetadataService.cs | 4 +- .../MetadataSource/SearchSeriesComparer.cs | 22 ++-- .../MetadataSource/SkyHook/SkyHookProxy.cs | 2 +- .../CustomScript/CustomScriptService.cs | 12 +- .../CustomScript/CustomScriptSettings.cs | 4 +- .../Notifications/Email/Email.cs | 4 +- .../Notifications/Email/EmailService.cs | 2 +- .../Notifications/Email/EmailSettings.cs | 14 +-- .../Notifications/GrabMessage.cs | 2 +- .../Notifications/Growl/GrowlSettings.cs | 6 +- .../MediaBrowser/MediaBrowserProxy.cs | 8 +- .../MediaBrowser/MediaBrowserService.cs | 4 +- .../MediaBrowser/MediaBrowserSettings.cs | 12 +- .../Notifications/NotificationDefinition.cs | 2 +- .../Notifications/NotificationService.cs | 10 +- .../NotifyMyAndroidSettings.cs | 6 +- .../Notifications/Plex/PlexClientService.cs | 10 +- .../Notifications/Plex/PlexClientSettings.cs | 8 +- .../Notifications/Plex/PlexError.cs | 2 +- .../Notifications/Plex/PlexHomeTheater.cs | 2 +- .../Plex/PlexHomeTheaterSettings.cs | 12 +- .../Notifications/Plex/PlexServerProxy.cs | 16 +-- .../Notifications/Plex/PlexServerSettings.cs | 12 +- .../Notifications/Plex/PlexUser.cs | 2 +- .../Notifications/Prowl/ProwlService.cs | 4 +- .../Notifications/Prowl/ProwlSettings.cs | 4 +- .../PushBullet/PushBulletProxy.cs | 4 +- .../Notifications/Pushalot/PushalotProxy.cs | 4 +- .../Pushalot/PushalotResponse.cs | 6 +- .../Pushalot/PushalotSettings.cs | 2 +- .../Pushover/PushoverSettings.cs | 8 +- .../Synology/SynologyIndexerSettings.cs | 2 +- .../Notifications/Twitter/TwitterService.cs | 4 +- .../Notifications/Webhook/WebhookSettings.cs | 2 +- .../Notifications/Xbmc/HttpApiProvider.cs | 22 ++-- .../Notifications/Xbmc/JsonApiProvider.cs | 4 +- .../Notifications/Xbmc/Model/XbmcVersion.cs | 4 +- src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs | 4 +- .../Notifications/Xbmc/XbmcJsonApiProxy.cs | 28 ++--- .../Notifications/Xbmc/XbmcService.cs | 2 +- .../Notifications/Xbmc/XbmcSettings.cs | 20 +-- .../Organizer/AbsoluteEpisodeFormat.cs | 8 +- src/NzbDrone.Core/Organizer/EpisodeFormat.cs | 4 +- .../Organizer/FileNameBuilder.cs | 86 ++++++------- .../FileNameBuilderTokenEqualityComparer.cs | 8 +- .../Organizer/FileNameSampleService.cs | 6 +- .../Organizer/FileNameValidation.cs | 6 +- src/NzbDrone.Core/Organizer/SampleResult.cs | 2 +- .../Parser/Model/LocalEpisode.cs | 6 +- .../Parser/Model/ParsedEpisodeInfo.cs | 30 ++--- .../Parser/Model/RemoteEpisode.cs | 2 +- src/NzbDrone.Core/Parser/Model/TorrentInfo.cs | 6 +- src/NzbDrone.Core/Parser/Parser.cs | 34 ++--- src/NzbDrone.Core/Parser/ParsingService.cs | 4 +- src/NzbDrone.Core/Parser/QualityParser.cs | 6 +- src/NzbDrone.Core/Parser/SceneChecker.cs | 2 +- src/NzbDrone.Core/Profiles/Profile.cs | 2 +- .../Qualities/QualitiesBelowCutoff.cs | 4 +- .../Qualities/QualityDefinitionService.cs | 4 +- src/NzbDrone.Core/Qualities/QualityModel.cs | 2 +- src/NzbDrone.Core/Qualities/Revision.cs | 6 +- src/NzbDrone.Core/Queue/Queue.cs | 12 +- .../RemotePathMappings/RemotePathMapping.cs | 6 +- .../RemotePathMappingService.cs | 8 +- src/NzbDrone.Core/Rest/RestClientFactory.cs | 4 +- src/NzbDrone.Core/Rest/RestSharpExtensions.cs | 2 +- src/NzbDrone.Core/Restrictions/Restriction.cs | 10 +- .../Restrictions/RestrictionService.cs | 16 +-- .../RootFolders/RootFolderService.cs | 6 +- .../SeriesStats/SeriesStatisticsRepository.cs | 10 +- src/NzbDrone.Core/Tags/Tag.cs | 2 +- src/NzbDrone.Core/Tags/TagService.cs | 8 +- src/NzbDrone.Core/Tv/Actor.cs | 4 +- .../Tv/Commands/MoveSeriesCommand.cs | 8 +- src/NzbDrone.Core/Tv/Episode.cs | 6 +- src/NzbDrone.Core/Tv/EpisodeRepository.cs | 8 +- src/NzbDrone.Core/Tv/EpisodeService.cs | 10 +- .../Tv/Events/SeriesDeletedEvent.cs | 4 +- .../Tv/Events/SeriesMovedEvent.cs | 4 +- src/NzbDrone.Core/Tv/MoveSeriesService.cs | 2 +- src/NzbDrone.Core/Tv/RefreshEpisodeService.cs | 2 +- src/NzbDrone.Core/Tv/Season.cs | 2 +- src/NzbDrone.Core/Tv/Series.cs | 10 +- src/NzbDrone.Core/Tv/SeriesService.cs | 2 +- src/NzbDrone.Core/Tv/SeriesTitleNormalizer.cs | 4 +- .../Update/InstallUpdateService.cs | 4 +- src/NzbDrone.Core/Update/UpdateChanges.cs | 8 +- src/NzbDrone.Core/Update/UpdatePackage.cs | 8 +- .../Update/UpdatePackageAvailable.cs | 2 +- .../Update/UpdateVerification.cs | 4 +- .../Validation/Paths/DroneFactoryValidator.cs | 2 +- src/NzbDrone.Host/AccessControl/SslAdapter.cs | 8 +- src/NzbDrone.Host/AccessControl/UrlAcl.cs | 2 +- .../AccessControl/UrlAclAdapter.cs | 12 +- src/NzbDrone.Host/MainAppContainerBuilder.cs | 2 +- .../SeriesEditorIntegrationTest.cs | 2 +- .../JsonTests/JsonFixture.cs | 4 +- src/NzbDrone.Mono/DiskProvider.cs | 4 +- src/NzbDrone.Mono/MonoRuntimeProvider.cs | 4 +- .../ExceptionVerification.cs | 6 +- src/NzbDrone.Update/UpdateApp.cs | 2 +- src/NzbDrone.Update/UpdateContainerBuilder.cs | 2 +- .../UpdateEngine/InstallUpdateService.cs | 2 +- src/NzbDrone.Update/UpdateStartupContext.cs | 6 +- src/NzbDrone.Windows/DiskProvider.cs | 2 +- src/NzbDrone/SysTray/SysTrayApp.cs | 2 +- 454 files changed, 2042 insertions(+), 2042 deletions(-) diff --git a/src/NzbDrone.Api/Authentication/AuthenticationService.cs b/src/NzbDrone.Api/Authentication/AuthenticationService.cs index 112bfdb43..beb908b11 100644 --- a/src/NzbDrone.Api/Authentication/AuthenticationService.cs +++ b/src/NzbDrone.Api/Authentication/AuthenticationService.cs @@ -22,7 +22,7 @@ public class AuthenticationService : IAuthenticationService private readonly IUserService _userService; private static readonly NzbDroneUser AnonymousUser = new NzbDroneUser { UserName = "Anonymous" }; - private static String API_KEY; + private static string API_KEY; private static AuthenticationType AUTH_METHOD; public AuthenticationService(IConfigFileProvider configFileProvider, IUserService userService) diff --git a/src/NzbDrone.Api/ClientSchema/Field.cs b/src/NzbDrone.Api/ClientSchema/Field.cs index dfab26737..b5a40d3a4 100644 --- a/src/NzbDrone.Api/ClientSchema/Field.cs +++ b/src/NzbDrone.Api/ClientSchema/Field.cs @@ -5,14 +5,14 @@ namespace NzbDrone.Api.ClientSchema { public class Field { - public Int32 Order { get; set; } - public String Name { get; set; } - public String Label { get; set; } - public String HelpText { get; set; } - public String HelpLink { get; set; } - public Object Value { get; set; } - public String Type { get; set; } - public Boolean Advanced { get; set; } + public int Order { get; set; } + public string Name { get; set; } + public string Label { get; set; } + public string HelpText { get; set; } + public string HelpLink { get; set; } + public object Value { get; set; } + public string Type { get; set; } + public bool Advanced { get; set; } public List SelectOptions { get; set; } } } \ No newline at end of file diff --git a/src/NzbDrone.Api/ClientSchema/SchemaBuilder.cs b/src/NzbDrone.Api/ClientSchema/SchemaBuilder.cs index 966492a44..b91e2cea5 100644 --- a/src/NzbDrone.Api/ClientSchema/SchemaBuilder.cs +++ b/src/NzbDrone.Api/ClientSchema/SchemaBuilder.cs @@ -77,13 +77,13 @@ public static object ReadFormSchema(List fields, Type targetType, object { var field = fields.Find(f => f.Name == propertyInfo.Name); - if (propertyInfo.PropertyType == typeof(Int32)) + if (propertyInfo.PropertyType == typeof(int)) { var value = Convert.ToInt32(field.Value); propertyInfo.SetValue(target, value, null); } - else if (propertyInfo.PropertyType == typeof(Int64)) + else if (propertyInfo.PropertyType == typeof(long)) { var value = Convert.ToInt64(field.Value); propertyInfo.SetValue(target, value, null); @@ -101,13 +101,13 @@ public static object ReadFormSchema(List fields, Type targetType, object propertyInfo.SetValue(target, value, null); } - else if (propertyInfo.PropertyType == typeof(IEnumerable)) + else if (propertyInfo.PropertyType == typeof(IEnumerable)) { - IEnumerable value; + IEnumerable value; if (field.Value.GetType() == typeof(JArray)) { - value = ((JArray)field.Value).Select(s => s.Value()); + value = ((JArray)field.Value).Select(s => s.Value()); } else diff --git a/src/NzbDrone.Api/Commands/CommandResource.cs b/src/NzbDrone.Api/Commands/CommandResource.cs index 58e939eec..6b33a0b9e 100644 --- a/src/NzbDrone.Api/Commands/CommandResource.cs +++ b/src/NzbDrone.Api/Commands/CommandResource.cs @@ -7,8 +7,8 @@ namespace NzbDrone.Api.Commands { public class CommandResource : RestResource { - public String Name { get; set; } - public String Message { get; set; } + public string Name { get; set; } + public string Message { get; set; } public Command Body { get; set; } public CommandPriority Priority { get; set; } public CommandStatus Status { get; set; } @@ -33,7 +33,7 @@ public CommandStatus State set { } } - public Boolean Manual + public bool Manual { get { @@ -66,7 +66,7 @@ public DateTime? StateChangeTime set { } } - public Boolean SendUpdatesToClient + public bool SendUpdatesToClient { get { @@ -78,7 +78,7 @@ public Boolean SendUpdatesToClient set { } } - public Boolean UpdateScheduledTask + public bool UpdateScheduledTask { get { diff --git a/src/NzbDrone.Api/Config/DownloadClientConfigModule.cs b/src/NzbDrone.Api/Config/DownloadClientConfigModule.cs index e54f6db0f..0cd0ad86a 100644 --- a/src/NzbDrone.Api/Config/DownloadClientConfigModule.cs +++ b/src/NzbDrone.Api/Config/DownloadClientConfigModule.cs @@ -19,7 +19,7 @@ public DownloadClientConfigModule(IConfigService configService, .SetValidator(rootFolderValidator) .SetValidator(mappedNetworkDriveValidator) .SetValidator(pathExistsValidator) - .When(c => !String.IsNullOrWhiteSpace(c.DownloadedEpisodesFolder)); + .When(c => !string.IsNullOrWhiteSpace(c.DownloadedEpisodesFolder)); } } } \ No newline at end of file diff --git a/src/NzbDrone.Api/Config/DownloadClientConfigResource.cs b/src/NzbDrone.Api/Config/DownloadClientConfigResource.cs index 94d039866..9326f5d62 100644 --- a/src/NzbDrone.Api/Config/DownloadClientConfigResource.cs +++ b/src/NzbDrone.Api/Config/DownloadClientConfigResource.cs @@ -5,14 +5,14 @@ namespace NzbDrone.Api.Config { public class DownloadClientConfigResource : RestResource { - public String DownloadedEpisodesFolder { get; set; } - public String DownloadClientWorkingFolders { get; set; } - public Int32 DownloadedEpisodesScanInterval { get; set; } + public string DownloadedEpisodesFolder { get; set; } + public string DownloadClientWorkingFolders { get; set; } + public int DownloadedEpisodesScanInterval { get; set; } - public Boolean EnableCompletedDownloadHandling { get; set; } - public Boolean RemoveCompletedDownloads { get; set; } + public bool EnableCompletedDownloadHandling { get; set; } + public bool RemoveCompletedDownloads { get; set; } - public Boolean AutoRedownloadFailed { get; set; } - public Boolean RemoveFailedDownloads { get; set; } + public bool AutoRedownloadFailed { get; set; } + public bool RemoveFailedDownloads { get; set; } } } diff --git a/src/NzbDrone.Api/Config/HostConfigResource.cs b/src/NzbDrone.Api/Config/HostConfigResource.cs index 3420e2d4c..247f46b15 100644 --- a/src/NzbDrone.Api/Config/HostConfigResource.cs +++ b/src/NzbDrone.Api/Config/HostConfigResource.cs @@ -7,23 +7,23 @@ namespace NzbDrone.Api.Config { public class HostConfigResource : RestResource { - public String BindAddress { get; set; } - public Int32 Port { get; set; } - public Int32 SslPort { get; set; } - public Boolean EnableSsl { get; set; } - public Boolean LaunchBrowser { get; set; } + public string BindAddress { get; set; } + public int Port { get; set; } + public int SslPort { get; set; } + public bool EnableSsl { get; set; } + public bool LaunchBrowser { get; set; } public AuthenticationType AuthenticationMethod { get; set; } - public Boolean AnalyticsEnabled { get; set; } - public String Username { get; set; } - public String Password { get; set; } - public String LogLevel { get; set; } - public String Branch { get; set; } - public String ApiKey { get; set; } - public Boolean Torrent { get; set; } - public String SslCertHash { get; set; } - public String UrlBase { get; set; } - public Boolean UpdateAutomatically { get; set; } + public bool AnalyticsEnabled { get; set; } + public string Username { get; set; } + public string Password { get; set; } + public string LogLevel { get; set; } + public string Branch { get; set; } + public string ApiKey { get; set; } + public bool Torrent { get; set; } + public string SslCertHash { get; set; } + public string UrlBase { get; set; } + public bool UpdateAutomatically { get; set; } public UpdateMechanism UpdateMechanism { get; set; } - public String UpdateScriptPath { get; set; } + public string UpdateScriptPath { get; set; } } } diff --git a/src/NzbDrone.Api/Config/IndexerConfigResource.cs b/src/NzbDrone.Api/Config/IndexerConfigResource.cs index c5581f112..e1615df30 100644 --- a/src/NzbDrone.Api/Config/IndexerConfigResource.cs +++ b/src/NzbDrone.Api/Config/IndexerConfigResource.cs @@ -5,8 +5,8 @@ namespace NzbDrone.Api.Config { public class IndexerConfigResource : RestResource { - public Int32 MinimumAge { get; set; } - public Int32 Retention { get; set; } - public Int32 RssSyncInterval { get; set; } + public int MinimumAge { get; set; } + public int Retention { get; set; } + public int RssSyncInterval { get; set; } } } diff --git a/src/NzbDrone.Api/Config/MediaManagementConfigModule.cs b/src/NzbDrone.Api/Config/MediaManagementConfigModule.cs index 2ed63fc2d..ecdf28ccb 100644 --- a/src/NzbDrone.Api/Config/MediaManagementConfigModule.cs +++ b/src/NzbDrone.Api/Config/MediaManagementConfigModule.cs @@ -12,7 +12,7 @@ public MediaManagementConfigModule(IConfigService configService, PathExistsValid { SharedValidator.RuleFor(c => c.FileChmod).NotEmpty(); SharedValidator.RuleFor(c => c.FolderChmod).NotEmpty(); - SharedValidator.RuleFor(c => c.RecycleBin).IsValidPath().SetValidator(pathExistsValidator).When(c => !String.IsNullOrWhiteSpace(c.RecycleBin)); + SharedValidator.RuleFor(c => c.RecycleBin).IsValidPath().SetValidator(pathExistsValidator).When(c => !string.IsNullOrWhiteSpace(c.RecycleBin)); } } } \ No newline at end of file diff --git a/src/NzbDrone.Api/Config/MediaManagementConfigResource.cs b/src/NzbDrone.Api/Config/MediaManagementConfigResource.cs index 75a261aa2..eefe50ea3 100644 --- a/src/NzbDrone.Api/Config/MediaManagementConfigResource.cs +++ b/src/NzbDrone.Api/Config/MediaManagementConfigResource.cs @@ -6,20 +6,20 @@ namespace NzbDrone.Api.Config { public class MediaManagementConfigResource : RestResource { - public Boolean AutoUnmonitorPreviouslyDownloadedEpisodes { get; set; } - public String RecycleBin { get; set; } - public Boolean AutoDownloadPropers { get; set; } - public Boolean CreateEmptySeriesFolders { get; set; } + public bool AutoUnmonitorPreviouslyDownloadedEpisodes { get; set; } + public string RecycleBin { get; set; } + public bool AutoDownloadPropers { get; set; } + public bool CreateEmptySeriesFolders { get; set; } public FileDateType FileDate { get; set; } - public Boolean SetPermissionsLinux { get; set; } - public String FileChmod { get; set; } - public String FolderChmod { get; set; } - public String ChownUser { get; set; } - public String ChownGroup { get; set; } + public bool SetPermissionsLinux { get; set; } + public string FileChmod { get; set; } + public string FolderChmod { get; set; } + public string ChownUser { get; set; } + public string ChownGroup { get; set; } - public Boolean SkipFreeSpaceCheckWhenImporting { get; set; } - public Boolean CopyUsingHardlinks { get; set; } - public Boolean EnableMediaInfo { get; set; } + public bool SkipFreeSpaceCheckWhenImporting { get; set; } + public bool CopyUsingHardlinks { get; set; } + public bool EnableMediaInfo { get; set; } } } diff --git a/src/NzbDrone.Api/Config/NamingConfigModule.cs b/src/NzbDrone.Api/Config/NamingConfigModule.cs index 45f95be4a..18408bf1c 100644 --- a/src/NzbDrone.Api/Config/NamingConfigModule.cs +++ b/src/NzbDrone.Api/Config/NamingConfigModule.cs @@ -57,7 +57,7 @@ private NamingConfigResource GetNamingConfig() var nameSpec = _namingConfigService.GetConfig(); var resource = nameSpec.InjectTo(); - if (String.IsNullOrWhiteSpace(resource.StandardEpisodeFormat)) + if (string.IsNullOrWhiteSpace(resource.StandardEpisodeFormat)) { return resource; } diff --git a/src/NzbDrone.Api/Config/NamingConfigResource.cs b/src/NzbDrone.Api/Config/NamingConfigResource.cs index d050b8c3f..e7f13f48a 100644 --- a/src/NzbDrone.Api/Config/NamingConfigResource.cs +++ b/src/NzbDrone.Api/Config/NamingConfigResource.cs @@ -5,8 +5,8 @@ namespace NzbDrone.Api.Config { public class NamingConfigResource : RestResource { - public Boolean RenameEpisodes { get; set; } - public Int32 MultiEpisodeStyle { get; set; } + public bool RenameEpisodes { get; set; } + public int MultiEpisodeStyle { get; set; } public string StandardEpisodeFormat { get; set; } public string DailyEpisodeFormat { get; set; } public string AnimeEpisodeFormat { get; set; } diff --git a/src/NzbDrone.Api/Config/UiConfigResource.cs b/src/NzbDrone.Api/Config/UiConfigResource.cs index cedb81884..4c4802e53 100644 --- a/src/NzbDrone.Api/Config/UiConfigResource.cs +++ b/src/NzbDrone.Api/Config/UiConfigResource.cs @@ -6,15 +6,15 @@ namespace NzbDrone.Api.Config public class UiConfigResource : RestResource { //Calendar - public Int32 FirstDayOfWeek { get; set; } - public String CalendarWeekColumnHeader { get; set; } + public int FirstDayOfWeek { get; set; } + public string CalendarWeekColumnHeader { get; set; } //Dates - public String ShortDateFormat { get; set; } - public String LongDateFormat { get; set; } - public String TimeFormat { get; set; } - public Boolean ShowRelativeDates { get; set; } + public string ShortDateFormat { get; set; } + public string LongDateFormat { get; set; } + public string TimeFormat { get; set; } + public bool ShowRelativeDates { get; set; } - public Boolean EnableColorImpairedMode { get; set; } + public bool EnableColorImpairedMode { get; set; } } } diff --git a/src/NzbDrone.Api/DiskSpace/DiskSpaceResource.cs b/src/NzbDrone.Api/DiskSpace/DiskSpaceResource.cs index 6358ed953..c23af6a0a 100644 --- a/src/NzbDrone.Api/DiskSpace/DiskSpaceResource.cs +++ b/src/NzbDrone.Api/DiskSpace/DiskSpaceResource.cs @@ -7,7 +7,7 @@ public class DiskSpaceResource : RestResource { public string Path { get; set; } public string Label { get; set; } - public Int64 FreeSpace { get; set; } - public Int64 TotalSpace { get; set; } + public long FreeSpace { get; set; } + public long TotalSpace { get; set; } } } diff --git a/src/NzbDrone.Api/DownloadClient/DownloadClientResource.cs b/src/NzbDrone.Api/DownloadClient/DownloadClientResource.cs index 69cca07fe..4765046c0 100644 --- a/src/NzbDrone.Api/DownloadClient/DownloadClientResource.cs +++ b/src/NzbDrone.Api/DownloadClient/DownloadClientResource.cs @@ -5,7 +5,7 @@ namespace NzbDrone.Api.DownloadClient { public class DownloadClientResource : ProviderResource { - public Boolean Enable { get; set; } + public bool Enable { get; set; } public DownloadProtocol Protocol { get; set; } } } \ No newline at end of file diff --git a/src/NzbDrone.Api/EpisodeFiles/EpisodeFileResource.cs b/src/NzbDrone.Api/EpisodeFiles/EpisodeFileResource.cs index 594f4f5b1..8d9e22ca2 100644 --- a/src/NzbDrone.Api/EpisodeFiles/EpisodeFileResource.cs +++ b/src/NzbDrone.Api/EpisodeFiles/EpisodeFileResource.cs @@ -6,15 +6,15 @@ namespace NzbDrone.Api.EpisodeFiles { public class EpisodeFileResource : RestResource { - public Int32 SeriesId { get; set; } - public Int32 SeasonNumber { get; set; } - public String RelativePath { get; set; } - public String Path { get; set; } - public Int64 Size { get; set; } + public int SeriesId { get; set; } + public int SeasonNumber { get; set; } + public string RelativePath { get; set; } + public string Path { get; set; } + public long Size { get; set; } public DateTime DateAdded { get; set; } - public String SceneName { get; set; } + public string SceneName { get; set; } public QualityModel Quality { get; set; } - public Boolean QualityCutoffNotMet { get; set; } + public bool QualityCutoffNotMet { get; set; } } } diff --git a/src/NzbDrone.Api/Episodes/EpisodeModuleWithSignalR.cs b/src/NzbDrone.Api/Episodes/EpisodeModuleWithSignalR.cs index 41ee3d04e..0a91ecc00 100644 --- a/src/NzbDrone.Api/Episodes/EpisodeModuleWithSignalR.cs +++ b/src/NzbDrone.Api/Episodes/EpisodeModuleWithSignalR.cs @@ -40,7 +40,7 @@ protected EpisodeModuleWithSignalR(IEpisodeService episodeService, ISeriesService seriesService, IQualityUpgradableSpecification qualityUpgradableSpecification, IBroadcastSignalRMessage signalRBroadcaster, - String resource) + string resource) : base(signalRBroadcaster, resource) { _episodeService = episodeService; diff --git a/src/NzbDrone.Api/Episodes/EpisodeResource.cs b/src/NzbDrone.Api/Episodes/EpisodeResource.cs index e294989a4..f63eb8d75 100644 --- a/src/NzbDrone.Api/Episodes/EpisodeResource.cs +++ b/src/NzbDrone.Api/Episodes/EpisodeResource.cs @@ -8,30 +8,30 @@ namespace NzbDrone.Api.Episodes { public class EpisodeResource : RestResource { - public Int32 SeriesId { get; set; } - public Int32 EpisodeFileId { get; set; } - public Int32 SeasonNumber { get; set; } - public Int32 EpisodeNumber { get; set; } - public String Title { get; set; } - public String AirDate { get; set; } + public int SeriesId { get; set; } + public int EpisodeFileId { get; set; } + public int SeasonNumber { get; set; } + public int EpisodeNumber { get; set; } + public string Title { get; set; } + public string AirDate { get; set; } public DateTime? AirDateUtc { get; set; } - public String Overview { get; set; } + public string Overview { get; set; } public EpisodeFileResource EpisodeFile { get; set; } - public Boolean HasFile { get; set; } - public Boolean Monitored { get; set; } + public bool HasFile { get; set; } + public bool Monitored { get; set; } public Nullable AbsoluteEpisodeNumber { get; set; } public Nullable SceneAbsoluteEpisodeNumber { get; set; } public Nullable SceneEpisodeNumber { get; set; } public Nullable SceneSeasonNumber { get; set; } - public Boolean UnverifiedSceneNumbering { get; set; } + public bool UnverifiedSceneNumbering { get; set; } public DateTime? EndTime { get; set; } public DateTime? GrabDate { get; set; } - public String SeriesTitle { get; set; } + public string SeriesTitle { get; set; } public SeriesResource Series { get; set; } //Hiding this so people don't think its usable (only used to set the initial state) [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] - public Boolean Grabbed { get; set; } + public bool Grabbed { get; set; } } } diff --git a/src/NzbDrone.Api/Episodes/RenameEpisodeResource.cs b/src/NzbDrone.Api/Episodes/RenameEpisodeResource.cs index bba61701b..1ffdbb674 100644 --- a/src/NzbDrone.Api/Episodes/RenameEpisodeResource.cs +++ b/src/NzbDrone.Api/Episodes/RenameEpisodeResource.cs @@ -6,11 +6,11 @@ namespace NzbDrone.Api.Episodes { public class RenameEpisodeResource : RestResource { - public Int32 SeriesId { get; set; } - public Int32 SeasonNumber { get; set; } - public List EpisodeNumbers { get; set; } - public Int32 EpisodeFileId { get; set; } - public String ExistingPath { get; set; } - public String NewPath { get; set; } + public int SeriesId { get; set; } + public int SeasonNumber { get; set; } + public List EpisodeNumbers { get; set; } + public int EpisodeFileId { get; set; } + public string ExistingPath { get; set; } + public string NewPath { get; set; } } } diff --git a/src/NzbDrone.Api/ErrorManagement/NzbDroneErrorPipeline.cs b/src/NzbDrone.Api/ErrorManagement/NzbDroneErrorPipeline.cs index c028aeec6..a3195ff4a 100644 --- a/src/NzbDrone.Api/ErrorManagement/NzbDroneErrorPipeline.cs +++ b/src/NzbDrone.Api/ErrorManagement/NzbDroneErrorPipeline.cs @@ -63,7 +63,7 @@ public Response HandleException(NancyContext context, Exception exception) }.AsResponse(HttpStatusCode.Conflict); } - var sqlErrorMessage = String.Format("[{0} {1}]", context.Request.Method, context.Request.Path); + var sqlErrorMessage = string.Format("[{0} {1}]", context.Request.Method, context.Request.Path); _logger.ErrorException(sqlErrorMessage, sqLiteException); } diff --git a/src/NzbDrone.Api/Extensions/LazyExtensions.cs b/src/NzbDrone.Api/Extensions/LazyExtensions.cs index 89228252b..b03f4ae35 100644 --- a/src/NzbDrone.Api/Extensions/LazyExtensions.cs +++ b/src/NzbDrone.Api/Extensions/LazyExtensions.cs @@ -13,7 +13,7 @@ public static class LazyExtensions { private static readonly ICached SetterCache = new Cached(); - public static IEnumerable LoadSubtype(this IEnumerable parents, Func foreignKeySelector, Func, IEnumerable> sourceChildSelector) + public static IEnumerable LoadSubtype(this IEnumerable parents, Func foreignKeySelector, Func, IEnumerable> sourceChildSelector) where TSourceChild : ModelBase, new() where TChild : RestResource, new() where TParent : RestResource diff --git a/src/NzbDrone.Api/Extensions/Pipelines/CorsPipeline.cs b/src/NzbDrone.Api/Extensions/Pipelines/CorsPipeline.cs index 252b72a85..f0a808a34 100644 --- a/src/NzbDrone.Api/Extensions/Pipelines/CorsPipeline.cs +++ b/src/NzbDrone.Api/Extensions/Pipelines/CorsPipeline.cs @@ -31,7 +31,7 @@ private static void ApplyResponseHeaders(Response response, Request request) allowedMethods = response.Headers["Allow"]; } - var requestedHeaders = String.Join(", ", request.Headers[AccessControlHeaders.RequestHeaders]); + var requestedHeaders = string.Join(", ", request.Headers[AccessControlHeaders.RequestHeaders]); response.Headers.Add(AccessControlHeaders.AllowOrigin, "*"); response.Headers.Add(AccessControlHeaders.AllowMethods, allowedMethods); diff --git a/src/NzbDrone.Api/Frontend/Mappers/IndexHtmlMapper.cs b/src/NzbDrone.Api/Frontend/Mappers/IndexHtmlMapper.cs index 87810d782..45d4a89bc 100644 --- a/src/NzbDrone.Api/Frontend/Mappers/IndexHtmlMapper.cs +++ b/src/NzbDrone.Api/Frontend/Mappers/IndexHtmlMapper.cs @@ -19,8 +19,8 @@ public class IndexHtmlMapper : StaticResourceMapperBase private readonly string _indexPath; private static readonly Regex ReplaceRegex = new Regex(@"(?:(?href|src)=\"")(?.*?(?css|js|png|ico|ics))(?:\"")(?:\s(?data-no-hash))?", RegexOptions.Compiled | RegexOptions.IgnoreCase); - private static String API_KEY; - private static String URL_BASE; + private static string API_KEY; + private static string URL_BASE; private string _generatedContent ; @@ -97,7 +97,7 @@ private string GetIndexText() url = cacheBreakProvider.AddCacheBreakerToPath(match.Groups["path"].Value); } - return String.Format("{0}=\"{1}{2}\"", match.Groups["attribute"].Value, URL_BASE, url); + return string.Format("{0}=\"{1}{2}\"", match.Groups["attribute"].Value, URL_BASE, url); }); text = text.Replace("API_ROOT", URL_BASE + "/api"); diff --git a/src/NzbDrone.Api/Frontend/Mappers/LoginHtmlMapper.cs b/src/NzbDrone.Api/Frontend/Mappers/LoginHtmlMapper.cs index 4884402ce..523e7cbe2 100644 --- a/src/NzbDrone.Api/Frontend/Mappers/LoginHtmlMapper.cs +++ b/src/NzbDrone.Api/Frontend/Mappers/LoginHtmlMapper.cs @@ -17,7 +17,7 @@ public class LoginHtmlMapper : StaticResourceMapperBase private readonly string _indexPath; private static readonly Regex ReplaceRegex = new Regex("(?<=(?:href|src|data-main)=\").*?(?=\")", RegexOptions.Compiled | RegexOptions.IgnoreCase); - private static String URL_BASE; + private static string URL_BASE; private string _generatedContent; public LoginHtmlMapper(IAppFolderInfo appFolderInfo, diff --git a/src/NzbDrone.Api/Frontend/StaticResourceModule.cs b/src/NzbDrone.Api/Frontend/StaticResourceModule.cs index e4b643e24..7ec5fe9d8 100644 --- a/src/NzbDrone.Api/Frontend/StaticResourceModule.cs +++ b/src/NzbDrone.Api/Frontend/StaticResourceModule.cs @@ -43,7 +43,7 @@ private Response Index() { var urlBase = _configFileProvider.UrlBase; - if (!String.IsNullOrEmpty(urlBase)) + if (!string.IsNullOrEmpty(urlBase)) { if (Request.Url.BasePath != urlBase) { diff --git a/src/NzbDrone.Api/Health/HealthResource.cs b/src/NzbDrone.Api/Health/HealthResource.cs index 281a55e60..96e7ec021 100644 --- a/src/NzbDrone.Api/Health/HealthResource.cs +++ b/src/NzbDrone.Api/Health/HealthResource.cs @@ -7,7 +7,7 @@ namespace NzbDrone.Api.Health public class HealthResource : RestResource { public HealthCheckResult Type { get; set; } - public String Message { get; set; } + public string Message { get; set; } public Uri WikiUrl { get; set; } } } diff --git a/src/NzbDrone.Api/History/HistoryModule.cs b/src/NzbDrone.Api/History/HistoryModule.cs index 9094a5337..9262a356c 100644 --- a/src/NzbDrone.Api/History/HistoryModule.cs +++ b/src/NzbDrone.Api/History/HistoryModule.cs @@ -71,7 +71,7 @@ private Response MarkAsFailed() { var id = (int)Request.Form.Id; _failedDownloadService.MarkAsFailed(id); - return new Object().AsResponse(); + return new object().AsResponse(); } } } \ No newline at end of file diff --git a/src/NzbDrone.Api/History/HistoryResource.cs b/src/NzbDrone.Api/History/HistoryResource.cs index 3c42e77c6..93312baed 100644 --- a/src/NzbDrone.Api/History/HistoryResource.cs +++ b/src/NzbDrone.Api/History/HistoryResource.cs @@ -15,7 +15,7 @@ public class HistoryResource : RestResource public int SeriesId { get; set; } public string SourceTitle { get; set; } public QualityModel Quality { get; set; } - public Boolean QualityCutoffNotMet { get; set; } + public bool QualityCutoffNotMet { get; set; } public DateTime Date { get; set; } public string Indexer { get; set; } public string ReleaseGroup { get; set; } diff --git a/src/NzbDrone.Api/Indexers/IndexerResource.cs b/src/NzbDrone.Api/Indexers/IndexerResource.cs index 246910765..ea24c0412 100644 --- a/src/NzbDrone.Api/Indexers/IndexerResource.cs +++ b/src/NzbDrone.Api/Indexers/IndexerResource.cs @@ -5,10 +5,10 @@ namespace NzbDrone.Api.Indexers { public class IndexerResource : ProviderResource { - public Boolean EnableRss { get; set; } - public Boolean EnableSearch { get; set; } - public Boolean SupportsRss { get; set; } - public Boolean SupportsSearch { get; set; } + public bool EnableRss { get; set; } + public bool EnableSearch { get; set; } + public bool SupportsRss { get; set; } + public bool SupportsSearch { get; set; } public DownloadProtocol Protocol { get; set; } } } \ No newline at end of file diff --git a/src/NzbDrone.Api/Indexers/ReleaseResource.cs b/src/NzbDrone.Api/Indexers/ReleaseResource.cs index 57fc39456..0e2190603 100644 --- a/src/NzbDrone.Api/Indexers/ReleaseResource.cs +++ b/src/NzbDrone.Api/Indexers/ReleaseResource.cs @@ -9,38 +9,38 @@ namespace NzbDrone.Api.Indexers { public class ReleaseResource : RestResource { - public String Guid { get; set; } + public string Guid { get; set; } public QualityModel Quality { get; set; } - public Int32 QualityWeight { get; set; } - public Int32 Age { get; set; } - public Double AgeHours { get; set; } - public Double AgeMinutes { get; set; } - public Int64 Size { get; set; } - public Int32 IndexerId { get; set; } - public String Indexer { get; set; } - public String ReleaseGroup { get; set; } - public String SubGroup { get; set; } - public String ReleaseHash { get; set; } - public String Title { get; set; } - public Boolean FullSeason { get; set; } - public Boolean SceneSource { get; set; } - public Int32 SeasonNumber { get; set; } + public int QualityWeight { get; set; } + public int Age { get; set; } + public double AgeHours { get; set; } + public double AgeMinutes { get; set; } + public long Size { get; set; } + public int IndexerId { get; set; } + public string Indexer { get; set; } + public string ReleaseGroup { get; set; } + public string SubGroup { get; set; } + public string ReleaseHash { get; set; } + public string Title { get; set; } + public bool FullSeason { get; set; } + public bool SceneSource { get; set; } + public int SeasonNumber { get; set; } public Language Language { get; set; } - public String AirDate { get; set; } - public String SeriesTitle { get; set; } + public string AirDate { get; set; } + public string SeriesTitle { get; set; } public int[] EpisodeNumbers { get; set; } public int[] AbsoluteEpisodeNumbers { get; set; } - public Boolean Approved { get; set; } - public Boolean TemporarilyRejected { get; set; } - public Boolean Rejected { get; set; } - public Int32 TvRageId { get; set; } - public IEnumerable Rejections { get; set; } + public bool Approved { get; set; } + public bool TemporarilyRejected { get; set; } + public bool Rejected { get; set; } + public int TvRageId { get; set; } + public IEnumerable Rejections { get; set; } public DateTime PublishDate { get; set; } - public String CommentUrl { get; set; } - public String DownloadUrl { get; set; } - public String InfoUrl { get; set; } - public Boolean DownloadAllowed { get; set; } - public Int32 ReleaseWeight { get; set; } + public string CommentUrl { get; set; } + public string DownloadUrl { get; set; } + public string InfoUrl { get; set; } + public bool DownloadAllowed { get; set; } + public int ReleaseWeight { get; set; } public int? Seeders { get; set; } @@ -50,9 +50,9 @@ public class ReleaseResource : RestResource //TODO: besides a test I don't think this is used... public DownloadProtocol DownloadProtocol { get; set; } - public Boolean IsDaily { get; set; } - public Boolean IsAbsoluteNumbering { get; set; } - public Boolean IsPossibleSpecialEpisode { get; set; } - public Boolean Special { get; set; } + public bool IsDaily { get; set; } + public bool IsAbsoluteNumbering { get; set; } + public bool IsPossibleSpecialEpisode { get; set; } + public bool Special { get; set; } } } \ No newline at end of file diff --git a/src/NzbDrone.Api/Logs/LogFileModuleBase.cs b/src/NzbDrone.Api/Logs/LogFileModuleBase.cs index a2deb27f4..aa1430d14 100644 --- a/src/NzbDrone.Api/Logs/LogFileModuleBase.cs +++ b/src/NzbDrone.Api/Logs/LogFileModuleBase.cs @@ -18,7 +18,7 @@ public abstract class LogFileModuleBase : NzbDroneRestModule public LogFileModuleBase(IDiskProvider diskProvider, IConfigFileProvider configFileProvider, - String route) + string route) : base("log/file" + route) { _diskProvider = diskProvider; @@ -44,15 +44,15 @@ private List GetLogFilesResponse() Id = i + 1, Filename = filename, LastWriteTime = _diskProvider.FileGetLastWrite(file), - ContentsUrl = String.Format("{0}/api/{1}/{2}", _configFileProvider.UrlBase, Resource, filename), - DownloadUrl = String.Format("{0}/{1}/{2}", _configFileProvider.UrlBase, DownloadUrlRoot, filename) + ContentsUrl = string.Format("{0}/api/{1}/{2}", _configFileProvider.UrlBase, Resource, filename), + DownloadUrl = string.Format("{0}/{1}/{2}", _configFileProvider.UrlBase, DownloadUrlRoot, filename) }); } return result.OrderByDescending(l => l.LastWriteTime).ToList(); } - private Response GetLogFileResponse(String filename) + private Response GetLogFileResponse(string filename) { var filePath = GetLogFilePath(filename); @@ -64,9 +64,9 @@ private Response GetLogFileResponse(String filename) return new TextResponse(data); } - protected abstract IEnumerable GetLogFiles(); - protected abstract String GetLogFilePath(String filename); + protected abstract IEnumerable GetLogFiles(); + protected abstract string GetLogFilePath(string filename); - protected abstract String DownloadUrlRoot { get; } + protected abstract string DownloadUrlRoot { get; } } } \ No newline at end of file diff --git a/src/NzbDrone.Api/Logs/LogFileResource.cs b/src/NzbDrone.Api/Logs/LogFileResource.cs index 8109eeb07..9f67c8af7 100644 --- a/src/NzbDrone.Api/Logs/LogFileResource.cs +++ b/src/NzbDrone.Api/Logs/LogFileResource.cs @@ -5,9 +5,9 @@ namespace NzbDrone.Api.Logs { public class LogFileResource : RestResource { - public String Filename { get; set; } + public string Filename { get; set; } public DateTime LastWriteTime { get; set; } - public String ContentsUrl { get; set; } - public String DownloadUrl { get; set; } + public string ContentsUrl { get; set; } + public string DownloadUrl { get; set; } } } diff --git a/src/NzbDrone.Api/Logs/LogResource.cs b/src/NzbDrone.Api/Logs/LogResource.cs index bb6370303..8e724dfcf 100644 --- a/src/NzbDrone.Api/Logs/LogResource.cs +++ b/src/NzbDrone.Api/Logs/LogResource.cs @@ -6,11 +6,11 @@ namespace NzbDrone.Api.Logs public class LogResource : RestResource { public DateTime Time { get; set; } - public String Exception { get; set; } - public String ExceptionType { get; set; } - public String Level { get; set; } - public String Logger { get; set; } - public String Message { get; set; } - public String Method { get; set; } + public string Exception { get; set; } + public string ExceptionType { get; set; } + public string Level { get; set; } + public string Logger { get; set; } + public string Message { get; set; } + public string Method { get; set; } } } diff --git a/src/NzbDrone.Api/Logs/UpdateLogFileModule.cs b/src/NzbDrone.Api/Logs/UpdateLogFileModule.cs index de48d12df..f5cec860e 100644 --- a/src/NzbDrone.Api/Logs/UpdateLogFileModule.cs +++ b/src/NzbDrone.Api/Logs/UpdateLogFileModule.cs @@ -24,21 +24,21 @@ public UpdateLogFileModule(IAppFolderInfo appFolderInfo, _diskProvider = diskProvider; } - protected override IEnumerable GetLogFiles() + protected override IEnumerable GetLogFiles() { - if (!_diskProvider.FolderExists(_appFolderInfo.GetUpdateLogFolder())) return Enumerable.Empty(); + if (!_diskProvider.FolderExists(_appFolderInfo.GetUpdateLogFolder())) return Enumerable.Empty(); return _diskProvider.GetFiles(_appFolderInfo.GetUpdateLogFolder(), SearchOption.TopDirectoryOnly) .Where(f => Regex.IsMatch(Path.GetFileName(f), LOGFILE_ROUTE.TrimStart('/'), RegexOptions.IgnoreCase)) .ToList(); } - protected override String GetLogFilePath(String filename) + protected override string GetLogFilePath(string filename) { return Path.Combine(_appFolderInfo.GetUpdateLogFolder(), filename); } - protected override String DownloadUrlRoot + protected override string DownloadUrlRoot { get { diff --git a/src/NzbDrone.Api/Mapping/ResourceMappingException.cs b/src/NzbDrone.Api/Mapping/ResourceMappingException.cs index 90dae5e93..70250914b 100644 --- a/src/NzbDrone.Api/Mapping/ResourceMappingException.cs +++ b/src/NzbDrone.Api/Mapping/ResourceMappingException.cs @@ -7,7 +7,7 @@ namespace NzbDrone.Api.Mapping public class ResourceMappingException : ApplicationException { public ResourceMappingException(IEnumerable error) - : base(Environment.NewLine + String.Join(Environment.NewLine, error.OrderBy(c => c))) + : base(Environment.NewLine + string.Join(Environment.NewLine, error.OrderBy(c => c))) { } diff --git a/src/NzbDrone.Api/Metadata/MetadataResource.cs b/src/NzbDrone.Api/Metadata/MetadataResource.cs index fc705ee60..3aec8056d 100644 --- a/src/NzbDrone.Api/Metadata/MetadataResource.cs +++ b/src/NzbDrone.Api/Metadata/MetadataResource.cs @@ -4,6 +4,6 @@ namespace NzbDrone.Api.Metadata { public class MetadataResource : ProviderResource { - public Boolean Enable { get; set; } + public bool Enable { get; set; } } } \ 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 e51d3f555..442e29177 100644 --- a/src/NzbDrone.Api/Profiles/Languages/LanguageResource.cs +++ b/src/NzbDrone.Api/Profiles/Languages/LanguageResource.cs @@ -7,8 +7,8 @@ namespace NzbDrone.Api.Profiles.Languages public class LanguageResource : RestResource { [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] - public Int32 Id { get; set; } - public String Name { get; set; } - public String NameLower { get { return Name.ToLowerInvariant(); } } + public int Id { get; set; } + public string Name { get; set; } + public string NameLower { get { return Name.ToLowerInvariant(); } } } } \ No newline at end of file diff --git a/src/NzbDrone.Api/Profiles/LegacyProfileModule.cs b/src/NzbDrone.Api/Profiles/LegacyProfileModule.cs index 341e930b1..14b28ba44 100644 --- a/src/NzbDrone.Api/Profiles/LegacyProfileModule.cs +++ b/src/NzbDrone.Api/Profiles/LegacyProfileModule.cs @@ -12,7 +12,7 @@ public LegacyProfileModule() Get["/"] = x => { string queryString = ConvertQueryParams(Request.Query); - var url = String.Format("/api/profile?{0}", queryString); + var url = string.Format("/api/profile?{0}", queryString); return Response.AsRedirect(url); }; diff --git a/src/NzbDrone.Api/Profiles/ProfileResource.cs b/src/NzbDrone.Api/Profiles/ProfileResource.cs index 9adb4ca70..9de11708b 100644 --- a/src/NzbDrone.Api/Profiles/ProfileResource.cs +++ b/src/NzbDrone.Api/Profiles/ProfileResource.cs @@ -8,7 +8,7 @@ namespace NzbDrone.Api.Profiles { public class ProfileResource : RestResource { - public String Name { get; set; } + public string Name { get; set; } public Quality Cutoff { get; set; } public List Items { get; set; } public Language Language { get; set; } diff --git a/src/NzbDrone.Api/ProviderModuleBase.cs b/src/NzbDrone.Api/ProviderModuleBase.cs index 0baf8fa99..ec4aeb560 100644 --- a/src/NzbDrone.Api/ProviderModuleBase.cs +++ b/src/NzbDrone.Api/ProviderModuleBase.cs @@ -137,7 +137,7 @@ private Response GetTemplates() var providerResource = new TProviderResource(); providerResource.InjectFrom(providerDefinition); providerResource.Fields = SchemaBuilder.ToSchema(providerDefinition.Settings); - providerResource.InfoLink = String.Format("https://github.com/NzbDrone/NzbDrone/wiki/Supported-{0}#{1}", + providerResource.InfoLink = string.Format("https://github.com/NzbDrone/NzbDrone/wiki/Supported-{0}#{1}", typeof(TProviderResource).Name.Replace("Resource", "s"), providerDefinition.Implementation.ToLower()); diff --git a/src/NzbDrone.Api/Queue/QueueResource.cs b/src/NzbDrone.Api/Queue/QueueResource.cs index 257108170..e9cab3a9f 100644 --- a/src/NzbDrone.Api/Queue/QueueResource.cs +++ b/src/NzbDrone.Api/Queue/QueueResource.cs @@ -14,15 +14,15 @@ public class QueueResource : RestResource public SeriesResource Series { get; set; } public EpisodeResource Episode { get; set; } public QualityModel Quality { get; set; } - public Decimal Size { get; set; } - public String Title { get; set; } - public Decimal Sizeleft { get; set; } + public decimal Size { get; set; } + public string Title { get; set; } + public decimal Sizeleft { get; set; } public TimeSpan? Timeleft { get; set; } public DateTime? EstimatedCompletionTime { get; set; } - public String Status { get; set; } - public String TrackedDownloadStatus { get; set; } + public string Status { get; set; } + public string TrackedDownloadStatus { get; set; } public List StatusMessages { get; set; } - public String DownloadId { get; set; } + public string DownloadId { get; set; } public DownloadProtocol Protocol { get; set; } } } diff --git a/src/NzbDrone.Api/REST/RestModule.cs b/src/NzbDrone.Api/REST/RestModule.cs index 893d690bd..7c6ba37a4 100644 --- a/src/NzbDrone.Api/REST/RestModule.cs +++ b/src/NzbDrone.Api/REST/RestModule.cs @@ -214,11 +214,11 @@ protected TResource ReadResourceFromRequest(bool skipValidate = false) private PagingResource ReadPagingResourceFromRequest() { int pageSize; - Int32.TryParse(Request.Query.PageSize.ToString(), out pageSize); + int.TryParse(Request.Query.PageSize.ToString(), out pageSize); if (pageSize == 0) pageSize = 10; int page; - Int32.TryParse(Request.Query.Page.ToString(), out page); + int.TryParse(Request.Query.Page.ToString(), out page); if (page == 0) page = 1; diff --git a/src/NzbDrone.Api/RemotePathMappings/RemotePathMappingResource.cs b/src/NzbDrone.Api/RemotePathMappings/RemotePathMappingResource.cs index 2ec0e8dc4..399282318 100644 --- a/src/NzbDrone.Api/RemotePathMappings/RemotePathMappingResource.cs +++ b/src/NzbDrone.Api/RemotePathMappings/RemotePathMappingResource.cs @@ -5,8 +5,8 @@ namespace NzbDrone.Api.RemotePathMappings { public class RemotePathMappingResource : RestResource { - public String Host { get; set; } - public String RemotePath { get; set; } - public String LocalPath { get; set; } + public string Host { get; set; } + public string RemotePath { get; set; } + public string LocalPath { get; set; } } } diff --git a/src/NzbDrone.Api/Restrictions/RestrictionModule.cs b/src/NzbDrone.Api/Restrictions/RestrictionModule.cs index 0dd4563be..0e9943210 100644 --- a/src/NzbDrone.Api/Restrictions/RestrictionModule.cs +++ b/src/NzbDrone.Api/Restrictions/RestrictionModule.cs @@ -33,7 +33,7 @@ public RestrictionModule(IRestrictionService restrictionService) }); } - private RestrictionResource Get(Int32 id) + private RestrictionResource Get(int id) { return _restrictionService.Get(id).InjectTo(); } @@ -43,7 +43,7 @@ private List GetAll() return ToListResource(_restrictionService.All); } - private Int32 Create(RestrictionResource resource) + private int Create(RestrictionResource resource) { return _restrictionService.Add(resource.InjectTo()).Id; } @@ -53,7 +53,7 @@ private void Update(RestrictionResource resource) _restrictionService.Update(resource.InjectTo()); } - private void Delete(Int32 id) + private void Delete(int id) { _restrictionService.Delete(id); } diff --git a/src/NzbDrone.Api/Restrictions/RestrictionResource.cs b/src/NzbDrone.Api/Restrictions/RestrictionResource.cs index 4e0f71db1..da7013fd1 100644 --- a/src/NzbDrone.Api/Restrictions/RestrictionResource.cs +++ b/src/NzbDrone.Api/Restrictions/RestrictionResource.cs @@ -6,14 +6,14 @@ namespace NzbDrone.Api.Restrictions { public class RestrictionResource : RestResource { - public String Required { get; set; } - public String Preferred { get; set; } - public String Ignored { get; set; } - public HashSet Tags { get; set; } + public string Required { get; set; } + public string Preferred { get; set; } + public string Ignored { get; set; } + public HashSet Tags { get; set; } public RestrictionResource() { - Tags = new HashSet(); + Tags = new HashSet(); } } } diff --git a/src/NzbDrone.Api/RootFolders/RootFolderResource.cs b/src/NzbDrone.Api/RootFolders/RootFolderResource.cs index 43fcbe667..4bd5ad833 100644 --- a/src/NzbDrone.Api/RootFolders/RootFolderResource.cs +++ b/src/NzbDrone.Api/RootFolders/RootFolderResource.cs @@ -7,8 +7,8 @@ namespace NzbDrone.Api.RootFolders { public class RootFolderResource : RestResource { - public String Path { get; set; } - public Int64? FreeSpace { get; set; } + public string Path { get; set; } + public long? FreeSpace { get; set; } public List UnmappedFolders { get; set; } } diff --git a/src/NzbDrone.Api/Series/AlternateTitleResource.cs b/src/NzbDrone.Api/Series/AlternateTitleResource.cs index d79df4d0c..adc58f8d1 100644 --- a/src/NzbDrone.Api/Series/AlternateTitleResource.cs +++ b/src/NzbDrone.Api/Series/AlternateTitleResource.cs @@ -4,7 +4,7 @@ namespace NzbDrone.Api.Series { public class AlternateTitleResource { - public String Title { get; set; } - public Int32 SeasonNumber { get; set; } + public string Title { get; set; } + public int SeasonNumber { get; set; } } } diff --git a/src/NzbDrone.Api/Series/SeriesResource.cs b/src/NzbDrone.Api/Series/SeriesResource.cs index 7d5037323..a68deaab2 100644 --- a/src/NzbDrone.Api/Series/SeriesResource.cs +++ b/src/NzbDrone.Api/Series/SeriesResource.cs @@ -14,11 +14,11 @@ public class SeriesResource : RestResource //Todo: We should get the entire Profile instead of ID and Name separately //View Only - public String Title { get; set; } + public string Title { get; set; } public List AlternateTitles { get; set; } - public String SortTitle { get; set; } + public string SortTitle { get; set; } - public Int32 SeasonCount + public int SeasonCount { get { @@ -28,45 +28,45 @@ public Int32 SeasonCount } } - public Int32? TotalEpisodeCount { get; set; } - public Int32? EpisodeCount { get; set; } - public Int32? EpisodeFileCount { get; set; } - public Int64? SizeOnDisk { get; set; } + public int? TotalEpisodeCount { get; set; } + public int? EpisodeCount { get; set; } + public int? EpisodeFileCount { get; set; } + public long? SizeOnDisk { get; set; } public SeriesStatusType Status { get; set; } - public String ProfileName { get; set; } - public String Overview { get; set; } + public string ProfileName { get; set; } + public string Overview { get; set; } public DateTime? NextAiring { get; set; } public DateTime? PreviousAiring { get; set; } - public String Network { get; set; } - public String AirTime { get; set; } + public string Network { get; set; } + public string AirTime { get; set; } public List Images { get; set; } - public String RemotePoster { get; set; } + public string RemotePoster { get; set; } public List Seasons { get; set; } - public Int32 Year { get; set; } + public int Year { get; set; } //View & Edit - public String Path { get; set; } - public Int32 ProfileId { get; set; } + public string Path { get; set; } + public int ProfileId { get; set; } //Editing Only - public Boolean SeasonFolder { get; set; } - public Boolean Monitored { get; set; } + public bool SeasonFolder { get; set; } + public bool Monitored { get; set; } - public Boolean UseSceneNumbering { get; set; } - public Int32 Runtime { get; set; } - public Int32 TvdbId { get; set; } - public Int32 TvRageId { get; set; } + public bool UseSceneNumbering { get; set; } + public int Runtime { get; set; } + public int TvdbId { get; set; } + public int TvRageId { get; set; } public DateTime? FirstAired { get; set; } public DateTime? LastInfoSync { get; set; } public SeriesTypes SeriesType { get; set; } - public String CleanTitle { get; set; } - public String ImdbId { get; set; } - public String TitleSlug { get; set; } - public String RootFolderPath { get; set; } - public String Certification { get; set; } - public List Genres { get; set; } - public HashSet Tags { get; set; } + public string CleanTitle { get; set; } + public string ImdbId { get; set; } + public string TitleSlug { get; set; } + public string RootFolderPath { get; set; } + public string Certification { get; set; } + public List Genres { get; set; } + public HashSet Tags { get; set; } public DateTime Added { get; set; } public AddSeriesOptions AddOptions { get; set; } public Ratings Ratings { get; set; } @@ -74,7 +74,7 @@ public Int32 SeasonCount //TODO: Add series statistics as a property of the series (instead of individual properties) //Used to support legacy consumers - public Int32 QualityProfileId + public int QualityProfileId { get { diff --git a/src/NzbDrone.Api/System/Backup/BackupResource.cs b/src/NzbDrone.Api/System/Backup/BackupResource.cs index 732eee3c0..7eac82838 100644 --- a/src/NzbDrone.Api/System/Backup/BackupResource.cs +++ b/src/NzbDrone.Api/System/Backup/BackupResource.cs @@ -6,8 +6,8 @@ namespace NzbDrone.Api.System.Backup { public class BackupResource : RestResource { - public String Name { get; set; } - public String Path { get; set; } + public string Name { get; set; } + public string Path { get; set; } public BackupType Type { get; set; } public DateTime Time { get; set; } } diff --git a/src/NzbDrone.Api/System/Tasks/TaskResource.cs b/src/NzbDrone.Api/System/Tasks/TaskResource.cs index d65b6d3b3..fda392cae 100644 --- a/src/NzbDrone.Api/System/Tasks/TaskResource.cs +++ b/src/NzbDrone.Api/System/Tasks/TaskResource.cs @@ -5,9 +5,9 @@ namespace NzbDrone.Api.System.Tasks { public class TaskResource : RestResource { - public String Name { get; set; } - public String TaskName { get; set; } - public Int32 Interval { get; set; } + public string Name { get; set; } + public string TaskName { get; set; } + public int Interval { get; set; } public DateTime LastExecution { get; set; } public DateTime NextExecution { get; set; } } diff --git a/src/NzbDrone.Api/Tags/TagModule.cs b/src/NzbDrone.Api/Tags/TagModule.cs index 82b4c8d4b..846c82b11 100644 --- a/src/NzbDrone.Api/Tags/TagModule.cs +++ b/src/NzbDrone.Api/Tags/TagModule.cs @@ -25,7 +25,7 @@ public TagModule(IBroadcastSignalRMessage signalRBroadcaster, DeleteResource = Delete; } - private TagResource Get(Int32 id) + private TagResource Get(int id) { return _tagService.GetTag(id).InjectTo(); } @@ -35,7 +35,7 @@ private List GetAll() return ToListResource(_tagService.All); } - private Int32 Create(TagResource resource) + private int Create(TagResource resource) { return _tagService.Add(resource.InjectTo()).Id; } @@ -45,7 +45,7 @@ private void Update(TagResource resource) _tagService.Update(resource.InjectTo()); } - private void Delete(Int32 id) + private void Delete(int id) { _tagService.Delete(id); } diff --git a/src/NzbDrone.Api/Tags/TagResource.cs b/src/NzbDrone.Api/Tags/TagResource.cs index 7c3f0711c..b42fd6f9a 100644 --- a/src/NzbDrone.Api/Tags/TagResource.cs +++ b/src/NzbDrone.Api/Tags/TagResource.cs @@ -5,6 +5,6 @@ namespace NzbDrone.Api.Tags { public class TagResource : RestResource { - public String Label { get; set; } + public string Label { get; set; } } } diff --git a/src/NzbDrone.Api/Update/UpdateResource.cs b/src/NzbDrone.Api/Update/UpdateResource.cs index c180f687e..7da017161 100644 --- a/src/NzbDrone.Api/Update/UpdateResource.cs +++ b/src/NzbDrone.Api/Update/UpdateResource.cs @@ -10,14 +10,14 @@ public class UpdateResource : RestResource [JsonConverter(typeof(Newtonsoft.Json.Converters.VersionConverter))] public Version Version { get; set; } - public String Branch { get; set; } + public string Branch { get; set; } public DateTime ReleaseDate { get; set; } - public String FileName { get; set; } - public String Url { get; set; } - public Boolean Installed { get; set; } - public Boolean Installable { get; set; } - public Boolean Latest { get; set; } + public string FileName { get; set; } + public string Url { get; set; } + public bool Installed { get; set; } + public bool Installable { get; set; } + public bool Latest { get; set; } public UpdateChanges Changes { get; set; } - public String Hash { get; set; } + public string Hash { get; set; } } } diff --git a/src/NzbDrone.Api/Wanted/LegacyMissingModule.cs b/src/NzbDrone.Api/Wanted/LegacyMissingModule.cs index 1fe0bb6ca..450784e9f 100644 --- a/src/NzbDrone.Api/Wanted/LegacyMissingModule.cs +++ b/src/NzbDrone.Api/Wanted/LegacyMissingModule.cs @@ -11,7 +11,7 @@ public LegacyMissingModule() : base("missing") Get["/"] = x => { string queryString = ConvertQueryParams(Request.Query); - var url = String.Format("/api/wanted/missing?{0}", queryString); + var url = string.Format("/api/wanted/missing?{0}", queryString); return Response.AsRedirect(url); }; diff --git a/src/NzbDrone.App.Test/NzbDroneProcessServiceFixture.cs b/src/NzbDrone.App.Test/NzbDroneProcessServiceFixture.cs index 63693a88f..b81d6bb08 100644 --- a/src/NzbDrone.App.Test/NzbDroneProcessServiceFixture.cs +++ b/src/NzbDrone.App.Test/NzbDroneProcessServiceFixture.cs @@ -33,7 +33,7 @@ public void Setup() public void should_continue_if_only_instance() { Mocker.GetMock() - .Setup(c => c.FindProcessByName(It.Is(f => f.Contains("NzbDrone")))) + .Setup(c => c.FindProcessByName(It.Is(f => f.Contains("NzbDrone")))) .Returns(new List { new ProcessInfo {Id = CURRENT_PROCESS_ID} diff --git a/src/NzbDrone.Common.Test/DiskTests/DirectoryLookupServiceFixture.cs b/src/NzbDrone.Common.Test/DiskTests/DirectoryLookupServiceFixture.cs index 81150a1e2..21b42c11f 100644 --- a/src/NzbDrone.Common.Test/DiskTests/DirectoryLookupServiceFixture.cs +++ b/src/NzbDrone.Common.Test/DiskTests/DirectoryLookupServiceFixture.cs @@ -20,7 +20,7 @@ public class DirectoryLookupServiceFixture : TestBase private void SetupFolders(string root) { - var folders = new List + var folders = new List { RECYCLING_BIN, "Chocolatey", @@ -47,7 +47,7 @@ public void should_not_contain_recycling_bin_for_root_of_drive() SetupFolders(root); Mocker.GetMock() - .Setup(s => s.GetDirectoryInfos(It.IsAny())) + .Setup(s => s.GetDirectoryInfos(It.IsAny())) .Returns(_folders); Subject.LookupContents(root, false).Directories.Should().NotContain(Path.Combine(root, RECYCLING_BIN)); @@ -60,7 +60,7 @@ public void should_not_contain_system_volume_information() SetupFolders(root); Mocker.GetMock() - .Setup(s => s.GetDirectoryInfos(It.IsAny())) + .Setup(s => s.GetDirectoryInfos(It.IsAny())) .Returns(_folders); Subject.LookupContents(root, false).Directories.Should().NotContain(Path.Combine(root, SYSTEM_VOLUME_INFORMATION)); @@ -73,7 +73,7 @@ public void should_not_contain_recycling_bin_or_system_volume_information_for_ro SetupFolders(root); Mocker.GetMock() - .Setup(s => s.GetDirectoryInfos(It.IsAny())) + .Setup(s => s.GetDirectoryInfos(It.IsAny())) .Returns(_folders); var result = Subject.LookupContents(root, false); diff --git a/src/NzbDrone.Common.Test/DiskTests/DiskTransferServiceFixture.cs b/src/NzbDrone.Common.Test/DiskTests/DiskTransferServiceFixture.cs index 669449e44..3b51dd97a 100644 --- a/src/NzbDrone.Common.Test/DiskTests/DiskTransferServiceFixture.cs +++ b/src/NzbDrone.Common.Test/DiskTests/DiskTransferServiceFixture.cs @@ -14,10 +14,10 @@ namespace NzbDrone.Common.Test.DiskTests [TestFixture] public class DiskTransferServiceFixture : TestBase { - private readonly String _sourcePath = @"C:\source\my.video.mkv".AsOsAgnostic(); - private readonly String _targetPath = @"C:\target\my.video.mkv".AsOsAgnostic(); - private readonly String _backupPath = @"C:\source\my.video.mkv.backup~".AsOsAgnostic(); - private readonly String _tempTargetPath = @"C:\target\my.video.mkv.partial~".AsOsAgnostic(); + private readonly string _sourcePath = @"C:\source\my.video.mkv".AsOsAgnostic(); + private readonly string _targetPath = @"C:\target\my.video.mkv".AsOsAgnostic(); + private readonly string _backupPath = @"C:\source\my.video.mkv.backup~".AsOsAgnostic(); + private readonly string _tempTargetPath = @"C:\target\my.video.mkv.partial~".AsOsAgnostic(); [SetUp] public void SetUp() @@ -669,7 +669,7 @@ private void WithSuccessfulHardlink(string source, string target) private void WithFailedHardlink() { Mocker.GetMock() - .Setup(v => v.TryCreateHardLink(It.IsAny(), It.IsAny())) + .Setup(v => v.TryCreateHardLink(It.IsAny(), It.IsAny())) .Returns(false); } @@ -771,7 +771,7 @@ private void VerifyMoveFolder(string source, string from, string destination) CollectionAssert.AreEquivalent(sourceFiles, destFiles); } - private void VerifyDeletedFile(String filePath) + private void VerifyDeletedFile(string filePath) { var path = filePath; diff --git a/src/NzbDrone.Common.Test/Http/HttpClientFixture.cs b/src/NzbDrone.Common.Test/Http/HttpClientFixture.cs index ee07d7e57..517392055 100644 --- a/src/NzbDrone.Common.Test/Http/HttpClientFixture.cs +++ b/src/NzbDrone.Common.Test/Http/HttpClientFixture.cs @@ -121,7 +121,7 @@ public void should_send_user_agent() } [TestCase("Accept", "text/xml, text/rss+xml, application/rss+xml")] - public void should_send_headers(String header, String value) + public void should_send_headers(string header, string value) { var request = new HttpRequest("http://eu.httpbin.org/get"); request.Headers.Add(header, value); diff --git a/src/NzbDrone.Common.Test/InstrumentationTests/CleanseLogMessageFixture.cs b/src/NzbDrone.Common.Test/InstrumentationTests/CleanseLogMessageFixture.cs index 167f14776..04a405b4c 100644 --- a/src/NzbDrone.Common.Test/InstrumentationTests/CleanseLogMessageFixture.cs +++ b/src/NzbDrone.Common.Test/InstrumentationTests/CleanseLogMessageFixture.cs @@ -39,7 +39,7 @@ public class CleanseLogMessageFixture // BroadcastheNet [TestCase(@"method: ""getTorrents"", ""params"": [ ""mySecret"",")] [TestCase(@"""DownloadURL"":""https:\/\/broadcasthe.net\/torrents.php?action=download&id=123&authkey=mySecret&torrent_pass=mySecret""")] - public void should_clean_message(String message) + public void should_clean_message(string message) { var cleansedMessage = CleanseLogMessage.Cleanse(message); diff --git a/src/NzbDrone.Common.Test/LevenshteinDistanceFixture.cs b/src/NzbDrone.Common.Test/LevenshteinDistanceFixture.cs index a052b016b..d8b489f8b 100644 --- a/src/NzbDrone.Common.Test/LevenshteinDistanceFixture.cs +++ b/src/NzbDrone.Common.Test/LevenshteinDistanceFixture.cs @@ -21,7 +21,7 @@ public class LevenshteinDistanceFixture : TestBase [TestCase("Agents of cracked", "Agents of shield", 6)] [TestCase("ABCxxx", "ABC1xx", 1)] [TestCase("ABC1xx", "ABCxxx", 1)] - public void LevenshteinDistance(String text, String other, Int32 expected) + public void LevenshteinDistance(string text, string other, int expected) { text.LevenshteinDistance(other).Should().Be(expected); } @@ -39,7 +39,7 @@ public void LevenshteinDistance(String text, String other, Int32 expected) [TestCase("Agents of shield", "the shield", 24)] [TestCase("ABCxxx", "ABC1xx", 3)] [TestCase("ABC1xx", "ABCxxx", 3)] - public void LevenshteinDistanceClean(String text, String other, Int32 expected) + public void LevenshteinDistanceClean(string text, string other, int expected) { text.ToLower().LevenshteinDistanceClean(other.ToLower()).Should().Be(expected); } diff --git a/src/NzbDrone.Common.Test/OsPathFixture.cs b/src/NzbDrone.Common.Test/OsPathFixture.cs index 68b0bdb62..ff7a83989 100644 --- a/src/NzbDrone.Common.Test/OsPathFixture.cs +++ b/src/NzbDrone.Common.Test/OsPathFixture.cs @@ -24,7 +24,7 @@ public class OsPathFixture : TestBase [TestCase("/rooted/linux/path", OsPathKind.Unix)] [TestCase("/", OsPathKind.Unix)] [TestCase("linux/path", OsPathKind.Unix)] - public void should_auto_detect_kind(String path, OsPathKind kind) + public void should_auto_detect_kind(string path, OsPathKind kind) { var result = new OsPath(path); @@ -62,7 +62,7 @@ public void should_add_directory_slash() [TestCase("/rooted/linux/path", "/rooted/linux/")] [TestCase("/rooted", "/")] [TestCase("/", null)] - public void should_return_parent_directory(String path, String expectedParent) + public void should_return_parent_directory(string path, string expectedParent) { var osPath = new OsPath(path); @@ -83,7 +83,7 @@ public void should_return_empty_as_parent_of_root_unc() [TestCase(@"\\blaat")] [TestCase("/rooted/linux/path")] [TestCase("/")] - public void should_detect_rooted_ospaths(String path) + public void should_detect_rooted_ospaths(string path) { var osPath = new OsPath(path); @@ -94,7 +94,7 @@ public void should_detect_rooted_ospaths(String path) [TestCase(@"rooted\windows\path")] [TestCase(@"path")] [TestCase("linux/path")] - public void should_detect_unrooted_ospaths(String path) + public void should_detect_unrooted_ospaths(string path) { var osPath = new OsPath(path); @@ -110,7 +110,7 @@ public void should_detect_unrooted_ospaths(String path) [TestCase(@"rooted\windows\path", "path")] [TestCase(@"path", "path")] [TestCase("linux/path", "path")] - public void should_return_filename(String path, String expectedFilePath) + public void should_return_filename(string path, string expectedFilePath) { var osPath = new OsPath(path); @@ -154,7 +154,7 @@ public void should_not_ignore_trailing_slash_during_compare() [TestCase(@"/Test/", @"sub/test/", @"/Test/sub/test/")] [TestCase(@"/Test/", @"/Test2/", @"/Test2/")] [TestCase(@"C:\Test", "", @"C:\Test")] - public void should_combine_path(String left, String right, String expectedResult) + public void should_combine_path(string left, string right, string expectedResult) { var osPathLeft = new OsPath(left); var osPathRight = new OsPath(right); @@ -197,7 +197,7 @@ public void should_combine_mixed_slashes() [TestCase(@"C:\Test\Data\", @"C:\Test\Data\Sub\Folder", @"Sub\Folder")] [TestCase(@"C:\Test\Data\", @"C:\Test\Data2\Sub\Folder", @"..\Data2\Sub\Folder")] [TestCase(@"/parent/folder", @"/parent/folder/Sub/Folder", @"Sub/Folder")] - public void should_create_relative_path(String parent, String child, String expected) + public void should_create_relative_path(string parent, string child, string expected) { var left = new OsPath(child); var right = new OsPath(parent); @@ -220,7 +220,7 @@ public void should_parse_null_as_empty() [TestCase(@"C:\Test\", @"C:\Test", true)] [TestCase(@"C:\Test\", @"C:\Test\Contains\", true)] [TestCase(@"C:\Test\", @"C:\Other\", false)] - public void should_evaluate_contains(String parent, String child, Boolean expectedResult) + public void should_evaluate_contains(string parent, string child, bool expectedResult) { var left = new OsPath(parent); var right = new OsPath(child); diff --git a/src/NzbDrone.Common/ArchiveService.cs b/src/NzbDrone.Common/ArchiveService.cs index a5716348d..c9869a638 100644 --- a/src/NzbDrone.Common/ArchiveService.cs +++ b/src/NzbDrone.Common/ArchiveService.cs @@ -75,7 +75,7 @@ private void ExtractZip(string compressedFile, string destination) { continue; // Ignore directories } - String entryFileName = zipEntry.Name; + string entryFileName = zipEntry.Name; // to remove the folder from the entry:- entryFileName = Path.GetFileName(entryFileName); // Optionally match entrynames against a selection list here to skip as desired. // The unpacked length is available in the zipEntry.Size property. @@ -84,7 +84,7 @@ private void ExtractZip(string compressedFile, string destination) Stream zipStream = zipFile.GetInputStream(zipEntry); // Manipulate the output filename here as desired. - String fullZipToPath = Path.Combine(destination, entryFileName); + string fullZipToPath = Path.Combine(destination, entryFileName); string directoryName = Path.GetDirectoryName(fullZipToPath); if (directoryName.Length > 0) Directory.CreateDirectory(directoryName); diff --git a/src/NzbDrone.Common/ConvertBase32.cs b/src/NzbDrone.Common/ConvertBase32.cs index 292f2bef3..c1fefd51b 100644 --- a/src/NzbDrone.Common/ConvertBase32.cs +++ b/src/NzbDrone.Common/ConvertBase32.cs @@ -9,7 +9,7 @@ public static class ConvertBase32 public static byte[] FromBase32String(string str) { int numBytes = str.Length * 5 / 8; - byte[] bytes = new Byte[numBytes]; + byte[] bytes = new byte[numBytes]; // all UPPERCASE chars str = str.ToUpper(); diff --git a/src/NzbDrone.Common/Disk/DiskTransferService.cs b/src/NzbDrone.Common/Disk/DiskTransferService.cs index 80647d61f..0a2e20218 100644 --- a/src/NzbDrone.Common/Disk/DiskTransferService.cs +++ b/src/NzbDrone.Common/Disk/DiskTransferService.cs @@ -13,8 +13,8 @@ namespace NzbDrone.Common.Disk { public interface IDiskTransferService { - TransferMode TransferFolder(String sourcePath, String targetPath, TransferMode mode, bool verified = true); - TransferMode TransferFile(String sourcePath, String targetPath, TransferMode mode, bool overwrite = false, bool verified = true); + TransferMode TransferFolder(string sourcePath, string targetPath, TransferMode mode, bool verified = true); + TransferMode TransferFile(string sourcePath, string targetPath, TransferMode mode, bool overwrite = false, bool verified = true); } public enum DiskTransferVerificationMode @@ -26,7 +26,7 @@ public enum DiskTransferVerificationMode public class DiskTransferService : IDiskTransferService { - private const Int32 RetryCount = 2; + private const int RetryCount = 2; private readonly IDiskProvider _diskProvider; private readonly Logger _logger; @@ -43,7 +43,7 @@ public DiskTransferService(IDiskProvider diskProvider, Logger logger) VerificationMode = OsInfo.IsWindows ? DiskTransferVerificationMode.VerifyOnly : DiskTransferVerificationMode.Transactional; } - public TransferMode TransferFolder(String sourcePath, String targetPath, TransferMode mode, bool verified = true) + public TransferMode TransferFolder(string sourcePath, string targetPath, TransferMode mode, bool verified = true) { Ensure.That(sourcePath, () => sourcePath).IsValidPath(); Ensure.That(targetPath, () => targetPath).IsValidPath(); @@ -80,7 +80,7 @@ public TransferMode TransferFolder(String sourcePath, String targetPath, Transfe return result; } - public TransferMode TransferFile(String sourcePath, String targetPath, TransferMode mode, bool overwrite = false, bool verified = true) + public TransferMode TransferFile(string sourcePath, string targetPath, TransferMode mode, bool overwrite = false, bool verified = true) { Ensure.That(sourcePath, () => sourcePath).IsValidPath(); Ensure.That(targetPath, () => targetPath).IsValidPath(); @@ -165,7 +165,7 @@ public TransferMode TransferFile(String sourcePath, String targetPath, TransferM } } - throw new IOException(String.Format("Failed to completely transfer [{0}] to [{1}], aborting.", sourcePath, targetPath)); + throw new IOException(string.Format("Failed to completely transfer [{0}] to [{1}], aborting.", sourcePath, targetPath)); } else if (VerificationMode == DiskTransferVerificationMode.VerifyOnly) { @@ -231,7 +231,7 @@ public TransferMode TransferFile(String sourcePath, String targetPath, TransferM return TransferMode.None; } - private void ClearTargetPath(String targetPath, bool overwrite) + private void ClearTargetPath(string targetPath, bool overwrite) { if (_diskProvider.FileExists(targetPath)) { @@ -310,7 +310,7 @@ private void WaitForIO() Thread.Sleep(3000); } - private Boolean TryCopyFile(String sourcePath, String targetPath) + private bool TryCopyFile(string sourcePath, string targetPath) { var originalSize = _diskProvider.GetFileSize(sourcePath); @@ -361,7 +361,7 @@ private Boolean TryCopyFile(String sourcePath, String targetPath) return false; } - private Boolean TryMoveFile(String sourcePath, String targetPath) + private bool TryMoveFile(string sourcePath, string targetPath) { var originalSize = _diskProvider.GetFileSize(sourcePath); @@ -396,7 +396,7 @@ private Boolean TryMoveFile(String sourcePath, String targetPath) _diskProvider.MoveFile(tempTargetPath, targetPath); if (_diskProvider.FileExists(tempTargetPath)) { - throw new IOException(String.Format("Temporary file '{0}' still exists, aborting.", tempTargetPath)); + throw new IOException(string.Format("Temporary file '{0}' still exists, aborting.", tempTargetPath)); } _logger.Trace("Hardlink move succeeded, deleting source."); _diskProvider.DeleteFile(sourcePath); diff --git a/src/NzbDrone.Common/Disk/FileSystemLookupService.cs b/src/NzbDrone.Common/Disk/FileSystemLookupService.cs index d5466f803..c3470f212 100644 --- a/src/NzbDrone.Common/Disk/FileSystemLookupService.cs +++ b/src/NzbDrone.Common/Disk/FileSystemLookupService.cs @@ -165,7 +165,7 @@ private string GetVolumeName(DriveInfo driveInfo) return driveInfo.Name; } - return String.Format("{0} ({1})", driveInfo.Name, driveInfo.VolumeLabel); + return string.Format("{0} ({1})", driveInfo.Name, driveInfo.VolumeLabel); } private string GetParent(string path) @@ -186,7 +186,7 @@ private string GetParent(string path) if (!path.Equals("/")) { - return String.Empty; + return string.Empty; } return null; diff --git a/src/NzbDrone.Common/Disk/FileSystemResult.cs b/src/NzbDrone.Common/Disk/FileSystemResult.cs index 10f5cac74..aed5ded10 100644 --- a/src/NzbDrone.Common/Disk/FileSystemResult.cs +++ b/src/NzbDrone.Common/Disk/FileSystemResult.cs @@ -5,7 +5,7 @@ namespace NzbDrone.Common.Disk { public class FileSystemResult { - public String Parent { get; set; } + public string Parent { get; set; } public List Directories { get; set; } public List Files { get; set; } diff --git a/src/NzbDrone.Common/Disk/OsPath.cs b/src/NzbDrone.Common/Disk/OsPath.cs index bac9d03ed..5071c5ebe 100644 --- a/src/NzbDrone.Common/Disk/OsPath.cs +++ b/src/NzbDrone.Common/Disk/OsPath.cs @@ -7,15 +7,15 @@ namespace NzbDrone.Common.Disk { public struct OsPath : IEquatable { - private readonly String _path; + private readonly string _path; private readonly OsPathKind _kind; - public OsPath(String path) + public OsPath(string path) { if (path == null) { _kind = OsPathKind.Unknown; - _path = String.Empty; + _path = string.Empty; } else { @@ -24,12 +24,12 @@ public OsPath(String path) } } - public OsPath(String path, OsPathKind kind) + public OsPath(string path, OsPathKind kind) { if (path == null) { _kind = kind; - _path = String.Empty; + _path = string.Empty; } else { @@ -38,7 +38,7 @@ public OsPath(String path, OsPathKind kind) } } - private static OsPathKind DetectPathKind(String path) + private static OsPathKind DetectPathKind(string path) { if (path.StartsWith("/")) { @@ -55,7 +55,7 @@ private static OsPathKind DetectPathKind(String path) return OsPathKind.Unknown; } - private static String FixSlashes(String path, OsPathKind kind) + private static string FixSlashes(string path, OsPathKind kind) { switch (kind) { @@ -73,17 +73,17 @@ public OsPathKind Kind get { return _kind; } } - public Boolean IsWindowsPath + public bool IsWindowsPath { get { return _kind == OsPathKind.Windows; } } - public Boolean IsUnixPath + public bool IsUnixPath { get { return _kind == OsPathKind.Unix; } } - public Boolean IsEmpty + public bool IsEmpty { get { @@ -91,7 +91,7 @@ public Boolean IsEmpty } } - public Boolean IsRooted + public bool IsRooted { get { @@ -123,7 +123,7 @@ public OsPath Directory } } - public String FullPath + public string FullPath { get { @@ -131,7 +131,7 @@ public String FullPath } } - public String FileName + public string FileName { get { @@ -153,7 +153,7 @@ public String FileName } } - private Int32 GetFileNameIndex() + private int GetFileNameIndex() { if (_path.Length < 2) { @@ -180,30 +180,30 @@ private Int32 GetFileNameIndex() return index; } - private String[] GetFragments() + private string[] GetFragments() { return _path.Split(new char[] { '\\', '/' }, StringSplitOptions.RemoveEmptyEntries); } - public override String ToString() + public override string ToString() { return _path; } - public override Int32 GetHashCode() + public override int GetHashCode() { return _path.ToLowerInvariant().GetHashCode(); } - public override Boolean Equals(Object obj) + public override bool Equals(object obj) { if (obj is OsPath) { return Equals((OsPath)obj); } - if (obj is String) + if (obj is string) { - return Equals(new OsPath(obj as String)); + return Equals(new OsPath(obj as string)); } return false; } @@ -225,7 +225,7 @@ public OsPath AsDirectory() return this; } - public Boolean Contains(OsPath other) + public bool Contains(OsPath other) { if (!IsRooted || !other.IsRooted) { @@ -244,7 +244,7 @@ public Boolean Contains(OsPath other) for (int i = 0; i < leftFragments.Length; i++) { - if (!String.Equals(leftFragments[i], rightFragments[i], stringComparison)) + if (!string.Equals(leftFragments[i], rightFragments[i], stringComparison)) { return false; } @@ -253,7 +253,7 @@ public Boolean Contains(OsPath other) return true; } - public Boolean Equals(OsPath other) + public bool Equals(OsPath other) { if (ReferenceEquals(other, null)) return false; @@ -267,19 +267,19 @@ public Boolean Equals(OsPath other) if (Kind == OsPathKind.Windows || other.Kind == OsPathKind.Windows) { - return String.Equals(left, right, StringComparison.InvariantCultureIgnoreCase); + return string.Equals(left, right, StringComparison.InvariantCultureIgnoreCase); } - return String.Equals(left, right, StringComparison.InvariantCulture); + return string.Equals(left, right, StringComparison.InvariantCulture); } - public static Boolean operator ==(OsPath left, OsPath right) + public static bool operator ==(OsPath left, OsPath right) { if (ReferenceEquals(left, null)) return ReferenceEquals(right, null); return left.Equals(right); } - public static Boolean operator !=(OsPath left, OsPath right) + public static bool operator !=(OsPath left, OsPath right) { if (ReferenceEquals(left, null)) return !ReferenceEquals(right, null); @@ -290,7 +290,7 @@ public Boolean Equals(OsPath other) { if (left.Kind != right.Kind && right.Kind != OsPathKind.Unknown) { - throw new Exception(String.Format("Cannot combine OsPaths of different platforms ('{0}' + '{1}')", left, right)); + throw new Exception(string.Format("Cannot combine OsPaths of different platforms ('{0}' + '{1}')", left, right)); } if (right.IsEmpty) @@ -305,16 +305,16 @@ public Boolean Equals(OsPath other) if (left.Kind == OsPathKind.Windows || right.Kind == OsPathKind.Windows) { - return new OsPath(String.Join("\\", left._path.TrimEnd('\\'), right._path.TrimStart('\\')), OsPathKind.Windows); + return new OsPath(string.Join("\\", left._path.TrimEnd('\\'), right._path.TrimStart('\\')), OsPathKind.Windows); } if (left.Kind == OsPathKind.Unix || right.Kind == OsPathKind.Unix) { - return new OsPath(String.Join("/", left._path.TrimEnd('/'), right._path), OsPathKind.Unix); + return new OsPath(string.Join("/", left._path.TrimEnd('/'), right._path), OsPathKind.Unix); } - return new OsPath(String.Join("/", left._path, right._path), OsPathKind.Unknown); + return new OsPath(string.Join("/", left._path, right._path), OsPathKind.Unknown); } - public static OsPath operator +(OsPath left, String right) + public static OsPath operator +(OsPath left, string right) { return left + new OsPath(right); } @@ -334,7 +334,7 @@ public Boolean Equals(OsPath other) int i; for (i = 0; i < leftFragments.Length && i < rightFragments.Length; i++) { - if (!String.Equals(leftFragments[i], rightFragments[i], stringComparison)) + if (!string.Equals(leftFragments[i], rightFragments[i], stringComparison)) { break; } @@ -345,7 +345,7 @@ public Boolean Equals(OsPath other) return right; } - var newFragments = new List(); + var newFragments = new List(); for (int j = i; j < rightFragments.Length; j++) { @@ -359,14 +359,14 @@ public Boolean Equals(OsPath other) if (left.FullPath.EndsWith("\\") || left.FullPath.EndsWith("/")) { - newFragments.Add(String.Empty); + newFragments.Add(string.Empty); } if (left.Kind == OsPathKind.Windows || right.Kind == OsPathKind.Windows) { - return new OsPath(String.Join("\\", newFragments), OsPathKind.Unknown); + return new OsPath(string.Join("\\", newFragments), OsPathKind.Unknown); } - return new OsPath(String.Join("/", newFragments), OsPathKind.Unknown); + return new OsPath(string.Join("/", newFragments), OsPathKind.Unknown); } } diff --git a/src/NzbDrone.Common/EnvironmentInfo/AppFolderInfo.cs b/src/NzbDrone.Common/EnvironmentInfo/AppFolderInfo.cs index ef1690830..75b75093e 100644 --- a/src/NzbDrone.Common/EnvironmentInfo/AppFolderInfo.cs +++ b/src/NzbDrone.Common/EnvironmentInfo/AppFolderInfo.cs @@ -45,6 +45,6 @@ public AppFolderInfo(IStartupContext startupContext) public string StartUpFolder { get; private set; } - public String TempFolder { get; private set; } + public string TempFolder { get; private set; } } } \ No newline at end of file diff --git a/src/NzbDrone.Common/EnvironmentInfo/IRuntimeInfo.cs b/src/NzbDrone.Common/EnvironmentInfo/IRuntimeInfo.cs index fbcc600d4..f173bd7e7 100644 --- a/src/NzbDrone.Common/EnvironmentInfo/IRuntimeInfo.cs +++ b/src/NzbDrone.Common/EnvironmentInfo/IRuntimeInfo.cs @@ -4,13 +4,13 @@ namespace NzbDrone.Common.EnvironmentInfo { public interface IRuntimeInfo { - Boolean IsUserInteractive { get; } - Boolean IsAdmin { get; } - Boolean IsWindowsService { get; } - Boolean IsConsole { get; } - Boolean IsRunning { get; set; } - Boolean RestartPending { get; set; } - String ExecutingApplication { get; } - String RuntimeVersion { get; } + bool IsUserInteractive { get; } + bool IsAdmin { get; } + bool IsWindowsService { get; } + bool IsConsole { get; } + bool IsRunning { get; set; } + bool RestartPending { get; set; } + string ExecutingApplication { get; } + string RuntimeVersion { get; } } } \ No newline at end of file diff --git a/src/NzbDrone.Common/Exceptron/fastJSON/JSON.cs b/src/NzbDrone.Common/Exceptron/fastJSON/JSON.cs index c08883b33..f54d42246 100644 --- a/src/NzbDrone.Common/Exceptron/fastJSON/JSON.cs +++ b/src/NzbDrone.Common/Exceptron/fastJSON/JSON.cs @@ -362,7 +362,7 @@ private object ParseDictionary(Dictionary d, Dictionary{2}", token, - String.Join("->", thisNode.CallTree.ToArray().Reverse()), token)); + string.Join("->", thisNode.CallTree.ToArray().Reverse()), token)); // expand this match var expandedValue = expansionFactory(token); diff --git a/src/NzbDrone.Common/Extensions/Int64Extensions.cs b/src/NzbDrone.Common/Extensions/Int64Extensions.cs index 3da216ce9..911e3b296 100644 --- a/src/NzbDrone.Common/Extensions/Int64Extensions.cs +++ b/src/NzbDrone.Common/Extensions/Int64Extensions.cs @@ -7,7 +7,7 @@ public static class Int64Extensions { private static readonly string[] SizeSuffixes = { "B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" }; - public static string SizeSuffix(this Int64 bytes) + public static string SizeSuffix(this long bytes) { const int bytesInKb = 1024; diff --git a/src/NzbDrone.Common/Extensions/LevenstheinExtensions.cs b/src/NzbDrone.Common/Extensions/LevenstheinExtensions.cs index b420449c5..f2a49da7d 100644 --- a/src/NzbDrone.Common/Extensions/LevenstheinExtensions.cs +++ b/src/NzbDrone.Common/Extensions/LevenstheinExtensions.cs @@ -4,13 +4,13 @@ namespace NzbDrone.Common.Extensions { public static class LevenstheinExtensions { - public static Int32 LevenshteinDistance(this String text, String other, Int32 costInsert = 1, Int32 costDelete = 1, Int32 costSubstitute = 1) + public static int LevenshteinDistance(this string text, string other, int costInsert = 1, int costDelete = 1, int costSubstitute = 1) { if (text == other) return 0; if (text.Length == 0) return other.Length * costInsert; if (other.Length == 0) return text.Length * costDelete; - Int32[] matrix = new Int32[other.Length + 1]; + int[] matrix = new int[other.Length + 1]; for (var i = 1; i < matrix.Length; i++) { @@ -19,13 +19,13 @@ public static Int32 LevenshteinDistance(this String text, String other, Int32 co for (var i = 0; i < text.Length; i++) { - Int32 topLeft = matrix[0]; + int topLeft = matrix[0]; matrix[0] = matrix[0] + costDelete; for (var j = 0; j < other.Length; j++) { - Int32 top = matrix[j]; - Int32 left = matrix[j + 1]; + int top = matrix[j]; + int left = matrix[j + 1]; var sumIns = top + costInsert; var sumDel = left + costDelete; @@ -39,7 +39,7 @@ public static Int32 LevenshteinDistance(this String text, String other, Int32 co return matrix[other.Length]; } - public static Int32 LevenshteinDistanceClean(this String expected, String other) + public static int LevenshteinDistanceClean(this string expected, string other) { expected = expected.ToLower().Replace(".", ""); other = other.ToLower().Replace(".", ""); diff --git a/src/NzbDrone.Common/Extensions/PathExtensions.cs b/src/NzbDrone.Common/Extensions/PathExtensions.cs index 66c4e1a49..e77e66e74 100644 --- a/src/NzbDrone.Common/Extensions/PathExtensions.cs +++ b/src/NzbDrone.Common/Extensions/PathExtensions.cs @@ -45,7 +45,7 @@ public static bool PathEquals(this string firstPath, string secondPath, StringCo } if (firstPath.Equals(secondPath, comparison.Value)) return true; - return String.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath(), comparison.Value); + return string.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath(), comparison.Value); } public static string GetRelativePath(this string parentPath, string childPath) diff --git a/src/NzbDrone.Common/Extensions/ResourceExtensions.cs b/src/NzbDrone.Common/Extensions/ResourceExtensions.cs index d86672f2a..5295a60e4 100644 --- a/src/NzbDrone.Common/Extensions/ResourceExtensions.cs +++ b/src/NzbDrone.Common/Extensions/ResourceExtensions.cs @@ -6,11 +6,11 @@ namespace NzbDrone.Common.Extensions { public static class ResourceExtensions { - public static Byte[] GetManifestResourceBytes(this Assembly assembly, String name) + public static byte[] GetManifestResourceBytes(this Assembly assembly, string name) { var stream = assembly.GetManifestResourceStream(name); - var result = new Byte[stream.Length]; + var result = new byte[stream.Length]; var read = stream.Read(result, 0, result.Length); if (read != result.Length) diff --git a/src/NzbDrone.Common/Extensions/StringExtensions.cs b/src/NzbDrone.Common/Extensions/StringExtensions.cs index 93d08d3b2..48acc0bb3 100644 --- a/src/NzbDrone.Common/Extensions/StringExtensions.cs +++ b/src/NzbDrone.Common/Extensions/StringExtensions.cs @@ -21,7 +21,7 @@ public static object NullSafe(this object target) public static string FirstCharToUpper(this string input) { - return input.First().ToString().ToUpper() + String.Join("", input.Skip(1)); + return input.First().ToString().ToUpper() + string.Join("", input.Skip(1)); } public static string Inject(this string format, params object[] formattingArgs) @@ -70,12 +70,12 @@ public static string CleanSpaces(this string text) public static bool IsNullOrWhiteSpace(this string text) { - return String.IsNullOrWhiteSpace(text); + return string.IsNullOrWhiteSpace(text); } public static bool IsNotNullOrWhiteSpace(this string text) { - return !String.IsNullOrWhiteSpace(text); + return !string.IsNullOrWhiteSpace(text); } public static bool ContainsIgnoreCase(this string text, string contains) diff --git a/src/NzbDrone.Common/Extensions/TryParseExtensions.cs b/src/NzbDrone.Common/Extensions/TryParseExtensions.cs index c784c6cfc..1d9fc1bdc 100644 --- a/src/NzbDrone.Common/Extensions/TryParseExtensions.cs +++ b/src/NzbDrone.Common/Extensions/TryParseExtensions.cs @@ -6,9 +6,9 @@ public static class TryParseExtensions { public static Nullable ParseInt32(this string source) { - Int32 result = 0; + int result = 0; - if (Int32.TryParse(source, out result)) + if (int.TryParse(source, out result)) { return result; } @@ -18,9 +18,9 @@ public static Nullable ParseInt32(this string source) public static Nullable ParseInt64(this string source) { - Int64 result = 0; + long result = 0; - if (Int64.TryParse(source, out result)) + if (long.TryParse(source, out result)) { return result; } diff --git a/src/NzbDrone.Common/HashUtil.cs b/src/NzbDrone.Common/HashUtil.cs index 19353f21b..062e561c1 100644 --- a/src/NzbDrone.Common/HashUtil.cs +++ b/src/NzbDrone.Common/HashUtil.cs @@ -24,7 +24,7 @@ public static string CalculateCrc(string input) } } } - return String.Format("{0:x8}", mCrc); + return string.Format("{0:x8}", mCrc); } } } \ No newline at end of file diff --git a/src/NzbDrone.Common/Http/HttpAccept.cs b/src/NzbDrone.Common/Http/HttpAccept.cs index ef2726362..34b2644f6 100644 --- a/src/NzbDrone.Common/Http/HttpAccept.cs +++ b/src/NzbDrone.Common/Http/HttpAccept.cs @@ -8,9 +8,9 @@ public sealed class HttpAccept public static readonly HttpAccept Json = new HttpAccept("application/json"); public static readonly HttpAccept Html = new HttpAccept("text/html"); - public String Value { get; private set; } + public string Value { get; private set; } - public HttpAccept(String accept) + public HttpAccept(string accept) { Value = accept; } diff --git a/src/NzbDrone.Common/Http/HttpClient.cs b/src/NzbDrone.Common/Http/HttpClient.cs index a757261da..4750a839e 100644 --- a/src/NzbDrone.Common/Http/HttpClient.cs +++ b/src/NzbDrone.Common/Http/HttpClient.cs @@ -239,7 +239,7 @@ private HttpResponse ExecuteWebRequest(HttpRequest request, HttpWebRequest webRe } } - Byte[] data = null; + byte[] data = null; using (var responseStream = httpWebResponse.GetResponseStream()) { diff --git a/src/NzbDrone.Common/Http/HttpProvider.cs b/src/NzbDrone.Common/Http/HttpProvider.cs index 8e2e9c5ce..2f47a1361 100644 --- a/src/NzbDrone.Common/Http/HttpProvider.cs +++ b/src/NzbDrone.Common/Http/HttpProvider.cs @@ -24,7 +24,7 @@ public class HttpProvider : IHttpProvider public HttpProvider(Logger logger) { _logger = logger; - _userAgent = String.Format("Sonarr {0}", BuildInfo.Version); + _userAgent = string.Format("Sonarr {0}", BuildInfo.Version); ServicePointManager.Expect100Continue = false; } diff --git a/src/NzbDrone.Common/Http/HttpResponse.cs b/src/NzbDrone.Common/Http/HttpResponse.cs index 8d4c5e3f3..32a9c10ac 100644 --- a/src/NzbDrone.Common/Http/HttpResponse.cs +++ b/src/NzbDrone.Common/Http/HttpResponse.cs @@ -6,7 +6,7 @@ namespace NzbDrone.Common.Http { public class HttpResponse { - public HttpResponse(HttpRequest request, HttpHeader headers, Byte[] binaryData, HttpStatusCode statusCode = HttpStatusCode.OK) + public HttpResponse(HttpRequest request, HttpHeader headers, byte[] binaryData, HttpStatusCode statusCode = HttpStatusCode.OK) { Request = request; Headers = headers; @@ -14,7 +14,7 @@ public HttpResponse(HttpRequest request, HttpHeader headers, Byte[] binaryData, StatusCode = statusCode; } - public HttpResponse(HttpRequest request, HttpHeader headers, String content, HttpStatusCode statusCode = HttpStatusCode.OK) + public HttpResponse(HttpRequest request, HttpHeader headers, string content, HttpStatusCode statusCode = HttpStatusCode.OK) { Request = request; Headers = headers; @@ -26,11 +26,11 @@ public HttpResponse(HttpRequest request, HttpHeader headers, String content, Htt public HttpRequest Request { get; private set; } public HttpHeader Headers { get; private set; } public HttpStatusCode StatusCode { get; private set; } - public Byte[] ResponseData { get; private set; } + public byte[] ResponseData { get; private set; } - private String _content; + private string _content; - public String Content + public string Content { get { diff --git a/src/NzbDrone.Common/Http/JsonRpcRequestBuilder.cs b/src/NzbDrone.Common/Http/JsonRpcRequestBuilder.cs index 26fab1838..8ad7f6ade 100644 --- a/src/NzbDrone.Common/Http/JsonRpcRequestBuilder.cs +++ b/src/NzbDrone.Common/Http/JsonRpcRequestBuilder.cs @@ -7,24 +7,24 @@ namespace NzbDrone.Common.Http { public class JsonRpcRequestBuilder : HttpRequestBuilder { - public String Method { get; private set; } - public List Parameters { get; private set; } + public string Method { get; private set; } + public List Parameters { get; private set; } - public JsonRpcRequestBuilder(String baseUri, String method, IEnumerable parameters) + public JsonRpcRequestBuilder(string baseUri, string method, IEnumerable parameters) : base (baseUri) { Method = method; Parameters = parameters.ToList(); } - public override HttpRequest Build(String path) + public override HttpRequest Build(string path) { var request = base.Build(path); request.Method = HttpMethod.POST; request.Headers.Accept = "application/json-rpc, application/json"; request.Headers.ContentType = "application/json-rpc"; - var message = new Dictionary(); + var message = new Dictionary(); message["jsonrpc"] = "2.0"; message["method"] = Method; message["params"] = Parameters; @@ -35,7 +35,7 @@ public override HttpRequest Build(String path) return request; } - public String CreateNextId() + public string CreateNextId() { return Guid.NewGuid().ToString().Substring(0, 8); } diff --git a/src/NzbDrone.Common/Http/JsonRpcResponse.cs b/src/NzbDrone.Common/Http/JsonRpcResponse.cs index 0136e2881..3d7b329b3 100644 --- a/src/NzbDrone.Common/Http/JsonRpcResponse.cs +++ b/src/NzbDrone.Common/Http/JsonRpcResponse.cs @@ -4,8 +4,8 @@ namespace NzbDrone.Common.Http { public class JsonRpcResponse { - public String Id { get; set; } + public string Id { get; set; } public T Result { get; set; } - public Object Error { get; set; } + public object Error { get; set; } } } diff --git a/src/NzbDrone.Common/Http/UserAgentBuilder.cs b/src/NzbDrone.Common/Http/UserAgentBuilder.cs index bf4981994..c4ae7380d 100644 --- a/src/NzbDrone.Common/Http/UserAgentBuilder.cs +++ b/src/NzbDrone.Common/Http/UserAgentBuilder.cs @@ -9,7 +9,7 @@ public static class UserAgentBuilder static UserAgentBuilder() { - UserAgent = String.Format("Sonarr/{0} ({1} {2}) ", + UserAgent = string.Format("Sonarr/{0} ({1} {2}) ", BuildInfo.Version, OsInfo.Os, OsInfo.Version.ToString(2)); } diff --git a/src/NzbDrone.Common/Instrumentation/Extensions/LoggerProgressExtensions.cs b/src/NzbDrone.Common/Instrumentation/Extensions/LoggerProgressExtensions.cs index edbab66c8..6b620e064 100644 --- a/src/NzbDrone.Common/Instrumentation/Extensions/LoggerProgressExtensions.cs +++ b/src/NzbDrone.Common/Instrumentation/Extensions/LoggerProgressExtensions.cs @@ -7,19 +7,19 @@ public static class LoggerExtensions { public static void ProgressInfo(this Logger logger, string message, params object[] args) { - var formattedMessage = String.Format(message, args); + var formattedMessage = string.Format(message, args); LogProgressMessage(logger, LogLevel.Info, formattedMessage); } public static void ProgressDebug(this Logger logger, string message, params object[] args) { - var formattedMessage = String.Format(message, args); + var formattedMessage = string.Format(message, args); LogProgressMessage(logger, LogLevel.Debug, formattedMessage); } public static void ProgressTrace(this Logger logger, string message, params object[] args) { - var formattedMessage = String.Format(message, args); + var formattedMessage = string.Format(message, args); LogProgressMessage(logger, LogLevel.Trace, formattedMessage); } diff --git a/src/NzbDrone.Common/Instrumentation/LogEventExtensions.cs b/src/NzbDrone.Common/Instrumentation/LogEventExtensions.cs index 6b1ab2e84..4fdf28873 100644 --- a/src/NzbDrone.Common/Instrumentation/LogEventExtensions.cs +++ b/src/NzbDrone.Common/Instrumentation/LogEventExtensions.cs @@ -9,7 +9,7 @@ public static class LogEventExtensions public static string GetHash(this LogEventInfo logEvent) { var stackString = logEvent.StackTrace.ToJson(); - var hashSeed = String.Concat(logEvent.LoggerName, logEvent.Exception.GetType().ToString(), stackString, logEvent.Level); + var hashSeed = string.Concat(logEvent.LoggerName, logEvent.Exception.GetType().ToString(), stackString, logEvent.Level); return HashUtil.CalculateCrc(hashSeed); } @@ -21,7 +21,7 @@ public static string GetFormattedMessage(this LogEventInfo logEvent) { if (logEvent.Exception != null) { - if (String.IsNullOrWhiteSpace(message)) + if (string.IsNullOrWhiteSpace(message)) { message = logEvent.Exception.Message; } diff --git a/src/NzbDrone.Common/PathEqualityComparer.cs b/src/NzbDrone.Common/PathEqualityComparer.cs index 028933795..6408e7b29 100644 --- a/src/NzbDrone.Common/PathEqualityComparer.cs +++ b/src/NzbDrone.Common/PathEqualityComparer.cs @@ -5,7 +5,7 @@ namespace NzbDrone.Common { - public class PathEqualityComparer : IEqualityComparer + public class PathEqualityComparer : IEqualityComparer { public static readonly PathEqualityComparer Instance = new PathEqualityComparer(); diff --git a/src/NzbDrone.Common/Processes/ProcessOutputLine.cs b/src/NzbDrone.Common/Processes/ProcessOutputLine.cs index 2b1e0a4ec..189c1f494 100644 --- a/src/NzbDrone.Common/Processes/ProcessOutputLine.cs +++ b/src/NzbDrone.Common/Processes/ProcessOutputLine.cs @@ -17,7 +17,7 @@ public ProcessOutputLine(ProcessOutputLevel level, string content) public override string ToString() { - return String.Format("{0} - {1} - {2}", Time, Level, Content); + return string.Format("{0} - {1} - {2}", Time, Level, Content); } } diff --git a/src/NzbDrone.Common/Processes/ProcessProvider.cs b/src/NzbDrone.Common/Processes/ProcessProvider.cs index aae8dac96..9c80123b1 100644 --- a/src/NzbDrone.Common/Processes/ProcessProvider.cs +++ b/src/NzbDrone.Common/Processes/ProcessProvider.cs @@ -23,8 +23,8 @@ public interface IProcessProvider void SetPriority(int processId, ProcessPriorityClass priority); void KillAll(string processName); void Kill(int processId); - Boolean Exists(int processId); - Boolean Exists(string processName); + bool Exists(int processId); + bool Exists(string processName); ProcessPriorityClass GetCurrentProcessPriority(); Process Start(string path, string args = null, StringDictionary environmentVariables = null, Action onOutputDataReceived = null, Action onErrorDataReceived = null); Process SpawnNewProcess(string path, string args = null, StringDictionary environmentVariables = null); @@ -58,7 +58,7 @@ public bool Exists(int processId) return GetProcessById(processId) != null; } - public Boolean Exists(string processName) + public bool Exists(string processName) { return GetProcessesByName(processName).Any(); } @@ -342,7 +342,7 @@ private List GetProcessesByName(string name) private string GetMonoArgs(string path, string args) { - return String.Format("--debug {0} {1}", path, args); + return string.Format("--debug {0} {1}", path, args); } } } diff --git a/src/NzbDrone.Common/Reflection/ReflectionExtensions.cs b/src/NzbDrone.Common/Reflection/ReflectionExtensions.cs index a9ea86359..db7edc31b 100644 --- a/src/NzbDrone.Common/Reflection/ReflectionExtensions.cs +++ b/src/NzbDrone.Common/Reflection/ReflectionExtensions.cs @@ -35,7 +35,7 @@ public static bool IsSimpleType(this Type type) || type == typeof(string) || type == typeof(DateTime) || type == typeof(Version) - || type == typeof(Decimal); + || type == typeof(decimal); } public static bool IsReadable(this PropertyInfo propertyInfo) @@ -54,7 +54,7 @@ public static T GetAttribute(this MemberInfo member, bool isRequired = true) if (attribute == null && isRequired) { - throw new ArgumentException(String.Format("The {0} attribute must be defined on member {1}", typeof(T).Name, member.Name)); + throw new ArgumentException(string.Format("The {0} attribute must be defined on member {1}", typeof(T).Name, member.Name)); } return (T)attribute; diff --git a/src/NzbDrone.Common/Serializer/IntConverter.cs b/src/NzbDrone.Common/Serializer/IntConverter.cs index d30db4c74..105dee3a6 100644 --- a/src/NzbDrone.Common/Serializer/IntConverter.cs +++ b/src/NzbDrone.Common/Serializer/IntConverter.cs @@ -23,7 +23,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist { throw new JsonSerializationException("Can't convert type " + existingValue.GetType().FullName + " to number"); } - if (objectType == typeof(Int64)) + if (objectType == typeof(long)) { return Convert.ToInt64(reader.Value); } @@ -33,7 +33,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist public override bool CanConvert(Type objectType) { - return objectType == typeof(Int32) || objectType == typeof(Int64) || objectType == typeof(int); + return objectType == typeof(int) || objectType == typeof(long) || objectType == typeof(int); } } } \ No newline at end of file diff --git a/src/NzbDrone.Common/ServiceProvider.cs b/src/NzbDrone.Common/ServiceProvider.cs index dad6d72fb..ffd59f08a 100644 --- a/src/NzbDrone.Common/ServiceProvider.cs +++ b/src/NzbDrone.Common/ServiceProvider.cs @@ -42,7 +42,7 @@ public virtual bool ServiceExist(string name) _logger.Debug("Checking if service {0} exists.", name); return ServiceController.GetServices().Any( - s => String.Equals(s.ServiceName, name, StringComparison.InvariantCultureIgnoreCase)); + s => string.Equals(s.ServiceName, name, StringComparison.InvariantCultureIgnoreCase)); } public virtual bool IsServiceRunning(string name) @@ -50,7 +50,7 @@ public virtual bool IsServiceRunning(string name) _logger.Debug("Checking if '{0}' service is running", name); var service = ServiceController.GetServices() - .SingleOrDefault(s => String.Equals(s.ServiceName, name, StringComparison.InvariantCultureIgnoreCase)); + .SingleOrDefault(s => string.Equals(s.ServiceName, name, StringComparison.InvariantCultureIgnoreCase)); return service != null && ( service.Status != ServiceControllerStatus.Stopped || @@ -72,7 +72,7 @@ public virtual void Install(string serviceName) var serviceInstaller = new ServiceInstaller(); - String[] cmdline = { @"/assemblypath=" + Process.GetCurrentProcess().MainModule.FileName }; + string[] cmdline = { @"/assemblypath=" + Process.GetCurrentProcess().MainModule.FileName }; var context = new InstallContext("service_install.log", cmdline); serviceInstaller.Context = context; @@ -112,7 +112,7 @@ public virtual void Run(ServiceBase service) public virtual ServiceController GetService(string serviceName) { - return ServiceController.GetServices().FirstOrDefault(c => String.Equals(c.ServiceName, serviceName, StringComparison.InvariantCultureIgnoreCase)); + return ServiceController.GetServices().FirstOrDefault(c => string.Equals(c.ServiceName, serviceName, StringComparison.InvariantCultureIgnoreCase)); } public virtual void Stop(string serviceName) @@ -185,7 +185,7 @@ public void Start(string serviceName) public void Restart(string serviceName) { - var args = String.Format("/C net.exe stop \"{0}\" && net.exe start \"{0}\"", serviceName); + var args = string.Format("/C net.exe stop \"{0}\" && net.exe start \"{0}\"", serviceName); _processProvider.Start("cmd.exe", args); } diff --git a/src/NzbDrone.Common/TinyIoC.cs b/src/NzbDrone.Common/TinyIoC.cs index 70ba36762..72b55f13a 100644 --- a/src/NzbDrone.Common/TinyIoC.cs +++ b/src/NzbDrone.Common/TinyIoC.cs @@ -458,7 +458,7 @@ public override bool Equals(object obj) if (_sourceType != cacheKey._sourceType) return false; - if (!String.Equals(_methodName, cacheKey._methodName, StringComparison.Ordinal)) + if (!string.Equals(_methodName, cacheKey._methodName, StringComparison.Ordinal)) return false; if (_genericTypes.Length != cacheKey._genericTypes.Length) @@ -532,12 +532,12 @@ public class TinyIoCResolutionException : Exception private const string ERROR_TEXT = "Unable to resolve type: {0}"; public TinyIoCResolutionException(Type type) - : base(String.Format(ERROR_TEXT, type.FullName)) + : base(string.Format(ERROR_TEXT, type.FullName)) { } public TinyIoCResolutionException(Type type, Exception innerException) - : base(String.Format(ERROR_TEXT, type.FullName), innerException) + : base(string.Format(ERROR_TEXT, type.FullName), innerException) { } } @@ -547,12 +547,12 @@ public class TinyIoCRegistrationTypeException : Exception private const string REGISTER_ERROR_TEXT = "Cannot register type {0} - abstract classes or interfaces are not valid implementation types for {1}."; public TinyIoCRegistrationTypeException(Type type, string factory) - : base(String.Format(REGISTER_ERROR_TEXT, type.FullName, factory)) + : base(string.Format(REGISTER_ERROR_TEXT, type.FullName, factory)) { } public TinyIoCRegistrationTypeException(Type type, string factory, Exception innerException) - : base(String.Format(REGISTER_ERROR_TEXT, type.FullName, factory), innerException) + : base(string.Format(REGISTER_ERROR_TEXT, type.FullName, factory), innerException) { } } @@ -563,22 +563,22 @@ public class TinyIoCRegistrationException : Exception private const string GENERIC_CONSTRAINT_ERROR_TEXT = "Type {1} is not valid for a registration of type {0}"; public TinyIoCRegistrationException(Type type, string method) - : base(String.Format(CONVERT_ERROR_TEXT, type.FullName, method)) + : base(string.Format(CONVERT_ERROR_TEXT, type.FullName, method)) { } public TinyIoCRegistrationException(Type type, string method, Exception innerException) - : base(String.Format(CONVERT_ERROR_TEXT, type.FullName, method), innerException) + : base(string.Format(CONVERT_ERROR_TEXT, type.FullName, method), innerException) { } public TinyIoCRegistrationException(Type registerType, Type implementationType) - : base(String.Format(GENERIC_CONSTRAINT_ERROR_TEXT, registerType.FullName, implementationType.FullName)) + : base(string.Format(GENERIC_CONSTRAINT_ERROR_TEXT, registerType.FullName, implementationType.FullName)) { } public TinyIoCRegistrationException(Type registerType, Type implementationType, Exception innerException) - : base(String.Format(GENERIC_CONSTRAINT_ERROR_TEXT, registerType.FullName, implementationType.FullName), innerException) + : base(string.Format(GENERIC_CONSTRAINT_ERROR_TEXT, registerType.FullName, implementationType.FullName), innerException) { } } @@ -588,12 +588,12 @@ public class TinyIoCWeakReferenceException : Exception private const string ERROR_TEXT = "Unable to instantiate {0} - referenced object has been reclaimed"; public TinyIoCWeakReferenceException(Type type) - : base(String.Format(ERROR_TEXT, type.FullName)) + : base(string.Format(ERROR_TEXT, type.FullName)) { } public TinyIoCWeakReferenceException(Type type, Exception innerException) - : base(String.Format(ERROR_TEXT, type.FullName), innerException) + : base(string.Format(ERROR_TEXT, type.FullName), innerException) { } } @@ -603,12 +603,12 @@ public class TinyIoCConstructorResolutionException : Exception private const string ERROR_TEXT = "Unable to resolve constructor for {0} using provided Expression."; public TinyIoCConstructorResolutionException(Type type) - : base(String.Format(ERROR_TEXT, type.FullName)) + : base(string.Format(ERROR_TEXT, type.FullName)) { } public TinyIoCConstructorResolutionException(Type type, Exception innerException) - : base(String.Format(ERROR_TEXT, type.FullName), innerException) + : base(string.Format(ERROR_TEXT, type.FullName), innerException) { } @@ -628,12 +628,12 @@ public class TinyIoCAutoRegistrationException : Exception private const string ERROR_TEXT = "Duplicate implementation of type {0} found ({1})."; public TinyIoCAutoRegistrationException(Type registerType, IEnumerable types) - : base(String.Format(ERROR_TEXT, registerType, GetTypesString(types))) + : base(string.Format(ERROR_TEXT, registerType, GetTypesString(types))) { } public TinyIoCAutoRegistrationException(Type registerType, IEnumerable types, Exception innerException) - : base(String.Format(ERROR_TEXT, registerType, GetTypesString(types)), innerException) + : base(string.Format(ERROR_TEXT, registerType, GetTypesString(types)), innerException) { } @@ -949,7 +949,7 @@ public static RegisterOptions ToCustomLifetimeManager(RegisterOptions instance, if (lifetimeProvider == null) throw new ArgumentNullException("lifetimeProvider", "lifetimeProvider is null."); - if (String.IsNullOrEmpty(errorString)) + if (string.IsNullOrEmpty(errorString)) throw new ArgumentException("errorString is null or empty.", "errorString"); var currentFactory = instance._Container.GetCurrentFactory(instance._Registration); @@ -1421,7 +1421,7 @@ public MultiRegisterOptions RegisterMultiple(Type registrationType, IEnumerable< //#else if (!registrationType.IsAssignableFrom(type)) //#endif - throw new ArgumentException(String.Format("types: The type {0} is not assignable from {1}", registrationType.FullName, type.FullName)); + throw new ArgumentException(string.Format("types: The type {0} is not assignable from {1}", registrationType.FullName, type.FullName)); if (implementationTypes.Count() != implementationTypes.Distinct().Count()) { @@ -3007,7 +3007,7 @@ public TypeRegistration(Type type, string name) Type = type; Name = name; - _hashCode = String.Concat(Type.FullName, "|", Name).GetHashCode(); + _hashCode = string.Concat(Type.FullName, "|", Name).GetHashCode(); } public override bool Equals(object obj) @@ -3020,7 +3020,7 @@ public override bool Equals(object obj) if (Type != typeRegistration.Type) return false; - if (String.Compare(Name, typeRegistration.Name, StringComparison.Ordinal) != 0) + if (string.Compare(Name, typeRegistration.Name, StringComparison.Ordinal) != 0) return false; return true; @@ -3240,11 +3240,11 @@ private bool CanResolveInternal(TypeRegistration registration, NamedParameterOve // Fail if requesting named resolution and settings set to fail if unresolved // Or bubble up if we have a parent - if (!String.IsNullOrEmpty(name) && options.NamedResolutionFailureAction == NamedResolutionFailureActions.Fail) + if (!string.IsNullOrEmpty(name) && options.NamedResolutionFailureAction == NamedResolutionFailureActions.Fail) return (_Parent != null) ? _Parent.CanResolveInternal(registration, parameters, options) : false; // Attemped unnamed fallback container resolution if relevant and requested - if (!String.IsNullOrEmpty(name) && options.NamedResolutionFailureAction == NamedResolutionFailureActions.AttemptUnnamedResolution) + if (!string.IsNullOrEmpty(name) && options.NamedResolutionFailureAction == NamedResolutionFailureActions.AttemptUnnamedResolution) { if (_RegisteredTypes.TryGetValue(new TypeRegistration(checkType), out factory)) { @@ -3311,7 +3311,7 @@ private bool IsAutomaticLazyFactoryRequest(Type type) //#if NETFX_CORE // if ((genericType == typeof(Func<,,>) && type.GetTypeInfo().GenericTypeArguments[0] == typeof(string) && type.GetTypeInfo().GenericTypeArguments[1] == typeof(IDictionary))) //#else - if ((genericType == typeof(Func<,,>) && type.GetGenericArguments()[0] == typeof(string) && type.GetGenericArguments()[1] == typeof(IDictionary))) + if ((genericType == typeof(Func<,,>) && type.GetGenericArguments()[0] == typeof(string) && type.GetGenericArguments()[1] == typeof(IDictionary))) //#endif return true; @@ -3397,11 +3397,11 @@ private object ResolveInternal(TypeRegistration registration, NamedParameterOver } // Fail if requesting named resolution and settings set to fail if unresolved - if (!String.IsNullOrEmpty(registration.Name) && options.NamedResolutionFailureAction == NamedResolutionFailureActions.Fail) + if (!string.IsNullOrEmpty(registration.Name) && options.NamedResolutionFailureAction == NamedResolutionFailureActions.Fail) throw new TinyIoCResolutionException(registration.Type); // Attemped unnamed fallback container resolution if relevant and requested - if (!String.IsNullOrEmpty(registration.Name) && options.NamedResolutionFailureAction == NamedResolutionFailureActions.AttemptUnnamedResolution) + if (!string.IsNullOrEmpty(registration.Name) && options.NamedResolutionFailureAction == NamedResolutionFailureActions.AttemptUnnamedResolution) { if (_RegisteredTypes.TryGetValue(new TypeRegistration(registration.Type, string.Empty), out factory)) { @@ -3479,11 +3479,11 @@ private object GetLazyAutomaticFactoryRequest(Type type) //#if NETFX_CORE // MethodInfo resolveMethod = typeof(TinyIoCContainer).GetTypeInfo().GetDeclaredMethods("Resolve").First(mi => mi.GetParameters().Length == 1 && mi.GetParameters()[0].GetType() == typeof(String)); //#else - MethodInfo resolveMethod = typeof(TinyIoCContainer).GetMethod("Resolve", new Type[] { typeof(String) }); + MethodInfo resolveMethod = typeof(TinyIoCContainer).GetMethod("Resolve", new Type[] { typeof(string) }); //#endif resolveMethod = resolveMethod.MakeGenericMethod(returnType); - ParameterExpression[] resolveParameters = new ParameterExpression[] { Expression.Parameter(typeof(String), "name") }; + ParameterExpression[] resolveParameters = new ParameterExpression[] { Expression.Parameter(typeof(string), "name") }; var resolveCall = Expression.Call(Expression.Constant(this), resolveMethod, resolveParameters); var resolveLambda = Expression.Lambda(resolveCall, resolveParameters).Compile(); @@ -3506,7 +3506,7 @@ private object GetLazyAutomaticFactoryRequest(Type type) //#if NETFX_CORE // MethodInfo resolveMethod = typeof(TinyIoCContainer).GetTypeInfo().GetDeclaredMethods("Resolve").First(mi => mi.GetParameters().Length == 2 && mi.GetParameters()[0].GetType() == typeof(String) && mi.GetParameters()[1].GetType() == typeof(NamedParameterOverloads)); //#else - MethodInfo resolveMethod = typeof(TinyIoCContainer).GetMethod("Resolve", new Type[] { typeof(String), typeof(NamedParameterOverloads) }); + MethodInfo resolveMethod = typeof(TinyIoCContainer).GetMethod("Resolve", new Type[] { typeof(string), typeof(NamedParameterOverloads) }); //#endif resolveMethod = resolveMethod.MakeGenericMethod(returnType); diff --git a/src/NzbDrone.Core.Test/DataAugmentation/Scene/SceneMappingServiceFixture.cs b/src/NzbDrone.Core.Test/DataAugmentation/Scene/SceneMappingServiceFixture.cs index af75c74d5..5cf9271e4 100644 --- a/src/NzbDrone.Core.Test/DataAugmentation/Scene/SceneMappingServiceFixture.cs +++ b/src/NzbDrone.Core.Test/DataAugmentation/Scene/SceneMappingServiceFixture.cs @@ -205,14 +205,14 @@ public void should_return_single_match(string parseTitle, string title, int expe private void AssertNoUpdate() { _provider1.Verify(c => c.GetSceneMappings(), Times.Once()); - Mocker.GetMock().Verify(c => c.Clear(It.IsAny()), Times.Never()); + Mocker.GetMock().Verify(c => c.Clear(It.IsAny()), Times.Never()); Mocker.GetMock().Verify(c => c.InsertMany(_fakeMappings), Times.Never()); } private void AssertMappingUpdated() { _provider1.Verify(c => c.GetSceneMappings(), Times.Once()); - Mocker.GetMock().Verify(c => c.Clear(It.IsAny()), Times.Once()); + Mocker.GetMock().Verify(c => c.Clear(It.IsAny()), Times.Once()); Mocker.GetMock().Verify(c => c.InsertMany(_fakeMappings), Times.Once()); foreach (var sceneMapping in _fakeMappings) diff --git a/src/NzbDrone.Core.Test/Datastore/MappingExtentionFixture.cs b/src/NzbDrone.Core.Test/Datastore/MappingExtentionFixture.cs index cbc032849..75ee030f9 100644 --- a/src/NzbDrone.Core.Test/Datastore/MappingExtentionFixture.cs +++ b/src/NzbDrone.Core.Test/Datastore/MappingExtentionFixture.cs @@ -42,7 +42,7 @@ public void Setup() { MapRepository.Instance.RegisterTypeConverter(typeof(List), new EmbeddedDocumentConverter()); MapRepository.Instance.RegisterTypeConverter(typeof(EmbeddedType), new EmbeddedDocumentConverter()); - MapRepository.Instance.RegisterTypeConverter(typeof(Int32), new Int32Converter()); + MapRepository.Instance.RegisterTypeConverter(typeof(int), new Int32Converter()); } diff --git a/src/NzbDrone.Core.Test/Datastore/SqliteSchemaDumperTests/SqliteSchemaDumperFixture.cs b/src/NzbDrone.Core.Test/Datastore/SqliteSchemaDumperTests/SqliteSchemaDumperFixture.cs index 4f21838b4..282a67ec0 100644 --- a/src/NzbDrone.Core.Test/Datastore/SqliteSchemaDumperTests/SqliteSchemaDumperFixture.cs +++ b/src/NzbDrone.Core.Test/Datastore/SqliteSchemaDumperTests/SqliteSchemaDumperFixture.cs @@ -26,7 +26,7 @@ public void Setup() [TestCase(@"CREATE TABLE ""Test """"Table"" (""My""""Id"" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT)", "Test \"Table", "My\"Id")] [TestCase(@"CREATE TABLE [Test Table] ([My Id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT)", "Test Table", "My Id")] [TestCase(@" CREATE TABLE `Test ``Table` ( `My`` Id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT ) ", "Test `Table", "My` Id")] - public void should_parse_table_language_flavors(String sql, String tableName, String columnName) + public void should_parse_table_language_flavors(string sql, string tableName, string columnName) { var result = Subject.ReadTableSchema(sql); @@ -43,7 +43,7 @@ public void should_parse_table_language_flavors(String sql, String tableName, St [TestCase(@"CREATE INDEX ""Test """"Index"" ON ""TestTable"" (""My""""Id"" ASC)", "Test \"Index", "TestTable", "My\"Id")] [TestCase(@"CREATE INDEX [Test Index] ON [TestTable] ([My Id]) ", "Test Index", "TestTable", "My Id")] [TestCase(@" CREATE INDEX `Test ``Index` ON ""TestTable"" ( `My`` Id` ASC) ", "Test `Index", "TestTable", "My` Id")] - public void should_parse_index_language_flavors(String sql, String indexName, String tableName, String columnName) + public void should_parse_index_language_flavors(string sql, string indexName, string tableName, string columnName) { var result = Subject.ReadIndexSchema(sql); @@ -56,7 +56,7 @@ public void should_parse_index_language_flavors(String sql, String indexName, St [TestCase(@"CREATE TABLE TestTable (MyId)")] [TestCase(@"CREATE TABLE TestTable (MyId NOT NULL PRIMARY KEY AUTOINCREMENT)")] [TestCase("CREATE TABLE TestTable\r\n(\t`MyId`\t NOT NULL PRIMARY KEY AUTOINCREMENT\n)")] - public void should_parse_column_attributes(String sql) + public void should_parse_column_attributes(string sql) { var result = Subject.ReadTableSchema(sql); diff --git a/src/NzbDrone.Core.Test/DecisionEngineTests/AnimeVersionUpgradeSpecificationFixture.cs b/src/NzbDrone.Core.Test/DecisionEngineTests/AnimeVersionUpgradeSpecificationFixture.cs index 9f650c17f..526c76e67 100644 --- a/src/NzbDrone.Core.Test/DecisionEngineTests/AnimeVersionUpgradeSpecificationFixture.cs +++ b/src/NzbDrone.Core.Test/DecisionEngineTests/AnimeVersionUpgradeSpecificationFixture.cs @@ -91,14 +91,14 @@ public void should_be_true_when_release_group_matches() [Test] public void should_be_false_when_existing_file_doesnt_have_a_release_group() { - _episodeFile.ReleaseGroup = String.Empty; + _episodeFile.ReleaseGroup = string.Empty; _subject.IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeFalse(); } [Test] public void should_should_be_false_when_release_doesnt_have_a_release_group() { - _remoteEpisode.ParsedEpisodeInfo.ReleaseGroup = String.Empty; + _remoteEpisode.ParsedEpisodeInfo.ReleaseGroup = string.Empty; _subject.IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeFalse(); } diff --git a/src/NzbDrone.Core.Test/DecisionEngineTests/QualityUpgradeSpecificationFixture.cs b/src/NzbDrone.Core.Test/DecisionEngineTests/QualityUpgradeSpecificationFixture.cs index 47279462a..1237e7719 100644 --- a/src/NzbDrone.Core.Test/DecisionEngineTests/QualityUpgradeSpecificationFixture.cs +++ b/src/NzbDrone.Core.Test/DecisionEngineTests/QualityUpgradeSpecificationFixture.cs @@ -38,7 +38,7 @@ private void GivenAutoDownloadPropers(bool autoDownloadPropers) } [Test, TestCaseSource("IsUpgradeTestCases")] - public void IsUpgradeTest(Quality current, Int32 currentVersion, Quality newQuality, Int32 newVersion, Quality cutoff, Boolean expected) + public void IsUpgradeTest(Quality current, int currentVersion, Quality newQuality, int newVersion, Quality cutoff, bool expected) { GivenAutoDownloadPropers(true); diff --git a/src/NzbDrone.Core.Test/DecisionEngineTests/ReleaseRestrictionsSpecificationFixture.cs b/src/NzbDrone.Core.Test/DecisionEngineTests/ReleaseRestrictionsSpecificationFixture.cs index 192a1b1f9..009bc78ba 100644 --- a/src/NzbDrone.Core.Test/DecisionEngineTests/ReleaseRestrictionsSpecificationFixture.cs +++ b/src/NzbDrone.Core.Test/DecisionEngineTests/ReleaseRestrictionsSpecificationFixture.cs @@ -23,7 +23,7 @@ public void Setup() { Series = new Series { - Tags = new HashSet() + Tags = new HashSet() }, Release = new ReleaseInfo { @@ -32,10 +32,10 @@ public void Setup() }; } - private void GivenRestictions(String required, String ignored) + private void GivenRestictions(string required, string ignored) { Mocker.GetMock() - .Setup(s => s.AllForTags(It.IsAny>())) + .Setup(s => s.AllForTags(It.IsAny>())) .Returns(new List { new Restriction @@ -50,7 +50,7 @@ private void GivenRestictions(String required, String ignored) public void should_be_true_when_restrictions_are_empty() { Mocker.GetMock() - .Setup(s => s.AllForTags(It.IsAny>())) + .Setup(s => s.AllForTags(It.IsAny>())) .Returns(new List()); Subject.IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeTrue(); @@ -92,7 +92,7 @@ public void should_be_false_when_title_contains_one_anded_ignored_terms() [TestCase("webrip")] [TestCase("X264")] [TestCase("X264,NOTTHERE")] - public void should_ignore_case_when_matching_required(String required) + public void should_ignore_case_when_matching_required(string required) { GivenRestictions(required, null); @@ -103,7 +103,7 @@ public void should_ignore_case_when_matching_required(String required) [TestCase("webrip")] [TestCase("X264")] [TestCase("X264,NOTTHERE")] - public void should_ignore_case_when_matching_ignored(String ignored) + public void should_ignore_case_when_matching_ignored(string ignored) { GivenRestictions(null, ignored); @@ -116,7 +116,7 @@ public void should_be_false_when_release_contains_one_restricted_word_and_one_re _remoteEpisode.Release.Title = "[ www.Speed.cd ] -Whose.Line.is.it.Anyway.US.S10E24.720p.HDTV.x264-BAJSKORV"; Mocker.GetMock() - .Setup(s => s.AllForTags(It.IsAny>())) + .Setup(s => s.AllForTags(It.IsAny>())) .Returns(new List { new Restriction { Required = "x264", Ignored = "www.Speed.cd" } diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/TorrentBlackholeFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/TorrentBlackholeFixture.cs index a5c4f02c0..02cbf6246 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/TorrentBlackholeFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/TorrentBlackholeFixture.cs @@ -17,9 +17,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.Blackhole [TestFixture] public class TorrentBlackholeFixture : DownloadClientFixtureBase { - protected String _completedDownloadFolder; - protected String _blackholeFolder; - protected String _filePath; + protected string _completedDownloadFolder; + protected string _blackholeFolder; + protected string _filePath; [SetUp] public void Setup() @@ -63,7 +63,7 @@ protected void GivenCompletedItem() .Returns(new[] { Path.Combine(_completedDownloadFolder, "somefile.mkv") }); Mocker.GetMock() - .Setup(c => c.GetFileSize(It.IsAny())) + .Setup(c => c.GetFileSize(It.IsAny())) .Returns(1000000); } diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/DelugeTests/DelugeFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/DelugeTests/DelugeFixture.cs index 113d92afa..af24f2797 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/DelugeTests/DelugeFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/DelugeTests/DelugeFixture.cs @@ -79,22 +79,22 @@ public void Setup() }; Mocker.GetMock() - .Setup(s => s.GetHashFromTorrentFile(It.IsAny())) + .Setup(s => s.GetHashFromTorrentFile(It.IsAny())) .Returns("CBC2F069FE8BB2F544EAE707D75BCD3DE9DCF951"); Mocker.GetMock() .Setup(s => s.Get(It.IsAny())) - .Returns(r => new HttpResponse(r, new HttpHeader(), new Byte[0])); + .Returns(r => new HttpResponse(r, new HttpHeader(), new byte[0])); } protected void GivenFailedDownload() { Mocker.GetMock() - .Setup(s => s.AddTorrentFromMagnet(It.IsAny(), It.IsAny())) + .Setup(s => s.AddTorrentFromMagnet(It.IsAny(), It.IsAny())) .Throws(); Mocker.GetMock() - .Setup(s => s.AddTorrentFromFile(It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.AddTorrentFromFile(It.IsAny(), It.IsAny(), It.IsAny())) .Throws(); } @@ -102,15 +102,15 @@ protected void GivenSuccessfulDownload() { Mocker.GetMock() .Setup(s => s.Get(It.IsAny())) - .Returns(r => new HttpResponse(r, new HttpHeader(), new Byte[1000])); + .Returns(r => new HttpResponse(r, new HttpHeader(), new byte[1000])); Mocker.GetMock() - .Setup(s => s.AddTorrentFromMagnet(It.IsAny(), It.IsAny())) + .Setup(s => s.AddTorrentFromMagnet(It.IsAny(), It.IsAny())) .Returns("CBC2F069FE8BB2F544EAE707D75BCD3DE9DCF951".ToLower()) .Callback(PrepareClientToReturnQueuedItem); Mocker.GetMock() - .Setup(s => s.AddTorrentFromFile(It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.AddTorrentFromFile(It.IsAny(), It.IsAny(), It.IsAny())) .Returns("CBC2F069FE8BB2F544EAE707D75BCD3DE9DCF951".ToLower()) .Callback(PrepareClientToReturnQueuedItem); } @@ -204,7 +204,7 @@ public void Download_should_return_unique_id() } [TestCase("magnet:?xt=urn:btih:ZPBPA2P6ROZPKRHK44D5OW6NHXU5Z6KR&tr=udp", "CBC2F069FE8BB2F544EAE707D75BCD3DE9DCF951")] - public void Download_should_get_hash_from_magnet_url(String magnetUrl, String expectedHash) + public void Download_should_get_hash_from_magnet_url(string magnetUrl, string expectedHash) { GivenSuccessfulDownload(); @@ -221,7 +221,7 @@ public void Download_should_get_hash_from_magnet_url(String magnetUrl, String ex [TestCase(DelugeTorrentStatus.Queued, DownloadItemStatus.Queued)] [TestCase(DelugeTorrentStatus.Downloading, DownloadItemStatus.Downloading)] [TestCase(DelugeTorrentStatus.Seeding, DownloadItemStatus.Downloading)] - public void GetItems_should_return_queued_item_as_downloadItemStatus(String apiStatus, DownloadItemStatus expectedItemStatus) + public void GetItems_should_return_queued_item_as_downloadItemStatus(string apiStatus, DownloadItemStatus expectedItemStatus) { _queued.State = apiStatus; @@ -237,7 +237,7 @@ public void GetItems_should_return_queued_item_as_downloadItemStatus(String apiS [TestCase(DelugeTorrentStatus.Queued, DownloadItemStatus.Queued)] [TestCase(DelugeTorrentStatus.Downloading, DownloadItemStatus.Downloading)] [TestCase(DelugeTorrentStatus.Seeding, DownloadItemStatus.Downloading)] - public void GetItems_should_return_downloading_item_as_downloadItemStatus(String apiStatus, DownloadItemStatus expectedItemStatus) + public void GetItems_should_return_downloading_item_as_downloadItemStatus(string apiStatus, DownloadItemStatus expectedItemStatus) { _downloading.State = apiStatus; @@ -252,7 +252,7 @@ public void GetItems_should_return_downloading_item_as_downloadItemStatus(String [TestCase(DelugeTorrentStatus.Checking, DownloadItemStatus.Downloading, true)] [TestCase(DelugeTorrentStatus.Queued, DownloadItemStatus.Completed, true)] [TestCase(DelugeTorrentStatus.Seeding, DownloadItemStatus.Completed, true)] - public void GetItems_should_return_completed_item_as_downloadItemStatus(String apiStatus, DownloadItemStatus expectedItemStatus, Boolean expectedReadOnly) + public void GetItems_should_return_completed_item_as_downloadItemStatus(string apiStatus, DownloadItemStatus expectedItemStatus, bool expectedReadOnly) { _completed.State = apiStatus; @@ -284,7 +284,7 @@ public void GetItems_should_check_share_ratio_for_readonly() [Test] public void should_return_status_with_outputdirs() { - var configItems = new Dictionary(); + var configItems = new Dictionary(); configItems.Add("download_location", @"C:\Downloads\Downloading\deluge".AsOsAgnostic()); configItems.Add("move_completed_path", @"C:\Downloads\Finished\deluge".AsOsAgnostic()); diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/DownloadClientFixtureBase.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/DownloadClientFixtureBase.cs index 58ea65f13..de696feda 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/DownloadClientFixtureBase.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/DownloadClientFixtureBase.cs @@ -35,11 +35,11 @@ public void SetupBase() Mocker.GetMock() .Setup(s => s.Get(It.IsAny())) - .Returns(r => new HttpResponse(r, new HttpHeader(), new Byte[0])); + .Returns(r => new HttpResponse(r, new HttpHeader(), new byte[0])); Mocker.GetMock() - .Setup(v => v.RemapRemoteToLocal(It.IsAny(), It.IsAny())) - .Returns((h, r) => r); + .Setup(v => v.RemapRemoteToLocal(It.IsAny(), It.IsAny())) + .Returns((h, r) => r); } protected virtual RemoteEpisode CreateRemoteEpisode() diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs index 4b176ad73..3ed96224e 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs @@ -80,7 +80,7 @@ public void Setup() DownloadRate = 7000000 }); - var configItems = new Dictionary(); + var configItems = new Dictionary(); configItems.Add("Category1.Name", "tv"); configItems.Add("Category1.DestDir", @"/remote/mount/tv"); @@ -92,14 +92,14 @@ public void Setup() protected void GivenFailedDownload() { Mocker.GetMock() - .Setup(s => s.DownloadNzb(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) - .Returns((String)null); + .Setup(s => s.DownloadNzb(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Returns((string)null); } protected void GivenSuccessfulDownload() { Mocker.GetMock() - .Setup(s => s.DownloadNzb(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.DownloadNzb(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .Returns(Guid.NewGuid().ToString().Replace("-", "")); } diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/RTorrentTests/RTorrentFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/RTorrentTests/RTorrentFixture.cs index 034693bea..0fef96615 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/RTorrentTests/RTorrentFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/RTorrentTests/RTorrentFixture.cs @@ -50,18 +50,18 @@ public void Setup() }; Mocker.GetMock() - .Setup(s => s.GetHashFromTorrentFile(It.IsAny())) + .Setup(s => s.GetHashFromTorrentFile(It.IsAny())) .Returns("CBC2F069FE8BB2F544EAE707D75BCD3DE9DCF951"); } protected void GivenSuccessfulDownload() { Mocker.GetMock() - .Setup(s => s.AddTorrentFromUrl(It.IsAny(), It.IsAny())) + .Setup(s => s.AddTorrentFromUrl(It.IsAny(), It.IsAny())) .Callback(PrepareClientToReturnCompletedItem); Mocker.GetMock() - .Setup(s => s.AddTorrentFromFile(It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.AddTorrentFromFile(It.IsAny(), It.IsAny(), It.IsAny())) .Callback(PrepareClientToReturnCompletedItem); } diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs index 059cb6b66..56958526a 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs @@ -107,14 +107,14 @@ public void Setup() protected void GivenFailedDownload() { Mocker.GetMock() - .Setup(s => s.DownloadNzb(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.DownloadNzb(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .Returns((SabnzbdAddResponse)null); } protected void GivenSuccessfulDownload() { Mocker.GetMock() - .Setup(s => s.DownloadNzb(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.DownloadNzb(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .Returns(new SabnzbdAddResponse() { Status = true, @@ -288,7 +288,7 @@ public void should_report_diskspace_unpack_error_as_warning() public void Download_should_use_sabRecentTvPriority_when_recentEpisode_is_true() { Mocker.GetMock() - .Setup(s => s.DownloadNzb(It.IsAny(), It.IsAny(), It.IsAny(), (int)SabnzbdPriority.High, It.IsAny())) + .Setup(s => s.DownloadNzb(It.IsAny(), It.IsAny(), It.IsAny(), (int)SabnzbdPriority.High, It.IsAny())) .Returns(new SabnzbdAddResponse()); var remoteEpisode = CreateRemoteEpisode(); @@ -301,14 +301,14 @@ public void Download_should_use_sabRecentTvPriority_when_recentEpisode_is_true() Subject.Download(remoteEpisode); Mocker.GetMock() - .Verify(v => v.DownloadNzb(It.IsAny(), It.IsAny(), It.IsAny(), (int)SabnzbdPriority.High, It.IsAny()), Times.Once()); + .Verify(v => v.DownloadNzb(It.IsAny(), It.IsAny(), It.IsAny(), (int)SabnzbdPriority.High, It.IsAny()), Times.Once()); } [TestCase(@"Droned.S01E01.Pilot.1080p.WEB-DL-DRONE", @"Droned.S01E01_Pilot_1080p_WEB-DL-DRONE.mkv")] [TestCase(@"Droned.S01E01.Pilot.1080p.WEB-DL-DRONE", @"SubDir\Droned.S01E01_Pilot_1080p_WEB-DL-DRONE.mkv")] [TestCase(@"Droned.S01E01.Pilot.1080p.WEB-DL-DRONE.mkv", @"SubDir\Droned.S01E01_Pilot_1080p_WEB-DL-DRONE.mkv")] [TestCase(@"Droned.S01E01.Pilot.1080p.WEB-DL-DRONE.mkv", @"SubDir\SubDir\Droned.S01E01_Pilot_1080p_WEB-DL-DRONE.mkv")] - public void should_return_path_to_jobfolder(String title, String storage) + public void should_return_path_to_jobfolder(string title, string storage) { _completed.Items.First().Title = title; _completed.Items.First().Storage = (@"C:\sorted\" + title + @"\" + storage).AsOsAgnostic(); @@ -366,7 +366,7 @@ public void should_not_blow_up_if_storage_doesnt_have_jobfolder() [TestCase(@"Y:\nzbget\root", @"completed", @"vv", @"Y:\nzbget\root\completed\vv")] [TestCase(@"/nzbget/root", @"completed/downloads", @"vv", @"/nzbget/root/completed/downloads/vv")] [TestCase(@"/nzbget/root", @"completed", @"vv", @"/nzbget/root/completed/vv")] - public void should_return_status_with_outputdir(String rootFolder, String completeDir, String categoryDir, String expectedDir) + public void should_return_status_with_outputdir(string rootFolder, string completeDir, string categoryDir, string expectedDir) { _queued.DefaultRootFolder = rootFolder; _config.Misc.complete_dir = completeDir; diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/TransmissionTests/TransmissionFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/TransmissionTests/TransmissionFixture.cs index d0ad14a73..cfdebdcce 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/TransmissionTests/TransmissionFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/TransmissionTests/TransmissionFixture.cs @@ -81,14 +81,14 @@ public void Setup() }; Mocker.GetMock() - .Setup(s => s.GetHashFromTorrentFile(It.IsAny())) + .Setup(s => s.GetHashFromTorrentFile(It.IsAny())) .Returns("CBC2F069FE8BB2F544EAE707D75BCD3DE9DCF951"); Mocker.GetMock() .Setup(s => s.Get(It.IsAny())) - .Returns(r => new HttpResponse(r, new HttpHeader(), new Byte[0])); + .Returns(r => new HttpResponse(r, new HttpHeader(), new byte[0])); - _transmissionConfigItems = new Dictionary(); + _transmissionConfigItems = new Dictionary(); _transmissionConfigItems.Add("download-dir", @"C:/Downloads/Finished/transmission"); _transmissionConfigItems.Add("incomplete-dir", null); @@ -108,7 +108,7 @@ protected void GivenTvCategory() protected void GivenFailedDownload() { Mocker.GetMock() - .Setup(s => s.AddTorrentFromUrl(It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.AddTorrentFromUrl(It.IsAny(), It.IsAny(), It.IsAny())) .Throws(); } @@ -116,14 +116,14 @@ protected void GivenSuccessfulDownload() { Mocker.GetMock() .Setup(s => s.Get(It.IsAny())) - .Returns(r => new HttpResponse(r, new HttpHeader(), new Byte[1000])); + .Returns(r => new HttpResponse(r, new HttpHeader(), new byte[1000])); Mocker.GetMock() - .Setup(s => s.AddTorrentFromUrl(It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.AddTorrentFromUrl(It.IsAny(), It.IsAny(), It.IsAny())) .Callback(PrepareClientToReturnQueuedItem); Mocker.GetMock() - .Setup(s => s.AddTorrentFromData(It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.AddTorrentFromData(It.IsAny(), It.IsAny(), It.IsAny())) .Callback(PrepareClientToReturnQueuedItem); } @@ -228,7 +228,7 @@ public void Download_with_category_should_force_directory() id.Should().NotBeNullOrEmpty(); Mocker.GetMock() - .Verify(v => v.AddTorrentFromData(It.IsAny(), @"C:/Downloads/Finished/transmission/sonarr", It.IsAny()), Times.Once()); + .Verify(v => v.AddTorrentFromData(It.IsAny(), @"C:/Downloads/Finished/transmission/sonarr", It.IsAny()), Times.Once()); } [Test] @@ -246,11 +246,11 @@ public void Download_with_category_should_not_have_double_slashes() id.Should().NotBeNullOrEmpty(); Mocker.GetMock() - .Verify(v => v.AddTorrentFromData(It.IsAny(), @"C:/Downloads/Finished/transmission/sonarr", It.IsAny()), Times.Once()); + .Verify(v => v.AddTorrentFromData(It.IsAny(), @"C:/Downloads/Finished/transmission/sonarr", It.IsAny()), Times.Once()); } [TestCase("magnet:?xt=urn:btih:ZPBPA2P6ROZPKRHK44D5OW6NHXU5Z6KR&tr=udp", "CBC2F069FE8BB2F544EAE707D75BCD3DE9DCF951")] - public void Download_should_get_hash_from_magnet_url(String magnetUrl, String expectedHash) + public void Download_should_get_hash_from_magnet_url(string magnetUrl, string expectedHash) { GivenSuccessfulDownload(); @@ -300,7 +300,7 @@ public void GetItems_should_return_downloading_item_as_downloadItemStatus(Transm [TestCase(TransmissionTorrentStatus.Queued, DownloadItemStatus.Completed, true)] [TestCase(TransmissionTorrentStatus.SeedingWait, DownloadItemStatus.Completed, true)] [TestCase(TransmissionTorrentStatus.Seeding, DownloadItemStatus.Completed, true)] - public void GetItems_should_return_completed_item_as_downloadItemStatus(TransmissionTorrentStatus apiStatus, DownloadItemStatus expectedItemStatus, Boolean expectedReadOnly) + public void GetItems_should_return_completed_item_as_downloadItemStatus(TransmissionTorrentStatus apiStatus, DownloadItemStatus expectedItemStatus, bool expectedReadOnly) { _completed.Status = apiStatus; @@ -363,7 +363,7 @@ public void should_fix_forward_slashes() [TestCase("2.84+ ()")] [TestCase("2.84 (other info)")] [TestCase("2.84 (2.84)")] - public void should_version_should_only_check_version_number(String version) + public void should_version_should_only_check_version_number(string version) { Mocker.GetMock() .Setup(s => s.GetVersion(It.IsAny())) diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/UTorrentTests/UTorrentFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/UTorrentTests/UTorrentFixture.cs index c29a07879..0faf1441a 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/UTorrentTests/UTorrentFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/UTorrentTests/UTorrentFixture.cs @@ -86,12 +86,12 @@ public void Setup() }; Mocker.GetMock() - .Setup(s => s.GetHashFromTorrentFile(It.IsAny())) + .Setup(s => s.GetHashFromTorrentFile(It.IsAny())) .Returns("CBC2F069FE8BB2F544EAE707D75BCD3DE9DCF951"); Mocker.GetMock() .Setup(s => s.Get(It.IsAny())) - .Returns(r => new HttpResponse(r, new HttpHeader(), new Byte[0])); + .Returns(r => new HttpResponse(r, new HttpHeader(), new byte[0])); } protected void GivenRedirectToMagnet() @@ -101,7 +101,7 @@ protected void GivenRedirectToMagnet() Mocker.GetMock() .Setup(s => s.Get(It.IsAny())) - .Returns(r => new HttpResponse(r, httpHeader, new Byte[0], System.Net.HttpStatusCode.SeeOther)); + .Returns(r => new HttpResponse(r, httpHeader, new byte[0], System.Net.HttpStatusCode.SeeOther)); } protected void GivenRedirectToTorrent() @@ -111,7 +111,7 @@ protected void GivenRedirectToTorrent() Mocker.GetMock() .Setup(s => s.Get(It.Is(h => h.Url.AbsoluteUri == _downloadUrl))) - .Returns(r => new HttpResponse(r, httpHeader, new Byte[0], System.Net.HttpStatusCode.Found)); + .Returns(r => new HttpResponse(r, httpHeader, new byte[0], System.Net.HttpStatusCode.Found)); } protected void GivenFailedDownload() @@ -124,7 +124,7 @@ protected void GivenFailedDownload() protected void GivenSuccessfulDownload() { Mocker.GetMock() - .Setup(s => s.AddTorrentFromUrl(It.IsAny(), It.IsAny())) + .Setup(s => s.AddTorrentFromUrl(It.IsAny(), It.IsAny())) .Callback(() => { PrepareClientToReturnQueuedItem(); @@ -232,7 +232,7 @@ public void GetItems_should_ignore_downloads_from_other_categories() // Proxy.GetTorrents does not return original url. So item has to be found via magnet url. [TestCase("magnet:?xt=urn:btih:ZPBPA2P6ROZPKRHK44D5OW6NHXU5Z6KR&tr=udp", "CBC2F069FE8BB2F544EAE707D75BCD3DE9DCF951")] - public void Download_should_get_hash_from_magnet_url(String magnetUrl, String expectedHash) + public void Download_should_get_hash_from_magnet_url(string magnetUrl, string expectedHash) { GivenSuccessfulDownload(); @@ -280,7 +280,7 @@ public void GetItems_should_return_downloading_item_as_downloadItemStatus(UTorre [TestCase(UTorrentTorrentStatus.Loaded | UTorrentTorrentStatus.Checked | UTorrentTorrentStatus.Queued, DownloadItemStatus.Completed, true)] [TestCase(UTorrentTorrentStatus.Loaded | UTorrentTorrentStatus.Checked | UTorrentTorrentStatus.Started, DownloadItemStatus.Completed, true)] [TestCase(UTorrentTorrentStatus.Loaded | UTorrentTorrentStatus.Checked | UTorrentTorrentStatus.Queued | UTorrentTorrentStatus.Paused, DownloadItemStatus.Completed, true)] - public void GetItems_should_return_completed_item_as_downloadItemStatus(UTorrentTorrentStatus apiStatus, DownloadItemStatus expectedItemStatus, Boolean expectedReadOnly) + public void GetItems_should_return_completed_item_as_downloadItemStatus(UTorrentTorrentStatus apiStatus, DownloadItemStatus expectedItemStatus, bool expectedReadOnly) { _completed.Status = apiStatus; @@ -295,7 +295,7 @@ public void GetItems_should_return_completed_item_as_downloadItemStatus(UTorrent [Test] public void should_return_status_with_outputdirs() { - var configItems = new Dictionary(); + var configItems = new Dictionary(); configItems.Add("dir_active_download_flag", "true"); configItems.Add("dir_active_download", @"C:\Downloads\Downloading\utorrent".AsOsAgnostic()); diff --git a/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/AddFixture.cs b/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/AddFixture.cs index 6ec615982..2a5a29c6b 100644 --- a/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/AddFixture.cs +++ b/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/AddFixture.cs @@ -68,7 +68,7 @@ public void Setup() .Returns(new List()); Mocker.GetMock() - .Setup(s => s.GetSeries(It.IsAny())) + .Setup(s => s.GetSeries(It.IsAny())) .Returns(_series); Mocker.GetMock() @@ -80,7 +80,7 @@ public void Setup() .Returns((List d) => d); } - private void GivenHeldRelease(String title, String indexer, DateTime publishDate) + private void GivenHeldRelease(string title, string indexer, DateTime publishDate) { var release = _release.JsonClone(); release.Indexer = indexer; diff --git a/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/RemoveGrabbedFixture.cs b/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/RemoveGrabbedFixture.cs index 323394532..cb797bc6f 100644 --- a/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/RemoveGrabbedFixture.cs +++ b/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/RemoveGrabbedFixture.cs @@ -69,7 +69,7 @@ public void Setup() .Returns(new List()); Mocker.GetMock() - .Setup(s => s.GetSeries(It.IsAny())) + .Setup(s => s.GetSeries(It.IsAny())) .Returns(_series); Mocker.GetMock() diff --git a/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/RemovePendingFixture.cs b/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/RemovePendingFixture.cs index e16be9cbc..91da513d1 100644 --- a/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/RemovePendingFixture.cs +++ b/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/RemovePendingFixture.cs @@ -58,7 +58,7 @@ public void should_remove_same_release() { AddPending(id: 1, seasonNumber: 2, episodes: new[] { 3 }); - var queueId = HashConverter.GetHashInt31(String.Format("pending-{0}-ep{1}", 1, _episode.Id)); + var queueId = HashConverter.GetHashInt31(string.Format("pending-{0}-ep{1}", 1, _episode.Id)); Subject.RemovePendingQueueItems(queueId); @@ -73,7 +73,7 @@ public void should_remove_multiple_releases_release() AddPending(id: 3, seasonNumber: 2, episodes: new[] { 3 }); AddPending(id: 4, seasonNumber: 2, episodes: new[] { 3 }); - var queueId = HashConverter.GetHashInt31(String.Format("pending-{0}-ep{1}", 3, _episode.Id)); + var queueId = HashConverter.GetHashInt31(string.Format("pending-{0}-ep{1}", 3, _episode.Id)); Subject.RemovePendingQueueItems(queueId); @@ -88,7 +88,7 @@ public void should_not_remove_diffrent_season() AddPending(id: 3, seasonNumber: 3, episodes: new[] { 1 }); AddPending(id: 4, seasonNumber: 3, episodes: new[] { 1 }); - var queueId = HashConverter.GetHashInt31(String.Format("pending-{0}-ep{1}", 1, _episode.Id)); + var queueId = HashConverter.GetHashInt31(string.Format("pending-{0}-ep{1}", 1, _episode.Id)); Subject.RemovePendingQueueItems(queueId); @@ -103,7 +103,7 @@ public void should_not_remove_diffrent_episodes() AddPending(id: 3, seasonNumber: 2, episodes: new[] { 2 }); AddPending(id: 4, seasonNumber: 2, episodes: new[] { 3 }); - var queueId = HashConverter.GetHashInt31(String.Format("pending-{0}-ep{1}", 1, _episode.Id)); + var queueId = HashConverter.GetHashInt31(string.Format("pending-{0}-ep{1}", 1, _episode.Id)); Subject.RemovePendingQueueItems(queueId); @@ -116,7 +116,7 @@ public void should_not_remove_multiepisodes() AddPending(id: 1, seasonNumber: 2, episodes: new[] { 1 }); AddPending(id: 2, seasonNumber: 2, episodes: new[] { 1, 2 }); - var queueId = HashConverter.GetHashInt31(String.Format("pending-{0}-ep{1}", 1, _episode.Id)); + var queueId = HashConverter.GetHashInt31(string.Format("pending-{0}-ep{1}", 1, _episode.Id)); Subject.RemovePendingQueueItems(queueId); @@ -129,7 +129,7 @@ public void should_not_remove_singleepisodes() AddPending(id: 1, seasonNumber: 2, episodes: new[] { 1 }); AddPending(id: 2, seasonNumber: 2, episodes: new[] { 1, 2 }); - var queueId = HashConverter.GetHashInt31(String.Format("pending-{0}-ep{1}", 2, _episode.Id)); + var queueId = HashConverter.GetHashInt31(string.Format("pending-{0}-ep{1}", 2, _episode.Id)); Subject.RemovePendingQueueItems(queueId); diff --git a/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/RemoveRejectedFixture.cs b/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/RemoveRejectedFixture.cs index 9d9aac486..d62fb0d2b 100644 --- a/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/RemoveRejectedFixture.cs +++ b/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/RemoveRejectedFixture.cs @@ -70,7 +70,7 @@ public void Setup() .Returns(new List()); Mocker.GetMock() - .Setup(s => s.GetSeries(It.IsAny())) + .Setup(s => s.GetSeries(It.IsAny())) .Returns(_series); Mocker.GetMock() @@ -82,7 +82,7 @@ public void Setup() .Returns((List d) => d); } - private void GivenHeldRelease(String title, String indexer, DateTime publishDate) + private void GivenHeldRelease(string title, string indexer, DateTime publishDate) { var release = _release.JsonClone(); release.Indexer = indexer; diff --git a/src/NzbDrone.Core.Test/HealthCheck/Checks/DroneFactoryCheckFixture.cs b/src/NzbDrone.Core.Test/HealthCheck/Checks/DroneFactoryCheckFixture.cs index 06f01333f..ca1f9f367 100644 --- a/src/NzbDrone.Core.Test/HealthCheck/Checks/DroneFactoryCheckFixture.cs +++ b/src/NzbDrone.Core.Test/HealthCheck/Checks/DroneFactoryCheckFixture.cs @@ -24,7 +24,7 @@ private void GivenDroneFactoryFolder(bool exists = false, bool writable = true) .Returns(exists); Mocker.GetMock() - .Setup(s => s.FolderWritable(It.IsAny())) + .Setup(s => s.FolderWritable(It.IsAny())) .Returns(exists && writable); } diff --git a/src/NzbDrone.Core.Test/HealthCheck/Checks/IndexerCheckFixture.cs b/src/NzbDrone.Core.Test/HealthCheck/Checks/IndexerCheckFixture.cs index 22e12385d..cd741f9eb 100644 --- a/src/NzbDrone.Core.Test/HealthCheck/Checks/IndexerCheckFixture.cs +++ b/src/NzbDrone.Core.Test/HealthCheck/Checks/IndexerCheckFixture.cs @@ -12,7 +12,7 @@ public class IndexerCheckFixture : CoreTest { private IIndexer _indexer; - private void GivenIndexer(Boolean supportsRss, Boolean supportsSearch) + private void GivenIndexer(bool supportsRss, bool supportsSearch) { var _indexer = Mocker.GetMock(); _indexer.SetupGet(s => s.SupportsRss).Returns(supportsRss); diff --git a/src/NzbDrone.Core.Test/HealthCheck/Checks/MonoVersionCheckFixture.cs b/src/NzbDrone.Core.Test/HealthCheck/Checks/MonoVersionCheckFixture.cs index d3869a0a7..5b5e881b3 100644 --- a/src/NzbDrone.Core.Test/HealthCheck/Checks/MonoVersionCheckFixture.cs +++ b/src/NzbDrone.Core.Test/HealthCheck/Checks/MonoVersionCheckFixture.cs @@ -19,7 +19,7 @@ private void GivenOutput(string version) { Mocker.GetMock() .SetupGet(s => s.RuntimeVersion) - .Returns(String.Format("{0} (tarball Wed Sep 25 16:35:44 CDT 2013)", version)); + .Returns(string.Format("{0} (tarball Wed Sep 25 16:35:44 CDT 2013)", version)); } [Test] diff --git a/src/NzbDrone.Core.Test/HealthCheck/Checks/RootFolderCheckFixture.cs b/src/NzbDrone.Core.Test/HealthCheck/Checks/RootFolderCheckFixture.cs index 668b7fa4c..3316c54f8 100644 --- a/src/NzbDrone.Core.Test/HealthCheck/Checks/RootFolderCheckFixture.cs +++ b/src/NzbDrone.Core.Test/HealthCheck/Checks/RootFolderCheckFixture.cs @@ -29,7 +29,7 @@ private void GivenMissingRootFolder() .Returns(@"C:\TV"); Mocker.GetMock() - .Setup(s => s.FolderExists(It.IsAny())) + .Setup(s => s.FolderExists(It.IsAny())) .Returns(false); } diff --git a/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedBlacklistFixture.cs b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedBlacklistFixture.cs index e5c3c077e..1042b8468 100644 --- a/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedBlacklistFixture.cs +++ b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedBlacklistFixture.cs @@ -18,7 +18,7 @@ public class CleanupOrphanedBlacklistFixture : DbTest.CreateNew() - .With(h => h.EpisodeIds = new List()) + .With(h => h.EpisodeIds = new List()) .With(h => h.Quality = new QualityModel()) .BuildNew(); @@ -35,7 +35,7 @@ public void should_not_delete_unorphaned_blacklist_items() Db.Insert(series); var blacklist = Builder.CreateNew() - .With(h => h.EpisodeIds = new List()) + .With(h => h.EpisodeIds = new List()) .With(h => h.Quality = new QualityModel()) .With(b => b.SeriesId = series.Id) .BuildNew(); diff --git a/src/NzbDrone.Core.Test/IndexerSearchTests/NzbSearchServiceFixture.cs b/src/NzbDrone.Core.Test/IndexerSearchTests/NzbSearchServiceFixture.cs index 4de560e28..dec0554fd 100644 --- a/src/NzbDrone.Core.Test/IndexerSearchTests/NzbSearchServiceFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerSearchTests/NzbSearchServiceFixture.cs @@ -52,11 +52,11 @@ public void SetUp() .Returns((i, j) => _xemEpisodes.Where(d => d.SeasonNumber == j).ToList()); Mocker.GetMock() - .Setup(s => s.GetSceneNames(It.IsAny(), It.IsAny>())) - .Returns(new List()); + .Setup(s => s.GetSceneNames(It.IsAny(), It.IsAny>())) + .Returns(new List()); } - private void WithEpisode(Int32 seasonNumber, Int32 episodeNumber, Int32? sceneSeasonNumber, Int32? sceneEpisodeNumber) + private void WithEpisode(int seasonNumber, int episodeNumber, int? sceneSeasonNumber, int? sceneEpisodeNumber) { var episode = Builder.CreateNew() .With(v => v.SeriesId == _xemSeries.Id) diff --git a/src/NzbDrone.Core.Test/IndexerSearchTests/SeriesSearchServiceFixture.cs b/src/NzbDrone.Core.Test/IndexerSearchTests/SeriesSearchServiceFixture.cs index f1c0446e0..afd04c369 100644 --- a/src/NzbDrone.Core.Test/IndexerSearchTests/SeriesSearchServiceFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerSearchTests/SeriesSearchServiceFixture.cs @@ -28,11 +28,11 @@ public void Setup() }; Mocker.GetMock() - .Setup(s => s.GetSeries(It.IsAny())) + .Setup(s => s.GetSeries(It.IsAny())) .Returns(_series); Mocker.GetMock() - .Setup(s => s.SeasonSearch(_series.Id, It.IsAny(), false)) + .Setup(s => s.SeasonSearch(_series.Id, It.IsAny(), false)) .Returns(new List()); Mocker.GetMock() @@ -52,13 +52,13 @@ public void should_only_include_monitored_seasons() Subject.Execute(new SeriesSearchCommand{ SeriesId = _series.Id }); Mocker.GetMock() - .Verify(v => v.SeasonSearch(_series.Id, It.IsAny(), false), Times.Exactly(_series.Seasons.Count(s => s.Monitored))); + .Verify(v => v.SeasonSearch(_series.Id, It.IsAny(), false), Times.Exactly(_series.Seasons.Count(s => s.Monitored))); } [Test] public void should_start_with_lower_seasons_first() { - var seasonOrder = new List(); + var seasonOrder = new List(); _series.Seasons = new List { @@ -68,7 +68,7 @@ public void should_start_with_lower_seasons_first() }; Mocker.GetMock() - .Setup(s => s.SeasonSearch(_series.Id, It.IsAny(), false)) + .Setup(s => s.SeasonSearch(_series.Id, It.IsAny(), false)) .Returns(new List()) .Callback((seriesId, seasonNumber, missingOnly) => seasonOrder.Add(seasonNumber)); diff --git a/src/NzbDrone.Core.Test/IndexerTests/BroadcastheNetTests/BroadcastheNetFixture.cs b/src/NzbDrone.Core.Test/IndexerTests/BroadcastheNetTests/BroadcastheNetFixture.cs index fcb18c4df..fb35e1987 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/BroadcastheNetTests/BroadcastheNetFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/BroadcastheNetTests/BroadcastheNetFixture.cs @@ -68,7 +68,7 @@ public void should_back_off_on_bad_request() { Mocker.GetMock() .Setup(v => v.Execute(It.IsAny())) - .Returns(r => new HttpResponse(r, new HttpHeader(), new Byte[0], System.Net.HttpStatusCode.BadRequest)); + .Returns(r => new HttpResponse(r, new HttpHeader(), new byte[0], System.Net.HttpStatusCode.BadRequest)); var results = Subject.FetchRecent(); @@ -84,7 +84,7 @@ public void should_back_off_and_report_api_key_invalid() { Mocker.GetMock() .Setup(v => v.Execute(It.IsAny())) - .Returns(r => new HttpResponse(r, new HttpHeader(), new Byte[0], System.Net.HttpStatusCode.Unauthorized)); + .Returns(r => new HttpResponse(r, new HttpHeader(), new byte[0], System.Net.HttpStatusCode.Unauthorized)); var results = Subject.FetchRecent(); @@ -100,7 +100,7 @@ public void should_back_off_on_unknown_method() { Mocker.GetMock() .Setup(v => v.Execute(It.IsAny())) - .Returns(r => new HttpResponse(r, new HttpHeader(), new Byte[0], System.Net.HttpStatusCode.NotFound)); + .Returns(r => new HttpResponse(r, new HttpHeader(), new byte[0], System.Net.HttpStatusCode.NotFound)); var results = Subject.FetchRecent(); @@ -116,7 +116,7 @@ public void should_back_off_api_limit_reached() { Mocker.GetMock() .Setup(v => v.Execute(It.IsAny())) - .Returns(r => new HttpResponse(r, new HttpHeader(), new Byte[0], System.Net.HttpStatusCode.ServiceUnavailable)); + .Returns(r => new HttpResponse(r, new HttpHeader(), new byte[0], System.Net.HttpStatusCode.ServiceUnavailable)); var results = Subject.FetchRecent(); diff --git a/src/NzbDrone.Core.Test/IndexerTests/KickassTorrentsTests/KickassTorrentsFixture.cs b/src/NzbDrone.Core.Test/IndexerTests/KickassTorrentsTests/KickassTorrentsFixture.cs index 14446ef52..d6c06a6cd 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/KickassTorrentsTests/KickassTorrentsFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/KickassTorrentsTests/KickassTorrentsFixture.cs @@ -59,7 +59,7 @@ public void should_return_empty_list_on_404() { Mocker.GetMock() .Setup(o => o.Execute(It.Is(v => v.Method == HttpMethod.GET))) - .Returns(r => new HttpResponse(r, new HttpHeader(), new Byte[0], System.Net.HttpStatusCode.NotFound)); + .Returns(r => new HttpResponse(r, new HttpHeader(), new byte[0], System.Net.HttpStatusCode.NotFound)); var releases = Subject.FetchRecent(); diff --git a/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabFixture.cs b/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabFixture.cs index 5fe0390cc..dd675bd12 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabFixture.cs @@ -23,7 +23,7 @@ public void Setup() Settings = new NewznabSettings() { Url = "http://indexer.local/", - Categories = new Int32[] { 1 } + Categories = new int[] { 1 } } }; } diff --git a/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabRequestGeneratorFixture.cs b/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabRequestGeneratorFixture.cs index f95e5f626..1bc95a2a7 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabRequestGeneratorFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabRequestGeneratorFixture.cs @@ -26,7 +26,7 @@ public void SetUp() _animeSearchCriteria = new AnimeEpisodeSearchCriteria() { - SceneTitles = new List() { "Monkey+Island" }, + SceneTitles = new List() { "Monkey+Island" }, AbsoluteEpisodeNumber = 100 }; } diff --git a/src/NzbDrone.Core.Test/IndexerTests/TestIndexer.cs b/src/NzbDrone.Core.Test/IndexerTests/TestIndexer.cs index 357dbd48e..528a88104 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/TestIndexer.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/TestIndexer.cs @@ -19,8 +19,8 @@ public override string Name public override DownloadProtocol Protocol { get { return DownloadProtocol.Usenet; } } - public Int32 _supportedPageSize; - public override Int32 PageSize { get { return _supportedPageSize; } } + public int _supportedPageSize; + public override int PageSize { get { return _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/IndexerTests/TitansOfTvTests/TitansOfTvFixture.cs b/src/NzbDrone.Core.Test/IndexerTests/TitansOfTvTests/TitansOfTvFixture.cs index a25095bfe..15ae31b8c 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/TitansOfTvTests/TitansOfTvFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/TitansOfTvTests/TitansOfTvFixture.cs @@ -68,7 +68,7 @@ public void should_back_off_on_bad_request() { Mocker.GetMock() .Setup(v => v.Execute(It.IsAny())) - .Returns(r => new HttpResponse(r, new HttpHeader(), new Byte[0], System.Net.HttpStatusCode.BadRequest)); + .Returns(r => new HttpResponse(r, new HttpHeader(), new byte[0], System.Net.HttpStatusCode.BadRequest)); var results = Subject.FetchRecent(); @@ -84,7 +84,7 @@ public void should_back_off_and_report_api_key_invalid() { Mocker.GetMock() .Setup(v => v.Execute(It.IsAny())) - .Returns(r => new HttpResponse(r, new HttpHeader(), new Byte[0], System.Net.HttpStatusCode.Unauthorized)); + .Returns(r => new HttpResponse(r, new HttpHeader(), new byte[0], System.Net.HttpStatusCode.Unauthorized)); var results = Subject.FetchRecent(); @@ -102,7 +102,7 @@ public void should_back_off_on_unknown_method() { Mocker.GetMock() .Setup(v => v.Execute(It.IsAny())) - .Returns(r => new HttpResponse(r, new HttpHeader(), new Byte[0], System.Net.HttpStatusCode.NotFound)); + .Returns(r => new HttpResponse(r, new HttpHeader(), new byte[0], System.Net.HttpStatusCode.NotFound)); var results = Subject.FetchRecent(); @@ -118,7 +118,7 @@ public void should_back_off_api_limit_reached() { Mocker.GetMock() .Setup(v => v.Execute(It.IsAny())) - .Returns(r => new HttpResponse(r, new HttpHeader(), new Byte[0], System.Net.HttpStatusCode.ServiceUnavailable)); + .Returns(r => new HttpResponse(r, new HttpHeader(), new byte[0], System.Net.HttpStatusCode.ServiceUnavailable)); var results = Subject.FetchRecent(); diff --git a/src/NzbDrone.Core.Test/IndexerTests/TorznabTests/TorznabFixture.cs b/src/NzbDrone.Core.Test/IndexerTests/TorznabTests/TorznabFixture.cs index 24d2bf524..6fd8d5588 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/TorznabTests/TorznabFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/TorznabTests/TorznabFixture.cs @@ -23,7 +23,7 @@ public void Setup() Settings = new TorznabSettings() { Url = "http://indexer.local/", - Categories = new Int32[] { 1 } + Categories = new int[] { 1 } } }; diff --git a/src/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs b/src/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs index d4a8b0abc..6ca20475c 100644 --- a/src/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs +++ b/src/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs @@ -52,7 +52,7 @@ public void write_log() [Test] public void write_long_log() { - var message = String.Empty; + var message = string.Empty; for (int i = 0; i < 100; i++) { message += Guid.NewGuid(); @@ -99,7 +99,7 @@ public void exception_log_with_no_message_should_use_exceptions_message() { var ex = new InvalidOperationException("Fake Exception"); - _uniqueMessage = String.Empty; + _uniqueMessage = string.Empty; _logger.ErrorException(_uniqueMessage, ex); diff --git a/src/NzbDrone.Core.Test/MediaFiles/DownloadedEpisodesImportServiceFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/DownloadedEpisodesImportServiceFixture.cs index dcaff126d..e8af69816 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/DownloadedEpisodesImportServiceFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/DownloadedEpisodesImportServiceFixture.cs @@ -45,7 +45,7 @@ public void Setup() private void GivenValidSeries() { Mocker.GetMock() - .Setup(s => s.GetSeries(It.IsAny())) + .Setup(s => s.GetSeries(It.IsAny())) .Returns(Builder.CreateNew().Build()); } @@ -90,7 +90,7 @@ public void should_not_import_if_folder_is_a_series_path() GivenValidSeries(); Mocker.GetMock() - .Setup(s => s.SeriesPathExists(It.IsAny())) + .Setup(s => s.SeriesPathExists(It.IsAny())) .Returns(true); Mocker.GetMock() @@ -100,7 +100,7 @@ public void should_not_import_if_folder_is_a_series_path() Subject.ProcessRootFolder(new DirectoryInfo(_droneFactory)); Mocker.GetMock() - .Verify(v => v.GetVideoFiles(It.IsAny(), true), Times.Never()); + .Verify(v => v.GetVideoFiles(It.IsAny(), true), Times.Never()); ExceptionVerification.ExpectedWarns(1); } @@ -115,7 +115,7 @@ public void should_not_delete_folder_if_no_files_were_imported() Subject.ProcessRootFolder(new DirectoryInfo(_droneFactory)); Mocker.GetMock() - .Verify(v => v.GetFolderSize(It.IsAny()), Times.Never()); + .Verify(v => v.GetFolderSize(It.IsAny()), Times.Never()); } [Test] @@ -129,7 +129,7 @@ public void should_not_delete_folder_if_files_were_imported_and_video_files_rema imported.Add(new ImportDecision(localEpisode)); Mocker.GetMock() - .Setup(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), null, true)) + .Setup(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), null, true)) .Returns(imported); Mocker.GetMock() @@ -139,7 +139,7 @@ public void should_not_delete_folder_if_files_were_imported_and_video_files_rema Subject.ProcessRootFolder(new DirectoryInfo(_droneFactory)); Mocker.GetMock() - .Verify(v => v.DeleteFolder(It.IsAny(), true), Times.Never()); + .Verify(v => v.DeleteFolder(It.IsAny(), true), Times.Never()); ExceptionVerification.ExpectedWarns(1); } @@ -155,7 +155,7 @@ public void should_delete_folder_if_files_were_imported_and_only_sample_files_re imported.Add(new ImportDecision(localEpisode)); Mocker.GetMock() - .Setup(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), null, true)) + .Setup(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), null, true)) .Returns(imported); Mocker.GetMock() @@ -165,15 +165,15 @@ public void should_delete_folder_if_files_were_imported_and_only_sample_files_re Mocker.GetMock() .Setup(s => s.IsSample(It.IsAny(), It.IsAny(), - It.IsAny(), - It.IsAny(), - It.IsAny())) + It.IsAny(), + It.IsAny(), + It.IsAny())) .Returns(true); Subject.ProcessRootFolder(new DirectoryInfo(_droneFactory)); Mocker.GetMock() - .Verify(v => v.DeleteFolder(It.IsAny(), true), Times.Once()); + .Verify(v => v.DeleteFolder(It.IsAny(), true), Times.Once()); } [TestCase("_UNPACK_")] @@ -181,7 +181,7 @@ public void should_delete_folder_if_files_were_imported_and_only_sample_files_re public void should_remove_unpack_from_folder_name(string prefix) { var folderName = "30.rock.s01e01.pilot.hdtv-lol"; - var folders = new[] { String.Format(@"C:\Test\Unsorted\{0}{1}", prefix, folderName).AsOsAgnostic() }; + var folders = new[] { string.Format(@"C:\Test\Unsorted\{0}{1}", prefix, folderName).AsOsAgnostic() }; Mocker.GetMock() .Setup(c => c.GetDirectories(It.IsAny())) @@ -193,7 +193,7 @@ public void should_remove_unpack_from_folder_name(string prefix) .Verify(v => v.GetSeries(folderName), Times.Once()); Mocker.GetMock() - .Verify(v => v.GetSeries(It.Is(s => s.StartsWith(prefix))), Times.Never()); + .Verify(v => v.GetSeries(It.Is(s => s.StartsWith(prefix))), Times.Never()); } [Test] @@ -227,7 +227,7 @@ public void should_not_delete_if_there_is_large_rar_file() imported.Add(new ImportDecision(localEpisode)); Mocker.GetMock() - .Setup(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), null, true)) + .Setup(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), null, true)) .Returns(imported); Mocker.GetMock() @@ -237,9 +237,9 @@ public void should_not_delete_if_there_is_large_rar_file() Mocker.GetMock() .Setup(s => s.IsSample(It.IsAny(), It.IsAny(), - It.IsAny(), - It.IsAny(), - It.IsAny())) + It.IsAny(), + It.IsAny(), + It.IsAny())) .Returns(true); Mocker.GetMock() @@ -253,7 +253,7 @@ public void should_not_delete_if_there_is_large_rar_file() Subject.ProcessRootFolder(new DirectoryInfo(_droneFactory)); Mocker.GetMock() - .Verify(v => v.DeleteFolder(It.IsAny(), true), Times.Never()); + .Verify(v => v.DeleteFolder(It.IsAny(), true), Times.Never()); ExceptionVerification.ExpectedWarns(1); } @@ -281,7 +281,7 @@ public void should_use_folder_if_folder_import() Subject.ProcessPath(fileName); Mocker.GetMock() - .Verify(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), It.Is(v => v.AbsoluteEpisodeNumbers.First() == 9), true), Times.Once()); + .Verify(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), It.Is(v => v.AbsoluteEpisodeNumbers.First() == 9), true), Times.Once()); } [Test] @@ -305,7 +305,7 @@ public void should_not_use_folder_if_file_import() var result = Subject.ProcessPath(fileName); Mocker.GetMock() - .Verify(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), null, true), Times.Once()); + .Verify(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), null, true), Times.Once()); } [Test] @@ -338,7 +338,7 @@ public void should_not_delete_if_no_files_were_imported() imported.Add(new ImportDecision(localEpisode)); Mocker.GetMock() - .Setup(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), null, true)) + .Setup(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), null, true)) .Returns(imported); Mocker.GetMock() @@ -348,9 +348,9 @@ public void should_not_delete_if_no_files_were_imported() Mocker.GetMock() .Setup(s => s.IsSample(It.IsAny(), It.IsAny(), - It.IsAny(), - It.IsAny(), - It.IsAny())) + It.IsAny(), + It.IsAny(), + It.IsAny())) .Returns(true); Mocker.GetMock() @@ -360,7 +360,7 @@ public void should_not_delete_if_no_files_were_imported() Subject.ProcessRootFolder(new DirectoryInfo(_droneFactory)); Mocker.GetMock() - .Verify(v => v.DeleteFolder(It.IsAny(), true), Times.Never()); + .Verify(v => v.DeleteFolder(It.IsAny(), true), Times.Never()); } private void VerifyNoImport() diff --git a/src/NzbDrone.Core.Test/MediaFiles/EpisodeFileMovingServiceTests/MoveEpisodeFileFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/EpisodeFileMovingServiceTests/MoveEpisodeFileFixture.cs index 10890d5c7..c55518dda 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/EpisodeFileMovingServiceTests/MoveEpisodeFileFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/EpisodeFileMovingServiceTests/MoveEpisodeFileFixture.cs @@ -46,7 +46,7 @@ public void Setup() .Returns("File Name"); Mocker.GetMock() - .Setup(s => s.BuildFilePath(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(s => s.BuildFilePath(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .Returns(@"C:\Test\TV\Series\Season 01\File Name.avi".AsOsAgnostic()); Mocker.GetMock() @@ -59,7 +59,7 @@ public void Setup() .Returns(true); Mocker.GetMock() - .Setup(s => s.FileExists(It.IsAny())) + .Setup(s => s.FileExists(It.IsAny())) .Returns(true); } @@ -69,7 +69,7 @@ public void should_catch_UnauthorizedAccessException_during_folder_inheritance() WindowsOnly(); Mocker.GetMock() - .Setup(s => s.InheritFolderPermissions(It.IsAny())) + .Setup(s => s.InheritFolderPermissions(It.IsAny())) .Throws(); Subject.MoveEpisodeFile(_episodeFile, _localEpisode); @@ -81,7 +81,7 @@ public void should_catch_InvalidOperationException_during_folder_inheritance() WindowsOnly(); Mocker.GetMock() - .Setup(s => s.InheritFolderPermissions(It.IsAny())) + .Setup(s => s.InheritFolderPermissions(It.IsAny())) .Throws(); Subject.MoveEpisodeFile(_episodeFile, _localEpisode); diff --git a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportDecisionMakerFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportDecisionMakerFixture.cs index a0cceecd1..cba94adfb 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportDecisionMakerFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportDecisionMakerFixture.cs @@ -68,7 +68,7 @@ public void Setup() }; Mocker.GetMock() - .Setup(c => c.GetLocalEpisode(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(c => c.GetLocalEpisode(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .Returns(_localEpisode); GivenVideoFiles(new List { @"C:\Test\Unsorted\The.Office.S03E115.DVDRip.XviD-OSiTV.avi".AsOsAgnostic() }); @@ -148,10 +148,10 @@ public void should_not_blowup_the_process_due_to_failed_parse() GivenSpecifications(_pass1); Mocker.GetMock() - .Setup(c => c.GetLocalEpisode(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(c => c.GetLocalEpisode(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .Throws(); - _videoFiles = new List + _videoFiles = new List { "The.Office.S03E115.DVDRip.XviD-OSiTV", "The.Office.S03E115.DVDRip.XviD-OSiTV", @@ -163,7 +163,7 @@ public void should_not_blowup_the_process_due_to_failed_parse() Subject.GetImportDecisions(_videoFiles, _series); Mocker.GetMock() - .Verify(c => c.GetLocalEpisode(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Exactly(_videoFiles.Count)); + .Verify(c => c.GetLocalEpisode(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Exactly(_videoFiles.Count)); ExceptionVerification.ExpectedErrors(3); } @@ -207,10 +207,10 @@ public void should_not_throw_if_episodes_are_not_found() GivenSpecifications(_pass1); Mocker.GetMock() - .Setup(c => c.GetLocalEpisode(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(c => c.GetLocalEpisode(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .Returns(new LocalEpisode() { Path = "test" }); - _videoFiles = new List + _videoFiles = new List { "The.Office.S03E115.DVDRip.XviD-OSiTV", "The.Office.S03E115.DVDRip.XviD-OSiTV", @@ -222,7 +222,7 @@ public void should_not_throw_if_episodes_are_not_found() var decisions = Subject.GetImportDecisions(_videoFiles, _series); Mocker.GetMock() - .Verify(c => c.GetLocalEpisode(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Exactly(_videoFiles.Count)); + .Verify(c => c.GetLocalEpisode(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Exactly(_videoFiles.Count)); decisions.Should().HaveCount(3); decisions.First().Rejections.Should().NotBeEmpty(); diff --git a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/SampleServiceFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/SampleServiceFixture.cs index 813ef747b..2828e1404 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/SampleServiceFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/SampleServiceFixture.cs @@ -50,7 +50,7 @@ private void GivenFileSize(long size) private void GivenRuntime(int seconds) { Mocker.GetMock() - .Setup(s => s.GetRunTime(It.IsAny())) + .Setup(s => s.GetRunTime(It.IsAny())) .Returns(new TimeSpan(0, 0, seconds)); } @@ -93,7 +93,7 @@ public void should_use_runtime() _localEpisode.Size, _localEpisode.SeasonNumber); - Mocker.GetMock().Verify(v => v.GetRunTime(It.IsAny()), Times.Once()); + Mocker.GetMock().Verify(v => v.GetRunTime(It.IsAny()), Times.Once()); } [Test] @@ -116,7 +116,7 @@ public void should_return_false_if_runtime_greater_than_than_minimum() public void should_fall_back_to_file_size_if_mediainfo_dll_not_found_acceptable_size() { Mocker.GetMock() - .Setup(s => s.GetRunTime(It.IsAny())) + .Setup(s => s.GetRunTime(It.IsAny())) .Throws(); GivenFileSize(1000.Megabytes()); @@ -127,7 +127,7 @@ public void should_fall_back_to_file_size_if_mediainfo_dll_not_found_acceptable_ public void should_fall_back_to_file_size_if_mediainfo_dll_not_found_undersize() { Mocker.GetMock() - .Setup(s => s.GetRunTime(It.IsAny())) + .Setup(s => s.GetRunTime(It.IsAny())) .Throws(); GivenFileSize(1.Megabytes()); diff --git a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecificationFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecificationFixture.cs index 5cdaa8590..04020abeb 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecificationFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecificationFixture.cs @@ -20,7 +20,7 @@ public class FreeSpaceSpecificationFixture : CoreTest { private Series _series; private LocalEpisode _localEpisode; - private String _rootFolder; + private string _rootFolder; [SetUp] public void Setup() @@ -54,7 +54,7 @@ private void GivenFileSize(long size) private void GivenFreeSpace(long? size) { Mocker.GetMock() - .Setup(s => s.GetAvailableSpace(It.IsAny())) + .Setup(s => s.GetAvailableSpace(It.IsAny())) .Returns(size); } @@ -114,7 +114,7 @@ public void should_pass_if_exception_is_thrown() GivenFileSize(100.Megabytes()); Mocker.GetMock() - .Setup(s => s.GetAvailableSpace(It.IsAny())) + .Setup(s => s.GetAvailableSpace(It.IsAny())) .Throws(new TestException()); Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue(); @@ -129,7 +129,7 @@ public void should_skip_check_for_files_under_series_folder() Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue(); Mocker.GetMock() - .Verify(s => s.GetAvailableSpace(It.IsAny()), Times.Never()); + .Verify(s => s.GetAvailableSpace(It.IsAny()), Times.Never()); } [Test] @@ -138,7 +138,7 @@ public void should_return_true_if_free_space_is_null() long? freeSpace = null; Mocker.GetMock() - .Setup(s => s.GetAvailableSpace(It.IsAny())) + .Setup(s => s.GetAvailableSpace(It.IsAny())) .Returns(freeSpace); Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue(); diff --git a/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedEpisodesFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedEpisodesFixture.cs index e51b8280a..577de5ea0 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedEpisodesFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedEpisodesFixture.cs @@ -154,7 +154,7 @@ public void should_use_nzb_title_as_scene_name() [TestCase(".mkv")] [TestCase(".par2")] [TestCase(".nzb")] - public void should_remove_extension_from_nzb_title_for_scene_name(String extension) + public void should_remove_extension_from_nzb_title_for_scene_name(string extension) { var title = "malcolm.in.the.middle.s02e05.dvdrip.xvid-ingot"; diff --git a/src/NzbDrone.Core.Test/MediaFiles/MediaFileTableCleanupServiceFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/MediaFileTableCleanupServiceFixture.cs index 92caca958..5b09bb4ce 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/MediaFileTableCleanupServiceFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/MediaFileTableCleanupServiceFixture.cs @@ -31,7 +31,7 @@ public void SetUp() .Build(); Mocker.GetMock() - .Setup(e => e.FileExists(It.Is(c => !c.Contains(DELETED_PATH)))) + .Setup(e => e.FileExists(It.Is(c => !c.Contains(DELETED_PATH)))) .Returns(true); Mocker.GetMock() diff --git a/src/NzbDrone.Core.Test/MediaFiles/MediaInfo/UpdateMediaInfoServiceFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/MediaInfo/UpdateMediaInfoServiceFixture.cs index f31051e9b..a60de754e 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/MediaInfo/UpdateMediaInfoServiceFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/MediaInfo/UpdateMediaInfoServiceFixture.cs @@ -36,18 +36,18 @@ public void Setup() private void GivenFileExists() { Mocker.GetMock() - .Setup(v => v.FileExists(It.IsAny())) + .Setup(v => v.FileExists(It.IsAny())) .Returns(true); } private void GivenSuccessfulScan() { Mocker.GetMock() - .Setup(v => v.GetMediaInfo(It.IsAny())) + .Setup(v => v.GetMediaInfo(It.IsAny())) .Returns(new MediaInfoModel()); } - private void GivenFailedScan(String path) + private void GivenFailedScan(string path) { Mocker.GetMock() .Setup(v => v.GetMediaInfo(path)) diff --git a/src/NzbDrone.Core.Test/MetadataSource/SkyHook/SkyHookProxyFixture.cs b/src/NzbDrone.Core.Test/MetadataSource/SkyHook/SkyHookProxyFixture.cs index 56db1af1e..e6178c0d2 100644 --- a/src/NzbDrone.Core.Test/MetadataSource/SkyHook/SkyHookProxyFixture.cs +++ b/src/NzbDrone.Core.Test/MetadataSource/SkyHook/SkyHookProxyFixture.cs @@ -38,7 +38,7 @@ public void should_be_able_to_get_series_detail(int tvdbId, string title) [Test] public void getting_details_of_invalid_series() { - Assert.Throws(() => Subject.GetSeriesInfo(Int32.MaxValue)); + Assert.Throws(() => Subject.GetSeriesInfo(int.MaxValue)); } [Test] @@ -76,14 +76,14 @@ private void ValidateEpisodes(List episodes) episodeGroup.Should().OnlyContain(c => c.Count() == 1); episodes.Should().Contain(c => c.SeasonNumber > 0); - episodes.Should().Contain(c => !String.IsNullOrWhiteSpace(c.Overview)); + episodes.Should().Contain(c => !string.IsNullOrWhiteSpace(c.Overview)); foreach (var episode in episodes) { ValidateEpisode(episode); //if atleast one episdoe has title it means parse it working. - episodes.Should().Contain(c => !String.IsNullOrWhiteSpace(c.Title)); + episodes.Should().Contain(c => !string.IsNullOrWhiteSpace(c.Title)); } } diff --git a/src/NzbDrone.Core.Test/NotificationTests/PlexClientServiceTest.cs b/src/NzbDrone.Core.Test/NotificationTests/PlexClientServiceTest.cs index ee21a6e6a..754365ec8 100644 --- a/src/NzbDrone.Core.Test/NotificationTests/PlexClientServiceTest.cs +++ b/src/NzbDrone.Core.Test/NotificationTests/PlexClientServiceTest.cs @@ -36,7 +36,7 @@ public void Notify_should_send_notification() const string header = "Test Header"; const string message = "Test Message"; - var expectedUrl = String.Format("http://localhost:3000/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification({0}, {1}))", header, message); + var expectedUrl = string.Format("http://localhost:3000/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification({0}, {1}))", header, message); var fakeHttp = Mocker.GetMock(); fakeHttp.Setup(s => s.DownloadString(expectedUrl)) @@ -57,7 +57,7 @@ public void Notify_should_send_notification_with_credentials_when_configured() const string header = "Test Header"; const string message = "Test Message"; - var expectedUrl = String.Format("http://localhost:3000/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification({0}, {1}))", header, message); + var expectedUrl = string.Format("http://localhost:3000/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification({0}, {1}))", header, message); var fakeHttp = Mocker.GetMock(); fakeHttp.Setup(s => s.DownloadString(expectedUrl, "plex", "plex")) diff --git a/src/NzbDrone.Core.Test/NotificationTests/Xbmc/Http/ActivePlayersFixture.cs b/src/NzbDrone.Core.Test/NotificationTests/Xbmc/Http/ActivePlayersFixture.cs index db6b0de28..14a440cf2 100644 --- a/src/NzbDrone.Core.Test/NotificationTests/Xbmc/Http/ActivePlayersFixture.cs +++ b/src/NzbDrone.Core.Test/NotificationTests/Xbmc/Http/ActivePlayersFixture.cs @@ -46,7 +46,7 @@ public void Setup() UpdateLibrary = true }; - _expectedUrl = String.Format("http://{0}/xbmcCmds/xbmcHttp?command={1}", _settings.Address, "getcurrentlyplaying"); + _expectedUrl = string.Format("http://{0}/xbmcCmds/xbmcHttp?command={1}", _settings.Address, "getcurrentlyplaying"); } [Test] diff --git a/src/NzbDrone.Core.Test/NotificationTests/Xbmc/Http/CheckForErrorFixture.cs b/src/NzbDrone.Core.Test/NotificationTests/Xbmc/Http/CheckForErrorFixture.cs index a7b70909b..220034a14 100644 --- a/src/NzbDrone.Core.Test/NotificationTests/Xbmc/Http/CheckForErrorFixture.cs +++ b/src/NzbDrone.Core.Test/NotificationTests/Xbmc/Http/CheckForErrorFixture.cs @@ -20,7 +20,7 @@ public void should_be_true_when_the_response_contains_an_error() [Test] public void JsonError_true_empty_response() { - var response = String.Empty; + var response = string.Empty; Subject.CheckForError(response).Should().BeTrue(); } diff --git a/src/NzbDrone.Core.Test/NotificationTests/Xbmc/Http/GetSeriesPathFixture.cs b/src/NzbDrone.Core.Test/NotificationTests/Xbmc/Http/GetSeriesPathFixture.cs index ecaf84c68..9be0ffe2c 100644 --- a/src/NzbDrone.Core.Test/NotificationTests/Xbmc/Http/GetSeriesPathFixture.cs +++ b/src/NzbDrone.Core.Test/NotificationTests/Xbmc/Http/GetSeriesPathFixture.cs @@ -52,7 +52,7 @@ public void Setup() public void should_get_series_path() { const string queryResult = @"smb://xbmc:xbmc@HOMESERVER/TV/30 Rock/"; - var query = String.Format("http://localhost:8080/xbmcCmds/xbmcHttp?command=QueryVideoDatabase(select path.strPath from path, tvshow, tvshowlinkpath where tvshow.c12 = 79488 and tvshowlinkpath.idShow = tvshow.idShow and tvshowlinkpath.idPath = path.idPath)"); + var query = string.Format("http://localhost:8080/xbmcCmds/xbmcHttp?command=QueryVideoDatabase(select path.strPath from path, tvshow, tvshowlinkpath where tvshow.c12 = 79488 and tvshowlinkpath.idShow = tvshow.idShow and tvshowlinkpath.idPath = path.idPath)"); Mocker.GetMock() .Setup(s => s.DownloadString(query, _settings.Username, _settings.Password)) @@ -66,7 +66,7 @@ public void should_get_series_path() public void should_get_null_for_series_path() { const string queryResult = @""; - var query = String.Format("http://localhost:8080/xbmcCmds/xbmcHttp?command=QueryVideoDatabase(select path.strPath from path, tvshow, tvshowlinkpath where tvshow.c12 = 79488 and tvshowlinkpath.idShow = tvshow.idShow and tvshowlinkpath.idPath = path.idPath)"); + var query = string.Format("http://localhost:8080/xbmcCmds/xbmcHttp?command=QueryVideoDatabase(select path.strPath from path, tvshow, tvshowlinkpath where tvshow.c12 = 79488 and tvshowlinkpath.idShow = tvshow.idShow and tvshowlinkpath.idPath = path.idPath)"); Mocker.GetMock() .Setup(s => s.DownloadString(query, _settings.Username, _settings.Password)) @@ -81,7 +81,7 @@ public void should_get_null_for_series_path() public void should_get_series_path_with_special_characters_in_it() { const string queryResult = @"smb://xbmc:xbmc@HOMESERVER/TV/Law & Order- Special Victims Unit/"; - var query = String.Format("http://localhost:8080/xbmcCmds/xbmcHttp?command=QueryVideoDatabase(select path.strPath from path, tvshow, tvshowlinkpath where tvshow.c12 = 79488 and tvshowlinkpath.idShow = tvshow.idShow and tvshowlinkpath.idPath = path.idPath)"); + var query = string.Format("http://localhost:8080/xbmcCmds/xbmcHttp?command=QueryVideoDatabase(select path.strPath from path, tvshow, tvshowlinkpath where tvshow.c12 = 79488 and tvshowlinkpath.idShow = tvshow.idShow and tvshowlinkpath.idPath = path.idPath)"); Mocker.GetMock() .Setup(s => s.DownloadString(query, _settings.Username, _settings.Password)) diff --git a/src/NzbDrone.Core.Test/NotificationTests/Xbmc/Json/UpdateFixture.cs b/src/NzbDrone.Core.Test/NotificationTests/Xbmc/Json/UpdateFixture.cs index 8258c566d..1f07252f2 100644 --- a/src/NzbDrone.Core.Test/NotificationTests/Xbmc/Json/UpdateFixture.cs +++ b/src/NzbDrone.Core.Test/NotificationTests/Xbmc/Json/UpdateFixture.cs @@ -50,7 +50,7 @@ public void should_update_using_series_path() Subject.Update(_settings, series); Mocker.GetMock() - .Verify(v => v.UpdateLibrary(_settings, It.IsAny()), Times.Once()); + .Verify(v => v.UpdateLibrary(_settings, It.IsAny()), Times.Once()); } [Test] diff --git a/src/NzbDrone.Core.Test/OrganizerTests/FileNameBuilderTests/FileNameBuilderFixture.cs b/src/NzbDrone.Core.Test/OrganizerTests/FileNameBuilderTests/FileNameBuilderFixture.cs index d53192b1a..d6062a787 100644 --- a/src/NzbDrone.Core.Test/OrganizerTests/FileNameBuilderTests/FileNameBuilderFixture.cs +++ b/src/NzbDrone.Core.Test/OrganizerTests/FileNameBuilderTests/FileNameBuilderFixture.cs @@ -623,7 +623,7 @@ public void should_replace_quality_full_with_quality_title_and_proper_only_when_ [TestCase('_')] public void should_trim_extra_separators_from_end_when_quality_proper_is_not_included(char separator) { - _namingConfig.StandardEpisodeFormat = String.Format("{{Quality{0}Title}}{0}{{Quality{0}Proper}}", separator); + _namingConfig.StandardEpisodeFormat = string.Format("{{Quality{0}Title}}{0}{{Quality{0}Proper}}", separator); Subject.BuildFileName(new List { _episode1 }, _series, _episodeFile) .Should().Be("HDTV-720p"); @@ -635,10 +635,10 @@ public void should_trim_extra_separators_from_end_when_quality_proper_is_not_inc [TestCase('_')] public void should_trim_extra_separators_from_middle_when_quality_proper_is_not_included(char separator) { - _namingConfig.StandardEpisodeFormat = String.Format("{{Quality{0}Title}}{0}{{Quality{0}Proper}}{0}{{Episode{0}Title}}", separator); + _namingConfig.StandardEpisodeFormat = string.Format("{{Quality{0}Title}}{0}{{Quality{0}Proper}}{0}{{Episode{0}Title}}", separator); Subject.BuildFileName(new List { _episode1 }, _series, _episodeFile) - .Should().Be(String.Format("HDTV-720p{0}City{0}Sushi", separator)); + .Should().Be(string.Format("HDTV-720p{0}City{0}Sushi", separator)); } [Test] diff --git a/src/NzbDrone.Core.Test/OrganizerTests/GetSeasonFolderFixture.cs b/src/NzbDrone.Core.Test/OrganizerTests/GetSeasonFolderFixture.cs index 24e7a7b2d..b971305a8 100644 --- a/src/NzbDrone.Core.Test/OrganizerTests/GetSeasonFolderFixture.cs +++ b/src/NzbDrone.Core.Test/OrganizerTests/GetSeasonFolderFixture.cs @@ -23,7 +23,7 @@ public void Setup() [TestCase("Venture Bros.", 1, "{Series.Title}.{season:00}", "Venture.Bros.01")] [TestCase("Venture Bros.", 1, "{Series Title} Season {season:00}", "Venture Bros. Season 01")] - public void should_use_seriesFolderFormat_to_build_folder_name(String seriesTitle, Int32 seasonNumber, String format, String expected) + public void should_use_seriesFolderFormat_to_build_folder_name(string seriesTitle, int seasonNumber, string format, string expected) { namingConfig.SeasonFolderFormat = format; diff --git a/src/NzbDrone.Core.Test/OrganizerTests/GetSeriesFolderFixture.cs b/src/NzbDrone.Core.Test/OrganizerTests/GetSeriesFolderFixture.cs index 3108cb438..538a79e09 100644 --- a/src/NzbDrone.Core.Test/OrganizerTests/GetSeriesFolderFixture.cs +++ b/src/NzbDrone.Core.Test/OrganizerTests/GetSeriesFolderFixture.cs @@ -28,7 +28,7 @@ public void Setup() [TestCase("Venture Bros.", "{Series.Title}", "Venture.Bros")] [TestCase(".hack", "{Series.Title}", "hack")] [TestCase("30 Rock", ".{Series.Title}.", "30.Rock")] - public void should_use_seriesFolderFormat_to_build_folder_name(String seriesTitle, String format, String expected) + public void should_use_seriesFolderFormat_to_build_folder_name(string seriesTitle, string format, string expected) { namingConfig.SeriesFolderFormat = format; diff --git a/src/NzbDrone.Core.Test/ParserTests/AbsoluteEpisodeNumberParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/AbsoluteEpisodeNumberParserFixture.cs index d280a51cf..6c4b566dc 100644 --- a/src/NzbDrone.Core.Test/ParserTests/AbsoluteEpisodeNumberParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/AbsoluteEpisodeNumberParserFixture.cs @@ -97,7 +97,7 @@ public void should_parse_absolute_numbers(string postTitle, string title, int ab [TestCase("[DeadFish] Kenzen Robo Daimidaler - 01 - Special [BD][720p][AAC]", "Kenzen Robo Daimidaler", 1)] [TestCase("[DeadFish] Kenzen Robo Daimidaler - 01 - OVA [BD][720p][AAC]", "Kenzen Robo Daimidaler", 1)] [TestCase("[DeadFish] Kenzen Robo Daimidaler - 01 - OVD [BD][720p][AAC]", "Kenzen Robo Daimidaler", 1)] - public void should_parse_absolute_specials(String postTitle, String title, Int32 absoluteEpisodeNumber) + public void should_parse_absolute_specials(string postTitle, string title, int absoluteEpisodeNumber) { var result = Parser.Parser.ParseTitle(postTitle); result.Should().NotBeNull(); diff --git a/src/NzbDrone.Core.Test/ParserTests/ExtendedQualityParserRegex.cs b/src/NzbDrone.Core.Test/ParserTests/ExtendedQualityParserRegex.cs index 4bba3a93f..788b7b410 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ExtendedQualityParserRegex.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ExtendedQualityParserRegex.cs @@ -22,7 +22,7 @@ public class ExtendedQualityParserRegex : CoreTest [TestCase("[Hatsuyuki] Tokyo Ghoul - 07 [v2][848x480][23D8F455].avi", 0)] [TestCase("[DeadFish] Barakamon - 01v3 [720p][AAC]", 0)] [TestCase("[DeadFish] Momo Kyun Sword - 01v4 [720p][AAC]", 0)] - public void should_parse_reality_from_title(String title, Int32 reality) + public void should_parse_reality_from_title(string title, int reality) { //TODO: re-enable this when we have a reliable way to determine real //QualityParser.ParseQuality(title).Revision.Real.Should().Be(reality); @@ -41,7 +41,7 @@ public void should_parse_reality_from_title(String title, Int32 reality) [TestCase("[Hatsuyuki] Tokyo Ghoul - 07 [v2][848x480][23D8F455].avi", 2)] [TestCase("[DeadFish] Barakamon - 01v3 [720p][AAC]", 3)] [TestCase("[DeadFish] Momo Kyun Sword - 01v4 [720p][AAC]", 4)] - public void should_parse_version_from_title(String title, Int32 version) + public void should_parse_version_from_title(string title, int version) { QualityParser.ParseQuality(title).Revision.Version.Should().Be(version); } diff --git a/src/NzbDrone.Core.Test/ParserTests/MiniSeriesEpisodeParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/MiniSeriesEpisodeParserFixture.cs index 4c69fbf41..6f8978be3 100644 --- a/src/NzbDrone.Core.Test/ParserTests/MiniSeriesEpisodeParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/MiniSeriesEpisodeParserFixture.cs @@ -16,7 +16,7 @@ public class MiniSeriesEpisodeParserFixture : CoreTest [TestCase("Hatfields and McCoys 2012 Part 1 REPACK 720p HDTV x264 2HD", "Hatfields and McCoys 2012", 1)] // [TestCase("Band.Of.Brothers.EP02.Day.Of.Days.DVDRiP.XviD-DEiTY", "Band.Of.Brothers", 2)] // [TestCase("", "", 0, 0)] - public void should_parse_mini_series_episode(String postTitle, String title, Int32 episodeNumber) + public void should_parse_mini_series_episode(string postTitle, string title, int episodeNumber) { var result = Parser.Parser.ParseTitle(postTitle); result.Should().NotBeNull(); diff --git a/src/NzbDrone.Core.Test/ParserTests/NormalizeTitleFixture.cs b/src/NzbDrone.Core.Test/ParserTests/NormalizeTitleFixture.cs index d78914997..5e7886867 100644 --- a/src/NzbDrone.Core.Test/ParserTests/NormalizeTitleFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/NormalizeTitleFixture.cs @@ -51,7 +51,7 @@ public void should_remove_common_words(string word) foreach (var s in dirtyFormat) { - var dirty = String.Format(s, word); + var dirty = string.Format(s, word); dirty.CleanSeriesTitle().Should().Be("wordword"); } } @@ -68,7 +68,7 @@ public void should_remove_a_from_middle_of_title() foreach (var s in dirtyFormat) { - var dirty = String.Format(s, "a"); + var dirty = string.Format(s, "a"); dirty.CleanSeriesTitle().Should().Be("wordword"); } } @@ -93,7 +93,7 @@ public void should_not_remove_common_words_in_the_middle_of_word(string word) foreach (var s in dirtyFormat) { - var dirty = String.Format(s, word); + var dirty = string.Format(s, word); dirty.CleanSeriesTitle().Should().Be(("word" + word.ToLower() + "word")); } @@ -125,7 +125,7 @@ public void should_not_clean_word_from_beginning_of_string(string word) foreach (var s in dirtyFormat) { - var dirty = String.Format(s, word); + var dirty = string.Format(s, word); dirty.CleanSeriesTitle().Should().Be(word + "wordword"); } } diff --git a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs index cf875d2ea..141084841 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs @@ -37,7 +37,7 @@ public class ParserFixture : CoreTest [TestCase("Match of the Day 2", "matchday2")] [TestCase("[ www.Torrenting.com ] - Revenge.S03E14.720p.HDTV.X264-DIMENSION", "Revenge")] [TestCase("Seed S02E09 HDTV x264-2HD [eztv]-[rarbg.com]", "Seed")] - public void should_parse_series_name(String postTitle, String title) + public void should_parse_series_name(string postTitle, string title) { var result = Parser.Parser.ParseSeriesName(postTitle).CleanSeriesTitle(); result.Should().Be(title.CleanSeriesTitle()); @@ -46,19 +46,19 @@ public void should_parse_series_name(String postTitle, String title) [Test] public void should_remove_accents_from_title() { - const String title = "Carnivàle"; + const string title = "Carnivàle"; title.CleanSeriesTitle().Should().Be("carnivale"); } [TestCase("Discovery TV - Gold Rush : 02 Road From Hell [S04].mp4")] - public void should_clean_up_invalid_path_characters(String postTitle) + public void should_clean_up_invalid_path_characters(string postTitle) { Parser.Parser.ParseTitle(postTitle); } [TestCase("[scnzbefnet][509103] 2.Broke.Girls.S03E18.720p.HDTV.X264-DIMENSION", "2 Broke Girls")] - public void should_remove_request_info_from_title(String postTitle, String title) + public void should_remove_request_info_from_title(string postTitle, string title) { Parser.Parser.ParseTitle(postTitle).SeriesTitle.Should().Be(title); } diff --git a/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/GetEpisodesFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/GetEpisodesFixture.cs index 41474a8a6..898f70cb7 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/GetEpisodesFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/GetEpisodesFixture.cs @@ -52,7 +52,7 @@ public void Setup() }; Mocker.GetMock() - .Setup(s => s.FindByTitle(It.IsAny())) + .Setup(s => s.FindByTitle(It.IsAny())) .Returns(_series); } @@ -85,7 +85,7 @@ public void should_get_daily_episode_episode_when_search_criteria_is_null() Subject.Map(_parsedEpisodeInfo, _series.TvRageId); Mocker.GetMock() - .Verify(v => v.FindEpisode(It.IsAny(), It.IsAny()), Times.Once()); + .Verify(v => v.FindEpisode(It.IsAny(), It.IsAny()), Times.Once()); } [Test] @@ -97,7 +97,7 @@ public void should_use_search_criteria_episode_when_it_matches_daily() Subject.Map(_parsedEpisodeInfo, _series.TvRageId, _singleEpisodeSearchCriteria); Mocker.GetMock() - .Verify(v => v.FindEpisode(It.IsAny(), It.IsAny()), Times.Never()); + .Verify(v => v.FindEpisode(It.IsAny(), It.IsAny()), Times.Never()); } [Test] @@ -109,7 +109,7 @@ public void should_fallback_to_daily_episode_lookup_when_search_criteria_episode Subject.Map(_parsedEpisodeInfo, _series.TvRageId, _singleEpisodeSearchCriteria); Mocker.GetMock() - .Verify(v => v.FindEpisode(It.IsAny(), It.IsAny()), Times.Once()); + .Verify(v => v.FindEpisode(It.IsAny(), It.IsAny()), Times.Once()); } [Test] @@ -120,7 +120,7 @@ public void should_use_search_criteria_episode_when_it_matches_absolute() Subject.Map(_parsedEpisodeInfo, _series.TvRageId, _singleEpisodeSearchCriteria); Mocker.GetMock() - .Verify(v => v.FindEpisode(It.IsAny(), It.IsAny()), Times.Never()); + .Verify(v => v.FindEpisode(It.IsAny(), It.IsAny()), Times.Never()); } [Test] @@ -131,7 +131,7 @@ public void should_use_scene_numbering_when_series_uses_scene_numbering() Subject.Map(_parsedEpisodeInfo, _series.TvRageId); Mocker.GetMock() - .Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny(), It.IsAny(), It.IsAny()), Times.Once()); + .Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny(), It.IsAny(), It.IsAny()), Times.Once()); } [Test] @@ -142,7 +142,7 @@ public void should_match_search_criteria_by_scene_numbering() Subject.Map(_parsedEpisodeInfo, _series.TvRageId, _singleEpisodeSearchCriteria); Mocker.GetMock() - .Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny(), It.IsAny(), It.IsAny()), Times.Never()); + .Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny(), It.IsAny(), It.IsAny()), Times.Never()); } [Test] @@ -154,7 +154,7 @@ public void should_fallback_to_findEpisode_when_search_criteria_match_fails_for_ Subject.Map(_parsedEpisodeInfo, _series.TvRageId, _singleEpisodeSearchCriteria); Mocker.GetMock() - .Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny(), It.IsAny(), It.IsAny()), Times.Once()); + .Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny(), It.IsAny(), It.IsAny()), Times.Once()); } [Test] @@ -163,7 +163,7 @@ public void should_find_episode() Subject.Map(_parsedEpisodeInfo, _series.TvRageId); Mocker.GetMock() - .Verify(v => v.FindEpisode(It.IsAny(), It.IsAny(), It.IsAny()), Times.Once()); + .Verify(v => v.FindEpisode(It.IsAny(), It.IsAny(), It.IsAny()), Times.Once()); } [Test] @@ -172,7 +172,7 @@ public void should_match_episode_with_search_criteria() Subject.Map(_parsedEpisodeInfo, _series.TvRageId, _singleEpisodeSearchCriteria); Mocker.GetMock() - .Verify(v => v.FindEpisode(It.IsAny(), It.IsAny(), It.IsAny()), Times.Never()); + .Verify(v => v.FindEpisode(It.IsAny(), It.IsAny(), It.IsAny()), Times.Never()); } [Test] @@ -183,7 +183,7 @@ public void should_fallback_to_findEpisode_when_search_criteria_match_fails() Subject.Map(_parsedEpisodeInfo, _series.TvRageId, _singleEpisodeSearchCriteria); Mocker.GetMock() - .Verify(v => v.FindEpisode(It.IsAny(), It.IsAny(), It.IsAny()), Times.Once()); + .Verify(v => v.FindEpisode(It.IsAny(), It.IsAny(), It.IsAny()), Times.Once()); } [Test] @@ -196,10 +196,10 @@ public void should_look_for_episode_in_season_zero_if_absolute_special() Subject.GetEpisodes(_parsedEpisodeInfo, _series, true, null); Mocker.GetMock() - .Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny(), 0, It.IsAny()), Times.Never()); + .Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny(), 0, It.IsAny()), Times.Never()); Mocker.GetMock() - .Verify(v => v.FindEpisode(It.IsAny(), 0, It.IsAny()), Times.Once()); + .Verify(v => v.FindEpisode(It.IsAny(), 0, It.IsAny()), Times.Once()); } [TestCase(0)] @@ -214,16 +214,16 @@ public void should_use_scene_numbering_when_scene_season_number_has_value(int se .Returns(seasonNumber); Mocker.GetMock() - .Setup(s => s.FindEpisodesBySceneNumbering(It.IsAny(), seasonNumber, It.IsAny())) + .Setup(s => s.FindEpisodesBySceneNumbering(It.IsAny(), seasonNumber, It.IsAny())) .Returns(new List()); Subject.GetEpisodes(_parsedEpisodeInfo, _series, true, null); Mocker.GetMock() - .Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny(), seasonNumber, It.IsAny()), Times.Once()); + .Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny(), seasonNumber, It.IsAny()), Times.Once()); Mocker.GetMock() - .Verify(v => v.FindEpisode(It.IsAny(), seasonNumber, It.IsAny()), Times.Once()); + .Verify(v => v.FindEpisode(It.IsAny(), seasonNumber, It.IsAny()), Times.Once()); } [TestCase(0)] @@ -238,16 +238,16 @@ public void should_find_episode_by_season_and_scene_absolute_episode_number(int .Returns(seasonNumber); Mocker.GetMock() - .Setup(s => s.FindEpisodesBySceneNumbering(It.IsAny(), seasonNumber, It.IsAny())) + .Setup(s => s.FindEpisodesBySceneNumbering(It.IsAny(), seasonNumber, It.IsAny())) .Returns(new List { _episodes.First() }); Subject.GetEpisodes(_parsedEpisodeInfo, _series, true, null); Mocker.GetMock() - .Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny(), seasonNumber, It.IsAny()), Times.Once()); + .Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny(), seasonNumber, It.IsAny()), Times.Once()); Mocker.GetMock() - .Verify(v => v.FindEpisode(It.IsAny(), seasonNumber, It.IsAny()), Times.Never()); + .Verify(v => v.FindEpisode(It.IsAny(), seasonNumber, It.IsAny()), Times.Never()); } [TestCase(0)] @@ -262,16 +262,16 @@ public void should_find_episode_by_season_and_absolute_episode_number_when_scene .Returns(seasonNumber); Mocker.GetMock() - .Setup(s => s.FindEpisodesBySceneNumbering(It.IsAny(), seasonNumber, It.IsAny())) + .Setup(s => s.FindEpisodesBySceneNumbering(It.IsAny(), seasonNumber, It.IsAny())) .Returns(Builder.CreateListOfSize(5).Build().ToList()); Subject.GetEpisodes(_parsedEpisodeInfo, _series, true, null); Mocker.GetMock() - .Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny(), seasonNumber, It.IsAny()), Times.Once()); + .Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny(), seasonNumber, It.IsAny()), Times.Once()); Mocker.GetMock() - .Verify(v => v.FindEpisode(It.IsAny(), seasonNumber, It.IsAny()), Times.Once()); + .Verify(v => v.FindEpisode(It.IsAny(), seasonNumber, It.IsAny()), Times.Once()); } } } diff --git a/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/MapFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/MapFixture.cs index bb9aa5f7c..c237f5d46 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/MapFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/MapFixture.cs @@ -55,14 +55,14 @@ public void Setup() private void GivenMatchBySeriesTitle() { Mocker.GetMock() - .Setup(s => s.FindByTitle(It.IsAny())) + .Setup(s => s.FindByTitle(It.IsAny())) .Returns(_series); } private void GivenMatchByTvRageId() { Mocker.GetMock() - .Setup(s => s.FindByTvRageId(It.IsAny())) + .Setup(s => s.FindByTvRageId(It.IsAny())) .Returns(_series); } @@ -79,7 +79,7 @@ public void should_lookup_series_by_name() Subject.Map(_parsedEpisodeInfo, _series.TvRageId); Mocker.GetMock() - .Verify(v => v.FindByTitle(It.IsAny()), Times.Once()); + .Verify(v => v.FindByTitle(It.IsAny()), Times.Once()); } [Test] @@ -90,7 +90,7 @@ public void should_use_tvrageid_when_series_title_lookup_fails() Subject.Map(_parsedEpisodeInfo, _series.TvRageId); Mocker.GetMock() - .Verify(v => v.FindByTvRageId(It.IsAny()), Times.Once()); + .Verify(v => v.FindByTvRageId(It.IsAny()), Times.Once()); } [Test] @@ -105,7 +105,7 @@ public void should_not_use_tvrageid_when_scene_naming_exception_exists() var result = Subject.Map(_parsedEpisodeInfo, _series.TvRageId); Mocker.GetMock() - .Verify(v => v.FindByTvRageId(It.IsAny()), Times.Never()); + .Verify(v => v.FindByTvRageId(It.IsAny()), Times.Never()); result.Series.Should().BeNull(); } @@ -118,7 +118,7 @@ public void should_use_search_criteria_series_title() Subject.Map(_parsedEpisodeInfo, _series.TvRageId, _singleEpisodeSearchCriteria); Mocker.GetMock() - .Verify(v => v.FindByTitle(It.IsAny()), Times.Never()); + .Verify(v => v.FindByTitle(It.IsAny()), Times.Never()); } [Test] @@ -129,7 +129,7 @@ public void should_FindByTitle_when_search_criteria_matching_fails() Subject.Map(_parsedEpisodeInfo, 10, _singleEpisodeSearchCriteria); Mocker.GetMock() - .Verify(v => v.FindByTitle(It.IsAny()), Times.Once()); + .Verify(v => v.FindByTitle(It.IsAny()), Times.Once()); } [Test] @@ -140,20 +140,20 @@ public void should_FindByTvRageId_when_search_criteria_and_FindByTitle_matching_ Subject.Map(_parsedEpisodeInfo, 10, _singleEpisodeSearchCriteria); Mocker.GetMock() - .Verify(v => v.FindByTvRageId(It.IsAny()), Times.Once()); + .Verify(v => v.FindByTvRageId(It.IsAny()), Times.Once()); } [Test] public void should_use_tvdbid_matching_when_alias_is_found() { Mocker.GetMock() - .Setup(s => s.FindTvdbId(It.IsAny())) + .Setup(s => s.FindTvdbId(It.IsAny())) .Returns(_series.TvdbId); Subject.Map(_parsedEpisodeInfo, _series.TvRageId, _singleEpisodeSearchCriteria); Mocker.GetMock() - .Verify(v => v.FindByTitle(It.IsAny()), Times.Never()); + .Verify(v => v.FindByTitle(It.IsAny()), Times.Never()); } [Test] @@ -164,7 +164,7 @@ public void should_use_tvrageid_match_from_search_criteria_when_title_match_fail Subject.Map(_parsedEpisodeInfo, _series.TvRageId, _singleEpisodeSearchCriteria); Mocker.GetMock() - .Verify(v => v.FindByTitle(It.IsAny()), Times.Never()); + .Verify(v => v.FindByTitle(It.IsAny()), Times.Never()); } } } diff --git a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs index eeafca9d8..dee8e0926 100644 --- a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs @@ -212,7 +212,7 @@ public void quality_parse(string title, bool proper) [Test, TestCaseSource("SelfQualityParserCases")] public void parsing_our_own_quality_enum_name(Quality quality) { - var fileName = String.Format("My series S01E01 [{0}]", quality.Name); + var fileName = string.Format("My series S01E01 [{0}]", quality.Name); var result = QualityParser.ParseQuality(fileName); result.Quality.Should().Be(quality); } @@ -222,7 +222,7 @@ public void should_parse_quality_from_other_source(string qualityString, Quality { foreach (var c in new char[] { '-', '.', ' ', '_' }) { - var title = String.Format("My series S01E01 {0}", qualityString.Replace(' ', c)); + var title = string.Format("My series S01E01 {0}", qualityString.Replace(' ', c)); ParseAndVerifyQuality(title, quality, false); } diff --git a/src/NzbDrone.Core.Test/ProviderTests/DiskScanProviderTests/GetVideoFilesFixture.cs b/src/NzbDrone.Core.Test/ProviderTests/DiskScanProviderTests/GetVideoFilesFixture.cs index 49129ac69..977487adc 100644 --- a/src/NzbDrone.Core.Test/ProviderTests/DiskScanProviderTests/GetVideoFilesFixture.cs +++ b/src/NzbDrone.Core.Test/ProviderTests/DiskScanProviderTests/GetVideoFilesFixture.cs @@ -33,7 +33,7 @@ public void Setup() private void GivenFiles() { Mocker.GetMock() - .Setup(s => s.GetFiles(It.IsAny(), SearchOption.AllDirectories)) + .Setup(s => s.GetFiles(It.IsAny(), SearchOption.AllDirectories)) .Returns(_files); } diff --git a/src/NzbDrone.Core.Test/ProviderTests/RecycleBinProviderTests/CleanupFixture.cs b/src/NzbDrone.Core.Test/ProviderTests/RecycleBinProviderTests/CleanupFixture.cs index ca1152b8f..4080b6d05 100644 --- a/src/NzbDrone.Core.Test/ProviderTests/RecycleBinProviderTests/CleanupFixture.cs +++ b/src/NzbDrone.Core.Test/ProviderTests/RecycleBinProviderTests/CleanupFixture.cs @@ -17,19 +17,19 @@ public class CleanupFixture : CoreTest private void WithExpired() { - Mocker.GetMock().Setup(s => s.FolderGetLastWrite(It.IsAny())) + Mocker.GetMock().Setup(s => s.FolderGetLastWrite(It.IsAny())) .Returns(DateTime.UtcNow.AddDays(-10)); - Mocker.GetMock().Setup(s => s.FileGetLastWrite(It.IsAny())) + Mocker.GetMock().Setup(s => s.FileGetLastWrite(It.IsAny())) .Returns(DateTime.UtcNow.AddDays(-10)); } private void WithNonExpired() { - Mocker.GetMock().Setup(s => s.FolderGetLastWrite(It.IsAny())) + Mocker.GetMock().Setup(s => s.FolderGetLastWrite(It.IsAny())) .Returns(DateTime.UtcNow.AddDays(-3)); - Mocker.GetMock().Setup(s => s.FileGetLastWrite(It.IsAny())) + Mocker.GetMock().Setup(s => s.FileGetLastWrite(It.IsAny())) .Returns(DateTime.UtcNow.AddDays(-3)); } @@ -48,11 +48,11 @@ public void Setup() [Test] public void should_return_if_recycleBin_not_configured() { - Mocker.GetMock().SetupGet(s => s.RecycleBin).Returns(String.Empty); + Mocker.GetMock().SetupGet(s => s.RecycleBin).Returns(string.Empty); Mocker.Resolve().Cleanup(); - Mocker.GetMock().Verify(v => v.GetDirectories(It.IsAny()), Times.Never()); + Mocker.GetMock().Verify(v => v.GetDirectories(It.IsAny()), Times.Never()); } [Test] @@ -61,7 +61,7 @@ public void should_delete_all_expired_folders() WithExpired(); Mocker.Resolve().Cleanup(); - Mocker.GetMock().Verify(v => v.DeleteFolder(It.IsAny(), true), Times.Exactly(3)); + Mocker.GetMock().Verify(v => v.DeleteFolder(It.IsAny(), true), Times.Exactly(3)); } [Test] @@ -70,7 +70,7 @@ public void should_delete_all_expired_files() WithExpired(); Mocker.Resolve().Cleanup(); - Mocker.GetMock().Verify(v => v.DeleteFile(It.IsAny()), Times.Exactly(2)); + Mocker.GetMock().Verify(v => v.DeleteFile(It.IsAny()), Times.Exactly(2)); } [Test] @@ -79,7 +79,7 @@ public void should_not_delete_all_non_expired_folders() WithNonExpired(); Mocker.Resolve().Cleanup(); - Mocker.GetMock().Verify(v => v.DeleteFolder(It.IsAny(), true), Times.Never()); + Mocker.GetMock().Verify(v => v.DeleteFolder(It.IsAny(), true), Times.Never()); } [Test] @@ -88,7 +88,7 @@ public void should_not_delete_all_non_expired_files() WithNonExpired(); Mocker.Resolve().Cleanup(); - Mocker.GetMock().Verify(v => v.DeleteFile(It.IsAny()), Times.Never()); + Mocker.GetMock().Verify(v => v.DeleteFile(It.IsAny()), Times.Never()); } } } diff --git a/src/NzbDrone.Core.Test/ProviderTests/RecycleBinProviderTests/DeleteDirectoryFixture.cs b/src/NzbDrone.Core.Test/ProviderTests/RecycleBinProviderTests/DeleteDirectoryFixture.cs index 35130a6ea..5ff398d62 100644 --- a/src/NzbDrone.Core.Test/ProviderTests/RecycleBinProviderTests/DeleteDirectoryFixture.cs +++ b/src/NzbDrone.Core.Test/ProviderTests/RecycleBinProviderTests/DeleteDirectoryFixture.cs @@ -21,7 +21,7 @@ private void WithRecycleBin() private void WithoutRecycleBin() { - Mocker.GetMock().SetupGet(s => s.RecycleBin).Returns(String.Empty); + Mocker.GetMock().SetupGet(s => s.RecycleBin).Returns(string.Empty); } [Test] @@ -73,7 +73,7 @@ public void should_call_fileSetLastWriteTime_for_each_file() Mocker.Resolve().DeleteFolder(path); - Mocker.GetMock().Verify(v => v.FileSetLastWriteTime(It.IsAny(), It.IsAny()), Times.Exactly(3)); + Mocker.GetMock().Verify(v => v.FileSetLastWriteTime(It.IsAny(), It.IsAny()), Times.Exactly(3)); } } } diff --git a/src/NzbDrone.Core.Test/ProviderTests/RecycleBinProviderTests/DeleteFileFixture.cs b/src/NzbDrone.Core.Test/ProviderTests/RecycleBinProviderTests/DeleteFileFixture.cs index 47cd20876..3adb28208 100644 --- a/src/NzbDrone.Core.Test/ProviderTests/RecycleBinProviderTests/DeleteFileFixture.cs +++ b/src/NzbDrone.Core.Test/ProviderTests/RecycleBinProviderTests/DeleteFileFixture.cs @@ -20,7 +20,7 @@ private void WithRecycleBin() private void WithoutRecycleBin() { - Mocker.GetMock().SetupGet(s => s.RecycleBin).Returns(String.Empty); + Mocker.GetMock().SetupGet(s => s.RecycleBin).Returns(string.Empty); } [Test] diff --git a/src/NzbDrone.Core.Test/ProviderTests/RecycleBinProviderTests/EmptyFixture.cs b/src/NzbDrone.Core.Test/ProviderTests/RecycleBinProviderTests/EmptyFixture.cs index c48d98c08..173e1d8d1 100644 --- a/src/NzbDrone.Core.Test/ProviderTests/RecycleBinProviderTests/EmptyFixture.cs +++ b/src/NzbDrone.Core.Test/ProviderTests/RecycleBinProviderTests/EmptyFixture.cs @@ -32,11 +32,11 @@ public void Setup() [Test] public void should_return_if_recycleBin_not_configured() { - Mocker.GetMock().SetupGet(s => s.RecycleBin).Returns(String.Empty); + Mocker.GetMock().SetupGet(s => s.RecycleBin).Returns(string.Empty); Mocker.Resolve().Empty(); - Mocker.GetMock().Verify(v => v.GetDirectories(It.IsAny()), Times.Never()); + Mocker.GetMock().Verify(v => v.GetDirectories(It.IsAny()), Times.Never()); } [Test] @@ -44,7 +44,7 @@ public void should_delete_all_folders() { Mocker.Resolve().Empty(); - Mocker.GetMock().Verify(v => v.DeleteFolder(It.IsAny(), true), Times.Exactly(3)); + Mocker.GetMock().Verify(v => v.DeleteFolder(It.IsAny(), true), Times.Exactly(3)); } [Test] @@ -52,7 +52,7 @@ public void should_delete_all_files() { Mocker.Resolve().Empty(); - Mocker.GetMock().Verify(v => v.DeleteFile(It.IsAny()), Times.Exactly(2)); + Mocker.GetMock().Verify(v => v.DeleteFile(It.IsAny()), Times.Exactly(2)); } } } diff --git a/src/NzbDrone.Core.Test/RemotePathMappingsTests/RemotePathMappingServiceFixture.cs b/src/NzbDrone.Core.Test/RemotePathMappingsTests/RemotePathMappingServiceFixture.cs index eb641df22..b041e1dfe 100644 --- a/src/NzbDrone.Core.Test/RemotePathMappingsTests/RemotePathMappingServiceFixture.cs +++ b/src/NzbDrone.Core.Test/RemotePathMappingsTests/RemotePathMappingServiceFixture.cs @@ -53,7 +53,7 @@ private void WithNonExistingFolder() [TestCase("my-first-server.localdomain", "/mnt/storage", @"D:\storage1")] [TestCase("my-server.localdomain", "/mnt/storage2", @"D:\storage2")] - public void should_be_able_to_add_new_mapping(String host, String remotePath, String localPath) + public void should_be_able_to_add_new_mapping(string host, string remotePath, string localPath) { GivenMapping(); @@ -75,7 +75,7 @@ public void should_be_able_to_remove_mapping() [TestCase("my-server.localdomain", "/mnt/storage", @"D:\mountedstorage")] [TestCase("my-server.localdomain", "/mnt/storage", @"D:\mountedstorage2")] - public void adding_duplicated_mapping_should_throw(String host, String remotePath, String localPath) + public void adding_duplicated_mapping_should_throw(string host, string remotePath, string localPath) { localPath = localPath.AsOsAgnostic(); @@ -89,7 +89,7 @@ public void adding_duplicated_mapping_should_throw(String host, String remotePat [TestCase("my-server.localdomain", "/mnt/storage/downloads/tv", @"D:\mountedstorage\downloads\tv")] [TestCase("my-2server.localdomain", "/mnt/storage/downloads/tv", "/mnt/storage/downloads/tv")] [TestCase("my-server.localdomain", "/mnt/storageabc/downloads/tv", "/mnt/storageabc/downloads/tv")] - public void should_remap_remote_to_local(String host, String remotePath, String expectedLocalPath) + public void should_remap_remote_to_local(string host, string remotePath, string expectedLocalPath) { expectedLocalPath = expectedLocalPath.AsOsAgnostic(); @@ -104,7 +104,7 @@ public void should_remap_remote_to_local(String host, String remotePath, String [TestCase("my-server.localdomain", "/mnt/storage/", @"D:\mountedstorage")] [TestCase("my-2server.localdomain", "/mnt/storage/downloads/tv", "/mnt/storage/downloads/tv")] [TestCase("my-server.localdomain", "/mnt/storageabc/downloads/tv", "/mnt/storageabc/downloads/tv")] - public void should_remap_local_to_remote(String host, String expectedRemotePath, String localPath) + public void should_remap_local_to_remote(string host, string expectedRemotePath, string localPath) { localPath = localPath.AsOsAgnostic(); @@ -118,7 +118,7 @@ public void should_remap_local_to_remote(String host, String expectedRemotePath, [TestCase(@"\\server\share\with/mixed/slashes", @"\\server\share\with\mixed\slashes\")] [TestCase(@"D:/with/forward/slashes", @"D:\with\forward\slashes\")] [TestCase(@"D:/with/mixed\slashes", @"D:\with\mixed\slashes\")] - public void should_fix_wrong_slashes_on_add(String remotePath, String cleanedPath) + public void should_fix_wrong_slashes_on_add(string remotePath, string cleanedPath) { GivenMapping(); diff --git a/src/NzbDrone.Core.Test/TvTests/MoveSeriesServiceFixture.cs b/src/NzbDrone.Core.Test/TvTests/MoveSeriesServiceFixture.cs index 795bcadb6..8939a3688 100644 --- a/src/NzbDrone.Core.Test/TvTests/MoveSeriesServiceFixture.cs +++ b/src/NzbDrone.Core.Test/TvTests/MoveSeriesServiceFixture.cs @@ -33,14 +33,14 @@ public void Setup() }; Mocker.GetMock() - .Setup(s => s.GetSeries(It.IsAny())) + .Setup(s => s.GetSeries(It.IsAny())) .Returns(_series); } private void GivenFailedMove() { Mocker.GetMock() - .Setup(s => s.TransferFolder(It.IsAny(), It.IsAny(), TransferMode.Move, true)) + .Setup(s => s.TransferFolder(It.IsAny(), It.IsAny(), TransferMode.Move, true)) .Throws(); } diff --git a/src/NzbDrone.Core.Test/TvTests/RefreshEpisodeServiceFixture.cs b/src/NzbDrone.Core.Test/TvTests/RefreshEpisodeServiceFixture.cs index e2b786716..2cf1dad4c 100644 --- a/src/NzbDrone.Core.Test/TvTests/RefreshEpisodeServiceFixture.cs +++ b/src/NzbDrone.Core.Test/TvTests/RefreshEpisodeServiceFixture.cs @@ -75,7 +75,7 @@ public void Setup() [Test] public void should_create_all_when_no_existing_episodes() { - Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) + Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) .Returns(new List()); Subject.RefreshEpisodeInfo(GetSeries(), GetEpisodes()); @@ -88,7 +88,7 @@ public void should_create_all_when_no_existing_episodes() [Test] public void should_update_all_when_all_existing_episodes() { - Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) + Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) .Returns(GetEpisodes()); Subject.RefreshEpisodeInfo(GetSeries(), GetEpisodes()); @@ -101,7 +101,7 @@ public void should_update_all_when_all_existing_episodes() [Test] public void should_delete_all_when_all_existing_episodes_are_gone_from_datasource() { - Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) + Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) .Returns(GetEpisodes()); Subject.RefreshEpisodeInfo(GetSeries(), new List()); @@ -116,7 +116,7 @@ public void should_delete_duplicated_episodes_based_on_season_episode_number() { var duplicateEpisodes = GetEpisodes().Skip(5).Take(2).ToList(); - Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) + Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) .Returns(GetEpisodes().Union(duplicateEpisodes).ToList()); Subject.RefreshEpisodeInfo(GetSeries(), GetEpisodes()); @@ -137,7 +137,7 @@ public void should_not_change_monitored_status_for_existing_episodes() episodes.ForEach(e => e.Monitored = true); - Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) + Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) .Returns(episodes); Subject.RefreshEpisodeInfo(series, GetEpisodes()); @@ -149,7 +149,7 @@ public void should_not_change_monitored_status_for_existing_episodes() [Test] public void should_remove_duplicate_remote_episodes_before_processing() { - Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) + Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) .Returns(new List()); var episodes = Builder.CreateListOfSize(5) @@ -171,7 +171,7 @@ public void should_set_absolute_episode_number_for_anime() { var episodes = Builder.CreateListOfSize(3).Build().ToList(); - Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) + Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) .Returns(new List()); Subject.RefreshEpisodeInfo(GetAnimeSeries(), episodes); @@ -189,7 +189,7 @@ public void should_set_absolute_episode_number_even_if_not_previously_set_for_an var existingEpisodes = episodes.JsonClone(); existingEpisodes.ForEach(e => e.AbsoluteEpisodeNumber = null); - Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) + Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) .Returns(existingEpisodes); Subject.RefreshEpisodeInfo(GetAnimeSeries(), episodes); @@ -202,9 +202,9 @@ public void should_set_absolute_episode_number_even_if_not_previously_set_for_an [Test] public void should_get_new_season_and_episode_numbers_when_absolute_episode_number_match_found() { - const Int32 expectedSeasonNumber = 10; - const Int32 expectedEpisodeNumber = 5; - const Int32 expectedAbsoluteNumber = 3; + const int expectedSeasonNumber = 10; + const int expectedEpisodeNumber = 5; + const int expectedAbsoluteNumber = 3; var episode = Builder.CreateNew() .With(e => e.SeasonNumber = expectedSeasonNumber) @@ -217,7 +217,7 @@ public void should_get_new_season_and_episode_numbers_when_absolute_episode_numb existingEpisode.EpisodeNumber = 1; existingEpisode.AbsoluteEpisodeNumber = expectedAbsoluteNumber; - Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) + Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) .Returns(new List{ existingEpisode }); Subject.RefreshEpisodeInfo(GetAnimeSeries(), new List { episode }); @@ -248,7 +248,7 @@ public void should_prefer_absolute_match_over_season_and_epsiode_match() AbsoluteEpisodeNumber = episodes[1].AbsoluteEpisodeNumber }; - Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) + Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) .Returns(new List { existingEpisode }); Subject.RefreshEpisodeInfo(GetAnimeSeries(), episodes); @@ -271,7 +271,7 @@ public void should_ignore_episodes_with_no_absolute_episode_in_distinct_by_absol episodes[3].AbsoluteEpisodeNumber = null; episodes[4].AbsoluteEpisodeNumber = null; - Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) + Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) .Returns(new List()); Subject.RefreshEpisodeInfo(GetAnimeSeries(), episodes); @@ -291,7 +291,7 @@ public void should_override_empty_airdate_for_direct_to_dvd() .With(v => v.AirDateUtc = null) .BuildListOfNew(); - Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) + Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) .Returns(new List()); List updateEpisodes = null; @@ -308,7 +308,7 @@ public void should_override_empty_airdate_for_direct_to_dvd() [Test] public void should_use_tba_for_episode_title_when_null() { - Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) + Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) .Returns(new List()); var episodes = Builder.CreateListOfSize(1) @@ -325,7 +325,7 @@ public void should_use_tba_for_episode_title_when_null() [Test] public void should_update_air_date_when_multiple_episodes_air_on_the_same_day() { - Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) + Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) .Returns(new List()); var series = GetSeries(); @@ -347,7 +347,7 @@ public void should_update_air_date_when_multiple_episodes_air_on_the_same_day() [Test] public void should_not_update_air_date_when_multiple_episodes_air_on_the_same_day_for_netflix() { - Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) + Mocker.GetMock().Setup(c => c.GetEpisodeBySeries(It.IsAny())) .Returns(new List()); var series = GetSeries(); diff --git a/src/NzbDrone.Core.Test/TvTests/SeriesTitleNormalizerFixture.cs b/src/NzbDrone.Core.Test/TvTests/SeriesTitleNormalizerFixture.cs index 7ce588270..a7f34af5b 100644 --- a/src/NzbDrone.Core.Test/TvTests/SeriesTitleNormalizerFixture.cs +++ b/src/NzbDrone.Core.Test/TvTests/SeriesTitleNormalizerFixture.cs @@ -22,7 +22,7 @@ public void should_use_precomputed_title(string title, int tvdbId, string expect [TestCase("The Good Wife", "good wife")] [TestCase("The Newsroom (2012)", "newsroom 2012")] [TestCase("Special Agent Oso", "special agent oso")] - public void should_normalize_title(String title, String expected) + public void should_normalize_title(string title, string expected) { SeriesTitleNormalizer.Normalize(title, 0).Should().Be(expected); } diff --git a/src/NzbDrone.Core.Test/UpdateTests/UpdateServiceFixture.cs b/src/NzbDrone.Core.Test/UpdateTests/UpdateServiceFixture.cs index 5be4abbf0..ef29fe797 100644 --- a/src/NzbDrone.Core.Test/UpdateTests/UpdateServiceFixture.cs +++ b/src/NzbDrone.Core.Test/UpdateTests/UpdateServiceFixture.cs @@ -56,7 +56,7 @@ public void Setup() Mocker.GetMock().SetupGet(c => c.AppDataFolder).Returns(@"C:\ProgramData\NzbDrone".AsOsAgnostic); Mocker.GetMock().Setup(c => c.AvailableUpdate()).Returns(_updatePackage); - Mocker.GetMock().Setup(c => c.Verify(It.IsAny(), It.IsAny())).Returns(true); + Mocker.GetMock().Setup(c => c.Verify(It.IsAny(), It.IsAny())).Returns(true); Mocker.GetMock().Setup(c => c.GetCurrentProcess()).Returns(new ProcessInfo { Id = 12 }); Mocker.GetMock().Setup(c => c.ExecutingApplication).Returns(@"C:\Test\NzbDrone.exe"); @@ -145,7 +145,7 @@ public void should_start_update_client() Subject.Execute(new ApplicationUpdateCommand()); Mocker.GetMock() - .Verify(c => c.Start(It.IsAny(), It.Is(s => s.StartsWith("12")), null, null, null), Times.Once()); + .Verify(c => c.Start(It.IsAny(), It.Is(s => s.StartsWith("12")), null, null, null), Times.Once()); } [Test] @@ -162,11 +162,11 @@ public void should_return_without_error_or_warnings_when_no_updates_are_availabl [Test] public void should_not_extract_if_verification_fails() { - Mocker.GetMock().Setup(c => c.Verify(It.IsAny(), It.IsAny())).Returns(false); + Mocker.GetMock().Setup(c => c.Verify(It.IsAny(), It.IsAny())).Returns(false); Assert.Throws(() => Subject.Execute(new ApplicationUpdateCommand())); - Mocker.GetMock().Verify(v => v.Extract(It.IsAny(), It.IsAny()), Times.Never()); + Mocker.GetMock().Verify(v => v.Extract(It.IsAny(), It.IsAny()), Times.Never()); } [Test] @@ -179,7 +179,7 @@ public void should_run_script_if_configured() Subject.Execute(new ApplicationUpdateCommand()); - Mocker.GetMock().Verify(v => v.Start(scriptPath, It.IsAny(), null, null, null), Times.Once()); + Mocker.GetMock().Verify(v => v.Start(scriptPath, It.IsAny(), null, null, null), Times.Once()); } [Test] @@ -193,7 +193,7 @@ public void should_throw_if_script_is_not_set() Assert.Throws(() => Subject.Execute(new ApplicationUpdateCommand())); ExceptionVerification.ExpectedErrors(1); - Mocker.GetMock().Verify(v => v.Start(scriptPath, It.IsAny(), null, null, null), Times.Never()); + Mocker.GetMock().Verify(v => v.Start(scriptPath, It.IsAny(), null, null, null), Times.Never()); } [Test] @@ -207,7 +207,7 @@ public void should_throw_if_script_is_null() Assert.Throws(() => Subject.Execute(new ApplicationUpdateCommand())); ExceptionVerification.ExpectedErrors(1); - Mocker.GetMock().Verify(v => v.Start(scriptPath, It.IsAny(), null, null, null), Times.Never()); + Mocker.GetMock().Verify(v => v.Start(scriptPath, It.IsAny(), null, null, null), Times.Never()); } [Test] @@ -225,7 +225,7 @@ public void should_throw_if_script_path_does_not_exist() Assert.Throws(() => Subject.Execute(new ApplicationUpdateCommand())); ExceptionVerification.ExpectedErrors(1); - Mocker.GetMock().Verify(v => v.Start(scriptPath, It.IsAny(), null, null, null), Times.Never()); + Mocker.GetMock().Verify(v => v.Start(scriptPath, It.IsAny(), null, null, null), Times.Never()); } [Test] diff --git a/src/NzbDrone.Core/Annotations/FieldDefinitionAttribute.cs b/src/NzbDrone.Core/Annotations/FieldDefinitionAttribute.cs index 4406fa73f..4e897ce68 100644 --- a/src/NzbDrone.Core/Annotations/FieldDefinitionAttribute.cs +++ b/src/NzbDrone.Core/Annotations/FieldDefinitionAttribute.cs @@ -15,7 +15,7 @@ public FieldDefinitionAttribute(int order) public string HelpText { get; set; } public string HelpLink { get; set; } public FieldType Type { get; set; } - public Boolean Advanced { get; set; } + public bool Advanced { get; set; } public Type SelectOptions { get; set; } } diff --git a/src/NzbDrone.Core/Backup/Backup.cs b/src/NzbDrone.Core/Backup/Backup.cs index 880ef6106..a4505d991 100644 --- a/src/NzbDrone.Core/Backup/Backup.cs +++ b/src/NzbDrone.Core/Backup/Backup.cs @@ -4,7 +4,7 @@ namespace NzbDrone.Core.Backup { public class Backup { - public String Path { get; set; } + public string Path { get; set; } public BackupType Type { get; set; } public DateTime Time { get; set; } } diff --git a/src/NzbDrone.Core/Backup/BackupService.cs b/src/NzbDrone.Core/Backup/BackupService.cs index c87c49cc5..8cc89d87b 100644 --- a/src/NzbDrone.Core/Backup/BackupService.cs +++ b/src/NzbDrone.Core/Backup/BackupService.cs @@ -59,7 +59,7 @@ public void Backup(BackupType backupType) _diskProvider.EnsureFolder(_backupTempFolder); _diskProvider.EnsureFolder(GetBackupFolder(backupType)); - var backupFilename = String.Format("nzbdrone_backup_{0:yyyy.MM.dd_HH.mm.ss}.zip", DateTime.Now); + var backupFilename = string.Format("nzbdrone_backup_{0:yyyy.MM.dd_HH.mm.ss}.zip", DateTime.Now); var backupPath = Path.Combine(GetBackupFolder(backupType), backupFilename); Cleanup(); @@ -153,12 +153,12 @@ private void CleanupOldBackups(BackupType backupType) _logger.Debug("Finished cleaning up old backup files"); } - private String GetBackupFolder(BackupType backupType) + private string GetBackupFolder(BackupType backupType) { return Path.Combine(_appFolderInfo.GetBackupFolder(), backupType.ToString().ToLower()); } - private IEnumerable GetBackupFiles(String path) + private IEnumerable GetBackupFiles(string path) { var files = _diskProvider.GetFiles(path, SearchOption.TopDirectoryOnly); diff --git a/src/NzbDrone.Core/Blacklisting/BlacklistService.cs b/src/NzbDrone.Core/Blacklisting/BlacklistService.cs index b65220a02..1c0829004 100644 --- a/src/NzbDrone.Core/Blacklisting/BlacklistService.cs +++ b/src/NzbDrone.Core/Blacklisting/BlacklistService.cs @@ -134,7 +134,7 @@ public void Handle(DownloadFailedEvent message) Quality = message.Quality, Date = DateTime.UtcNow, PublishedDate = DateTime.Parse(message.Data.GetValueOrDefault("publishedDate")), - Size = Int64.Parse(message.Data.GetValueOrDefault("size", "0")), + Size = long.Parse(message.Data.GetValueOrDefault("size", "0")), Indexer = message.Data.GetValueOrDefault("indexer"), Protocol = (DownloadProtocol)Convert.ToInt32(message.Data.GetValueOrDefault("protocol")), Message = message.Message, diff --git a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs index 7bb9a16d2..b9c509e64 100644 --- a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs +++ b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs @@ -38,9 +38,9 @@ public interface IConfigFileProvider : IHandleAsync, string SslCertHash { get; } string UrlBase { get; } string UiFolder { get; } - Boolean UpdateAutomatically { get; } + bool UpdateAutomatically { get; } UpdateMechanism UpdateMechanism { get; } - String UpdateScriptPath { get; } + string UpdateScriptPath { get; } } public class ConfigFileProvider : IConfigFileProvider @@ -99,7 +99,7 @@ public void SaveConfigDictionary(Dictionary configValues) if (configValue.Key.Equals("SslCertHash", StringComparison.InvariantCultureIgnoreCase) && configValue.Value.ToString().IsNotNullOrWhiteSpace()) { - SetValue(configValue.Key.FirstCharToUpper(), HiddenCharacterRegex.Replace(configValue.Value.ToString(), String.Empty)); + SetValue(configValue.Key.FirstCharToUpper(), HiddenCharacterRegex.Replace(configValue.Value.ToString(), string.Empty)); continue; } diff --git a/src/NzbDrone.Core/Configuration/ConfigService.cs b/src/NzbDrone.Core/Configuration/ConfigService.cs index 1c8cc26f7..82542851a 100644 --- a/src/NzbDrone.Core/Configuration/ConfigService.cs +++ b/src/NzbDrone.Core/Configuration/ConfigService.cs @@ -35,9 +35,9 @@ public IEnumerable All() return _repository.All(); } - public Dictionary AllWithDefaults() + public Dictionary AllWithDefaults() { - var dict = new Dictionary(StringComparer.InvariantCultureIgnoreCase); + var dict = new Dictionary(StringComparer.InvariantCultureIgnoreCase); var type = GetType(); var properties = type.GetProperties(); @@ -71,12 +71,12 @@ public void SaveConfigDictionary(Dictionary configValues) _eventAggregator.PublishEvent(new ConfigSavedEvent()); } - public Boolean IsDefined(String key) + public bool IsDefined(string key) { return _repository.Get(key.ToLower()) != null; } - public String DownloadedEpisodesFolder + public string DownloadedEpisodesFolder { get { return GetValue(ConfigKey.DownloadedEpisodesFolder.ToString()); } @@ -97,11 +97,11 @@ public int Retention public string RecycleBin { - get { return GetValue("RecycleBin", String.Empty); } + get { return GetValue("RecycleBin", string.Empty); } set { SetValue("RecycleBin", value); } } - public Int32 RssSyncInterval + public int RssSyncInterval { get { return GetValueInt("RssSyncInterval", 15); } @@ -115,42 +115,42 @@ public int MinimumAge set { SetValue("MinimumAge", value); } } - public Boolean AutoDownloadPropers + public bool AutoDownloadPropers { get { return GetValueBoolean("AutoDownloadPropers", true); } set { SetValue("AutoDownloadPropers", value); } } - public Boolean EnableCompletedDownloadHandling + public bool EnableCompletedDownloadHandling { get { return GetValueBoolean("EnableCompletedDownloadHandling", true); } set { SetValue("EnableCompletedDownloadHandling", value); } } - public Boolean RemoveCompletedDownloads + public bool RemoveCompletedDownloads { get { return GetValueBoolean("RemoveCompletedDownloads", false); } set { SetValue("RemoveCompletedDownloads", value); } } - public Boolean AutoRedownloadFailed + public bool AutoRedownloadFailed { get { return GetValueBoolean("AutoRedownloadFailed", true); } set { SetValue("AutoRedownloadFailed", value); } } - public Boolean RemoveFailedDownloads + public bool RemoveFailedDownloads { get { return GetValueBoolean("RemoveFailedDownloads", true); } set { SetValue("RemoveFailedDownloads", value); } } - public Boolean CreateEmptySeriesFolders + public bool CreateEmptySeriesFolders { get { return GetValueBoolean("CreateEmptySeriesFolders", false); } @@ -164,125 +164,125 @@ public FileDateType FileDate set { SetValue("FileDate", value); } } - public String DownloadClientWorkingFolders + public string DownloadClientWorkingFolders { get { return GetValue("DownloadClientWorkingFolders", "_UNPACK_|_FAILED_"); } set { SetValue("DownloadClientWorkingFolders", value); } } - public Int32 DownloadedEpisodesScanInterval + public int DownloadedEpisodesScanInterval { get { return GetValueInt("DownloadedEpisodesScanInterval", 1); } set { SetValue("DownloadedEpisodesScanInterval", value); } } - public Int32 DownloadClientHistoryLimit + public int DownloadClientHistoryLimit { get { return GetValueInt("DownloadClientHistoryLimit", 30); } set { SetValue("DownloadClientHistoryLimit", value); } } - public Boolean SkipFreeSpaceCheckWhenImporting + public bool SkipFreeSpaceCheckWhenImporting { get { return GetValueBoolean("SkipFreeSpaceCheckWhenImporting", false); } set { SetValue("SkipFreeSpaceCheckWhenImporting", value); } } - public Boolean CopyUsingHardlinks + public bool CopyUsingHardlinks { get { return GetValueBoolean("CopyUsingHardlinks", false); } set { SetValue("CopyUsingHardlinks", value); } } - public Boolean EnableMediaInfo + public bool EnableMediaInfo { get { return GetValueBoolean("EnableMediaInfo", true); } set { SetValue("EnableMediaInfo", value); } } - public Boolean SetPermissionsLinux + public bool SetPermissionsLinux { get { return GetValueBoolean("SetPermissionsLinux", false); } set { SetValue("SetPermissionsLinux", value); } } - public String FileChmod + public string FileChmod { get { return GetValue("FileChmod", "0644"); } set { SetValue("FileChmod", value); } } - public String FolderChmod + public string FolderChmod { get { return GetValue("FolderChmod", "0755"); } set { SetValue("FolderChmod", value); } } - public String ChownUser + public string ChownUser { get { return GetValue("ChownUser", ""); } set { SetValue("ChownUser", value); } } - public String ChownGroup + public string ChownGroup { get { return GetValue("ChownGroup", ""); } set { SetValue("ChownGroup", value); } } - public Int32 FirstDayOfWeek + public int FirstDayOfWeek { get { return GetValueInt("FirstDayOfWeek", (int)OsInfo.FirstDayOfWeek); } set { SetValue("FirstDayOfWeek", value); } } - public String CalendarWeekColumnHeader + public string CalendarWeekColumnHeader { get { return GetValue("CalendarWeekColumnHeader", "ddd M/D"); } set { SetValue("CalendarWeekColumnHeader", value); } } - public String ShortDateFormat + public string ShortDateFormat { get { return GetValue("ShortDateFormat", "MMM D YYYY"); } set { SetValue("ShortDateFormat", value); } } - public String LongDateFormat + public string LongDateFormat { get { return GetValue("LongDateFormat", "dddd, MMMM D YYYY"); } set { SetValue("LongDateFormat", value); } } - public String TimeFormat + public string TimeFormat { get { return GetValue("TimeFormat", "h(:mm)a"); } set { SetValue("TimeFormat", value); } } - public Boolean ShowRelativeDates + public bool ShowRelativeDates { get { return GetValueBoolean("ShowRelativeDates", true); } set { SetValue("ShowRelativeDates", value); } } - public Boolean EnableColorImpairedMode + public bool EnableColorImpairedMode { get { return GetValueBoolean("EnableColorImpairedMode", false); } @@ -296,29 +296,29 @@ public bool CleanupMetadataImages set { SetValue("CleanupMetadataImages", value); } } - public String RijndaelPassphrase + public string RijndaelPassphrase { get { return GetValue("RijndaelPassphrase", Guid.NewGuid().ToString(), true); } } - public String HmacPassphrase + public string HmacPassphrase { get { return GetValue("HmacPassphrase", Guid.NewGuid().ToString(), true); } } - public String RijndaelSalt + public string RijndaelSalt { get { return GetValue("RijndaelSalt", Guid.NewGuid().ToString(), true); } } - public String HmacSalt + public string HmacSalt { get { return GetValue("HmacSalt", Guid.NewGuid().ToString(), true); } } private string GetValue(string key) { - return GetValue(key, String.Empty); + return GetValue(key, string.Empty); } private bool GetValueBoolean(string key, bool defaultValue = false) @@ -345,7 +345,7 @@ public string GetValue(string key, object defaultValue, bool persist = false) string dbValue; - if (_cache.TryGetValue(key, out dbValue) && dbValue != null && !String.IsNullOrEmpty(dbValue)) + if (_cache.TryGetValue(key, out dbValue) && dbValue != null && !string.IsNullOrEmpty(dbValue)) return dbValue; _logger.Trace("Using default config value for '{0}' defaultValue:'{1}'", key, defaultValue); @@ -357,7 +357,7 @@ public string GetValue(string key, object defaultValue, bool persist = false) return defaultValue.ToString(); } - private void SetValue(string key, Boolean value) + private void SetValue(string key, bool value) { SetValue(key, value.ToString()); } diff --git a/src/NzbDrone.Core/Configuration/IConfigService.cs b/src/NzbDrone.Core/Configuration/IConfigService.cs index dbfc2beac..1ec3a941f 100644 --- a/src/NzbDrone.Core/Configuration/IConfigService.cs +++ b/src/NzbDrone.Core/Configuration/IConfigService.cs @@ -7,58 +7,58 @@ namespace NzbDrone.Core.Configuration public interface IConfigService { IEnumerable All(); - Dictionary AllWithDefaults(); + Dictionary AllWithDefaults(); void SaveConfigDictionary(Dictionary configValues); - Boolean IsDefined(String key); + bool IsDefined(string key); //Download Client - String DownloadedEpisodesFolder { get; set; } - String DownloadClientWorkingFolders { get; set; } - Int32 DownloadedEpisodesScanInterval { get; set; } - Int32 DownloadClientHistoryLimit { get; set; } + string DownloadedEpisodesFolder { get; set; } + string DownloadClientWorkingFolders { get; set; } + int DownloadedEpisodesScanInterval { get; set; } + int DownloadClientHistoryLimit { get; set; } //Completed/Failed Download Handling (Download client) - Boolean EnableCompletedDownloadHandling { get; set; } - Boolean RemoveCompletedDownloads { get; set; } + bool EnableCompletedDownloadHandling { get; set; } + bool RemoveCompletedDownloads { get; set; } - Boolean AutoRedownloadFailed { get; set; } - Boolean RemoveFailedDownloads { get; set; } + bool AutoRedownloadFailed { get; set; } + bool RemoveFailedDownloads { get; set; } //Media Management - Boolean AutoUnmonitorPreviouslyDownloadedEpisodes { get; set; } - String RecycleBin { get; set; } - Boolean AutoDownloadPropers { get; set; } - Boolean CreateEmptySeriesFolders { get; set; } + bool AutoUnmonitorPreviouslyDownloadedEpisodes { get; set; } + string RecycleBin { get; set; } + bool AutoDownloadPropers { get; set; } + bool CreateEmptySeriesFolders { get; set; } FileDateType FileDate { get; set; } - Boolean SkipFreeSpaceCheckWhenImporting { get; set; } - Boolean CopyUsingHardlinks { get; set; } - Boolean EnableMediaInfo { get; set; } + bool SkipFreeSpaceCheckWhenImporting { get; set; } + bool CopyUsingHardlinks { get; set; } + bool EnableMediaInfo { get; set; } //Permissions (Media Management) - Boolean SetPermissionsLinux { get; set; } - String FileChmod { get; set; } - String FolderChmod { get; set; } - String ChownUser { get; set; } - String ChownGroup { get; set; } + bool SetPermissionsLinux { get; set; } + string FileChmod { get; set; } + string FolderChmod { get; set; } + string ChownUser { get; set; } + string ChownGroup { get; set; } //Indexers - Int32 Retention { get; set; } - Int32 RssSyncInterval { get; set; } - Int32 MinimumAge { get; set; } + int Retention { get; set; } + int RssSyncInterval { get; set; } + int MinimumAge { get; set; } //UI - Int32 FirstDayOfWeek { get; set; } - String CalendarWeekColumnHeader { get; set; } - - String ShortDateFormat { get; set; } - String LongDateFormat { get; set; } - String TimeFormat { get; set; } - Boolean ShowRelativeDates { get; set; } - Boolean EnableColorImpairedMode { get; set; } + int FirstDayOfWeek { get; set; } + string CalendarWeekColumnHeader { get; set; } + + string ShortDateFormat { get; set; } + string LongDateFormat { get; set; } + string TimeFormat { get; set; } + bool ShowRelativeDates { get; set; } + bool EnableColorImpairedMode { get; set; } //Internal - Boolean CleanupMetadataImages { get; set; } + bool CleanupMetadataImages { get; set; } //Forms Auth diff --git a/src/NzbDrone.Core/DataAugmentation/Scene/SceneMappingService.cs b/src/NzbDrone.Core/DataAugmentation/Scene/SceneMappingService.cs index 736100e82..4523cf10f 100644 --- a/src/NzbDrone.Core/DataAugmentation/Scene/SceneMappingService.cs +++ b/src/NzbDrone.Core/DataAugmentation/Scene/SceneMappingService.cs @@ -14,7 +14,7 @@ namespace NzbDrone.Core.DataAugmentation.Scene { public interface ISceneMappingService { - List GetSceneNames(int tvdbId, IEnumerable seasonNumbers); + List GetSceneNames(int tvdbId, IEnumerable seasonNumbers); Nullable FindTvdbId(string title); List FindByTvdbId(int tvdbId); Nullable GetSeasonNumber(string title); @@ -47,13 +47,13 @@ public SceneMappingService(ISceneMappingRepository repository, _logger = logger; } - public List GetSceneNames(int tvdbId, IEnumerable seasonNumbers) + public List GetSceneNames(int tvdbId, IEnumerable seasonNumbers) { var names = _findByTvdbIdCache.Find(tvdbId.ToString()); if (names == null) { - return new List(); + return new List(); } return FilterNonEnglish(names.Where(s => seasonNumbers.Contains(s.SeasonNumber) || @@ -199,7 +199,7 @@ private void RefreshCache() } } - private List FilterNonEnglish(List titles) + private List FilterNonEnglish(List titles) { return titles.Where(title => title.All(c => c <= 255)).ToList(); } diff --git a/src/NzbDrone.Core/DataAugmentation/Xem/XemProxy.cs b/src/NzbDrone.Core/DataAugmentation/Xem/XemProxy.cs index 2c9c7e617..dde409322 100644 --- a/src/NzbDrone.Core/DataAugmentation/Xem/XemProxy.cs +++ b/src/NzbDrone.Core/DataAugmentation/Xem/XemProxy.cs @@ -50,7 +50,7 @@ public List GetXemSeriesIds() return response.Data.Select(d => { int tvdbId = 0; - Int32.TryParse(d, out tvdbId); + int.TryParse(d, out tvdbId); return tvdbId; }).Where(t => t > 0).ToList(); @@ -76,7 +76,7 @@ public List GetSceneTvdbNames() var request = _xemRequestBuilder.Build("/allNames"); request.UriBuilder.SetQueryParam("seasonNumbers", true); - var response = _httpClient.Get>>>(request).Resource; + var response = _httpClient.Get>>>(request).Resource; var result = new List(); @@ -87,7 +87,7 @@ public List GetSceneTvdbNames() foreach (var n in name) { int seasonNumber; - if (!Int32.TryParse(n.Value.ToString(), out seasonNumber)) + if (!int.TryParse(n.Value.ToString(), out seasonNumber)) { continue; } diff --git a/src/NzbDrone.Core/DataAugmentation/Xem/XemService.cs b/src/NzbDrone.Core/DataAugmentation/Xem/XemService.cs index e578abba3..2e8ffb16d 100644 --- a/src/NzbDrone.Core/DataAugmentation/Xem/XemService.cs +++ b/src/NzbDrone.Core/DataAugmentation/Xem/XemService.cs @@ -175,7 +175,7 @@ public List GetSceneMappings() { int id; - if (Int32.TryParse(m.Title, out id)) + if (int.TryParse(m.Title, out id)) { _logger.Debug("Skipping all numeric name: {0} for {1}", m.Title, m.TvdbId); return false; diff --git a/src/NzbDrone.Core/Datastore/BasicRepository.cs b/src/NzbDrone.Core/Datastore/BasicRepository.cs index 809ef3d28..0e7531580 100644 --- a/src/NzbDrone.Core/Datastore/BasicRepository.cs +++ b/src/NzbDrone.Core/Datastore/BasicRepository.cs @@ -86,7 +86,7 @@ public TModel Get(int id) public IEnumerable Get(IEnumerable ids) { var idList = ids.ToList(); - var query = String.Format("Id IN ({0})", String.Join(",", idList)); + var query = string.Format("Id IN ({0})", string.Join(",", idList)); var result = Query.Where(query).ToList(); if (result.Count != idList.Count()) diff --git a/src/NzbDrone.Core/Datastore/Converters/BooleanIntConverter.cs b/src/NzbDrone.Core/Datastore/Converters/BooleanIntConverter.cs index 7ec60e201..df5980e08 100644 --- a/src/NzbDrone.Core/Datastore/Converters/BooleanIntConverter.cs +++ b/src/NzbDrone.Core/Datastore/Converters/BooleanIntConverter.cs @@ -13,7 +13,7 @@ public object FromDB(ConverterContext context) return DBNull.Value; } - var val = (Int64)context.DbValue; + var val = (long)context.DbValue; switch (val) { diff --git a/src/NzbDrone.Core/Datastore/Converters/DoubleConverter.cs b/src/NzbDrone.Core/Datastore/Converters/DoubleConverter.cs index af3603654..82f50e326 100644 --- a/src/NzbDrone.Core/Datastore/Converters/DoubleConverter.cs +++ b/src/NzbDrone.Core/Datastore/Converters/DoubleConverter.cs @@ -13,7 +13,7 @@ public object FromDB(ConverterContext context) return DBNull.Value; } - if (context.DbValue is Double) + if (context.DbValue is double) { return context.DbValue; } @@ -28,7 +28,7 @@ public object FromDB(ColumnMap map, object dbValue) return DBNull.Value; } - if (dbValue is Double) + if (dbValue is double) { return dbValue; } diff --git a/src/NzbDrone.Core/Datastore/Converters/EnumIntConverter.cs b/src/NzbDrone.Core/Datastore/Converters/EnumIntConverter.cs index 40c2727bc..e7a17ed1e 100644 --- a/src/NzbDrone.Core/Datastore/Converters/EnumIntConverter.cs +++ b/src/NzbDrone.Core/Datastore/Converters/EnumIntConverter.cs @@ -18,7 +18,7 @@ public object FromDB(ConverterContext context) { if (context.DbValue != null && context.DbValue != DBNull.Value) { - return Enum.ToObject(context.ColumnMap.FieldType, (Int64)context.DbValue); + return Enum.ToObject(context.ColumnMap.FieldType, (long)context.DbValue); } return null; diff --git a/src/NzbDrone.Core/Datastore/Converters/GuidConverter.cs b/src/NzbDrone.Core/Datastore/Converters/GuidConverter.cs index bbd459a42..d26cb9928 100644 --- a/src/NzbDrone.Core/Datastore/Converters/GuidConverter.cs +++ b/src/NzbDrone.Core/Datastore/Converters/GuidConverter.cs @@ -6,7 +6,7 @@ namespace NzbDrone.Core.Datastore.Converters { public class GuidConverter : IConverter { - public Object FromDB(ConverterContext context) + public object FromDB(ConverterContext context) { if (context.DbValue == DBNull.Value) { @@ -18,12 +18,12 @@ public Object FromDB(ConverterContext context) return new Guid(value); } - public Object FromDB(ColumnMap map, Object dbValue) + public object FromDB(ColumnMap map, object dbValue) { return FromDB(new ConverterContext { ColumnMap = map, DbValue = dbValue }); } - public Object ToDB(Object clrValue) + public object ToDB(object clrValue) { var value = clrValue; diff --git a/src/NzbDrone.Core/Datastore/Converters/Int32Converter.cs b/src/NzbDrone.Core/Datastore/Converters/Int32Converter.cs index c69bfb9a5..c96586aa7 100644 --- a/src/NzbDrone.Core/Datastore/Converters/Int32Converter.cs +++ b/src/NzbDrone.Core/Datastore/Converters/Int32Converter.cs @@ -13,7 +13,7 @@ public object FromDB(ConverterContext context) return DBNull.Value; } - if (context.DbValue is Int32) + if (context.DbValue is int) { return context.DbValue; } @@ -28,7 +28,7 @@ public object FromDB(ColumnMap map, object dbValue) return DBNull.Value; } - if (dbValue is Int32) + if (dbValue is int) { return dbValue; } diff --git a/src/NzbDrone.Core/Datastore/Converters/OsPathConverter.cs b/src/NzbDrone.Core/Datastore/Converters/OsPathConverter.cs index fdc2a7151..ba35fef3d 100644 --- a/src/NzbDrone.Core/Datastore/Converters/OsPathConverter.cs +++ b/src/NzbDrone.Core/Datastore/Converters/OsPathConverter.cs @@ -7,24 +7,24 @@ namespace NzbDrone.Core.Datastore.Converters { public class OsPathConverter : IConverter { - public Object FromDB(ConverterContext context) + public object FromDB(ConverterContext context) { if (context.DbValue == DBNull.Value) { return DBNull.Value; } - var value = (String)context.DbValue; + var value = (string)context.DbValue; return new OsPath(value); } - public Object FromDB(ColumnMap map, Object dbValue) + public object FromDB(ColumnMap map, object dbValue) { return FromDB(new ConverterContext { ColumnMap = map, DbValue = dbValue }); } - public Object ToDB(Object clrValue) + public object ToDB(object clrValue) { var value = (OsPath)clrValue; @@ -33,7 +33,7 @@ public Object ToDB(Object clrValue) public Type DbType { - get { return typeof(String); } + get { return typeof(string); } } } } diff --git a/src/NzbDrone.Core/Datastore/Extensions/MappingExtensions.cs b/src/NzbDrone.Core/Datastore/Extensions/MappingExtensions.cs index 87a10fd98..57df51874 100644 --- a/src/NzbDrone.Core/Datastore/Extensions/MappingExtensions.cs +++ b/src/NzbDrone.Core/Datastore/Extensions/MappingExtensions.cs @@ -27,7 +27,7 @@ public static class MappingExtensions return mapBuilder.Table.MapTable(tableName) .Columns .AutoMapPropertiesWhere(IsMappableProperty) - .PrefixAltNames(String.Format("{0}_", typeof(T).Name)) + .PrefixAltNames(string.Format("{0}_", typeof(T).Name)) .For(c => c.Id) .SetPrimaryKey() .SetReturnValue() diff --git a/src/NzbDrone.Core/Datastore/Migration/018_remove_duplicates.cs b/src/NzbDrone.Core/Datastore/Migration/018_remove_duplicates.cs index 9b34053b6..d788dd7dc 100644 --- a/src/NzbDrone.Core/Datastore/Migration/018_remove_duplicates.cs +++ b/src/NzbDrone.Core/Datastore/Migration/018_remove_duplicates.cs @@ -68,19 +68,19 @@ private void RemoveSeriesRows(IDbConnection conn, IDbTransaction tran, int serie var deleteCmd = conn.CreateCommand(); deleteCmd.Transaction = tran; - deleteCmd.CommandText = String.Format("DELETE FROM Series WHERE Id = {0}", seriesId.ToString()); + deleteCmd.CommandText = string.Format("DELETE FROM Series WHERE Id = {0}", seriesId.ToString()); deleteCmd.ExecuteNonQuery(); - deleteCmd.CommandText = String.Format("DELETE FROM Episodes WHERE SeriesId = {0}", seriesId.ToString()); + deleteCmd.CommandText = string.Format("DELETE FROM Episodes WHERE SeriesId = {0}", seriesId.ToString()); deleteCmd.ExecuteNonQuery(); - deleteCmd.CommandText = String.Format("DELETE FROM Seasons WHERE SeriesId = {0}", seriesId.ToString()); + deleteCmd.CommandText = string.Format("DELETE FROM Seasons WHERE SeriesId = {0}", seriesId.ToString()); deleteCmd.ExecuteNonQuery(); - deleteCmd.CommandText = String.Format("DELETE FROM History WHERE SeriesId = {0}", seriesId.ToString()); + deleteCmd.CommandText = string.Format("DELETE FROM History WHERE SeriesId = {0}", seriesId.ToString()); deleteCmd.ExecuteNonQuery(); - deleteCmd.CommandText = String.Format("DELETE FROM EpisodeFiles WHERE SeriesId = {0}", seriesId.ToString()); + deleteCmd.CommandText = string.Format("DELETE FROM EpisodeFiles WHERE SeriesId = {0}", seriesId.ToString()); deleteCmd.ExecuteNonQuery(); } @@ -89,10 +89,10 @@ private void RemoveEpisodeRows(IDbConnection conn, IDbTransaction tran, int epis var deleteCmd = conn.CreateCommand(); deleteCmd.Transaction = tran; - deleteCmd.CommandText = String.Format("DELETE FROM Episodes WHERE Id = {0}", episodeId.ToString()); + deleteCmd.CommandText = string.Format("DELETE FROM Episodes WHERE Id = {0}", episodeId.ToString()); deleteCmd.ExecuteNonQuery(); - deleteCmd.CommandText = String.Format("DELETE FROM History WHERE EpisodeId = {0}", episodeId.ToString()); + deleteCmd.CommandText = string.Format("DELETE FROM History WHERE EpisodeId = {0}", episodeId.ToString()); deleteCmd.ExecuteNonQuery(); } } diff --git a/src/NzbDrone.Core/Datastore/Migration/020_add_year_and_seasons_to_series.cs b/src/NzbDrone.Core/Datastore/Migration/020_add_year_and_seasons_to_series.cs index 0521d3bdb..37d26fd24 100644 --- a/src/NzbDrone.Core/Datastore/Migration/020_add_year_and_seasons_to_series.cs +++ b/src/NzbDrone.Core/Datastore/Migration/020_add_year_and_seasons_to_series.cs @@ -34,7 +34,7 @@ private void ConvertSeasons(IDbConnection conn, IDbTransaction tran) using (IDbCommand seasonsCmd = conn.CreateCommand()) { seasonsCmd.Transaction = tran; - seasonsCmd.CommandText = String.Format(@"SELECT SeasonNumber, Monitored FROM Seasons WHERE SeriesId = {0}", seriesId); + seasonsCmd.CommandText = string.Format(@"SELECT SeasonNumber, Monitored FROM Seasons WHERE SeriesId = {0}", seriesId); using (IDataReader seasonReader = seasonsCmd.ExecuteReader()) { @@ -55,7 +55,7 @@ private void ConvertSeasons(IDbConnection conn, IDbTransaction tran) using (IDbCommand updateCmd = conn.CreateCommand()) { - var text = String.Format("UPDATE Series SET Seasons = '{0}' WHERE Id = {1}", seasons.ToJson() , seriesId); + var text = string.Format("UPDATE Series SET Seasons = '{0}' WHERE Id = {1}", seasons.ToJson() , seriesId); updateCmd.Transaction = tran; updateCmd.CommandText = text; diff --git a/src/NzbDrone.Core/Datastore/Migration/029_add_formats_to_naming_config.cs b/src/NzbDrone.Core/Datastore/Migration/029_add_formats_to_naming_config.cs index 80f413e1c..ef3be4092 100644 --- a/src/NzbDrone.Core/Datastore/Migration/029_add_formats_to_naming_config.cs +++ b/src/NzbDrone.Core/Datastore/Migration/029_add_formats_to_naming_config.cs @@ -78,11 +78,11 @@ private void ConvertConfig(IDbConnection conn, IDbTransaction tran) } } - var standardEpisodeFormat = String.Format("{0}{1}{2}", seriesTitlePattern, + var standardEpisodeFormat = string.Format("{0}{1}{2}", seriesTitlePattern, GetNumberStyle(numberStyle).Pattern, episodeTitlePattern); - var dailyEpisodeFormat = String.Format("{0}{1}{2}", seriesTitlePattern, + var dailyEpisodeFormat = string.Format("{0}{1}{2}", seriesTitlePattern, dailyEpisodePattern, episodeTitlePattern); @@ -99,7 +99,7 @@ private void ConvertConfig(IDbConnection conn, IDbTransaction tran) using (IDbCommand updateCmd = conn.CreateCommand()) { - var text = String.Format("UPDATE NamingConfig " + + var text = string.Format("UPDATE NamingConfig " + "SET StandardEpisodeFormat = '{0}', " + "DailyEpisodeFormat = '{1}'", standardEpisodeFormat, diff --git a/src/NzbDrone.Core/Datastore/Migration/030_add_season_folder_format_to_naming_config.cs b/src/NzbDrone.Core/Datastore/Migration/030_add_season_folder_format_to_naming_config.cs index 7e7a2ab87..6ae126e60 100644 --- a/src/NzbDrone.Core/Datastore/Migration/030_add_season_folder_format_to_naming_config.cs +++ b/src/NzbDrone.Core/Datastore/Migration/030_add_season_folder_format_to_naming_config.cs @@ -42,7 +42,7 @@ private void ConvertConfig(IDbConnection conn, IDbTransaction tran) using (IDbCommand updateCmd = conn.CreateCommand()) { - var text = String.Format("UPDATE NamingConfig " + + var text = string.Format("UPDATE NamingConfig " + "SET SeasonFolderFormat = '{0}'", seasonFormat); diff --git a/src/NzbDrone.Core/Datastore/Migration/033_add_api_key_to_pushover.cs b/src/NzbDrone.Core/Datastore/Migration/033_add_api_key_to_pushover.cs index 284316203..d6f554ca0 100644 --- a/src/NzbDrone.Core/Datastore/Migration/033_add_api_key_to_pushover.cs +++ b/src/NzbDrone.Core/Datastore/Migration/033_add_api_key_to_pushover.cs @@ -42,7 +42,7 @@ private void UpdatePushoverSettings(IDbConnection conn, IDbTransaction tran) using (IDbCommand updateCmd = conn.CreateCommand()) { - var text = String.Format("UPDATE Notifications " + + var text = string.Format("UPDATE Notifications " + "SET Settings = '{0}'" + "WHERE Id = {1}", settings.ToJson(), id @@ -59,9 +59,9 @@ private void UpdatePushoverSettings(IDbConnection conn, IDbTransaction tran) private class PushoverSettingsForV33 { - public String ApiKey { get; set; } - public String UserKey { get; set; } - public Int32 Priority { get; set; } + public string ApiKey { get; set; } + public string UserKey { get; set; } + public int Priority { get; set; } } } } diff --git a/src/NzbDrone.Core/Datastore/Migration/036_update_with_quality_converters.cs b/src/NzbDrone.Core/Datastore/Migration/036_update_with_quality_converters.cs index 371d0e5df..05b7940db 100644 --- a/src/NzbDrone.Core/Datastore/Migration/036_update_with_quality_converters.cs +++ b/src/NzbDrone.Core/Datastore/Migration/036_update_with_quality_converters.cs @@ -112,19 +112,19 @@ private void ConvertQualityModel(IDbConnection conn, IDbTransaction tran, string private class DestinationQualityModel036 { - public Int32 Quality { get; set; } - public Boolean Proper { get; set; } + public int Quality { get; set; } + public bool Proper { get; set; } } private class SourceQualityModel036 { public SourceQuality036 Quality { get; set; } - public Boolean Proper { get; set; } + public bool Proper { get; set; } } private class SourceQuality036 { - public Int32 Id { get; set; } + public int Id { get; set; } } } } diff --git a/src/NzbDrone.Core/Datastore/Migration/043_convert_config_to_download_clients.cs b/src/NzbDrone.Core/Datastore/Migration/043_convert_config_to_download_clients.cs index c83e3e20b..505962776 100644 --- a/src/NzbDrone.Core/Datastore/Migration/043_convert_config_to_download_clients.cs +++ b/src/NzbDrone.Core/Datastore/Migration/043_convert_config_to_download_clients.cs @@ -40,7 +40,7 @@ private void ConvertToThingyProvder(IDbConnection conn, IDbTransaction tran) var client = GetConfigValue(config, "DownloadClient", ""); - if (String.IsNullOrWhiteSpace(client)) + if (string.IsNullOrWhiteSpace(client)) { return; } @@ -119,7 +119,7 @@ private void AddDownloadClient(IDbConnection conn, IDbTransaction tran, string n { using (IDbCommand updateCmd = conn.CreateCommand()) { - var text = String.Format("INSERT INTO DownloadClients (Enable, Name, Implementation, Settings, ConfigContract, Protocol) VALUES (1, ?, ?, ?, ?, ?)"); + var text = string.Format("INSERT INTO DownloadClients (Enable, Name, Implementation, Settings, ConfigContract, Protocol) VALUES (1, ?, ?, ?, ?, ?)"); updateCmd.AddParameter(name); updateCmd.AddParameter(implementation); updateCmd.AddParameter(settings); @@ -159,20 +159,20 @@ private int GetNzbgetPriority(string priority) private class ClientSettingsForMigration { - public String Host { get; set; } - public Int32 Port { get; set; } - public String ApiKey { get; set; } - public String Username { get; set; } - public String Password { get; set; } - public String TvCategory { get; set; } - public Int32 RecentTvPriority { get; set; } - public Int32 OlderTvPriority { get; set; } - public Boolean UseSsl { get; set; } + public string Host { get; set; } + public int Port { get; set; } + public string ApiKey { get; set; } + public string Username { get; set; } + public string Password { get; set; } + public string TvCategory { get; set; } + public int RecentTvPriority { get; set; } + public int OlderTvPriority { get; set; } + public bool UseSsl { get; set; } } private class FolderSettingsForMigration { - public String Folder { get; set; } + public string Folder { get; set; } } private enum SabnzbdPriorityForMigration diff --git a/src/NzbDrone.Core/Datastore/Migration/051_download_client_import.cs b/src/NzbDrone.Core/Datastore/Migration/051_download_client_import.cs index 0035b3f4f..549b92e59 100644 --- a/src/NzbDrone.Core/Datastore/Migration/051_download_client_import.cs +++ b/src/NzbDrone.Core/Datastore/Migration/051_download_client_import.cs @@ -46,7 +46,7 @@ private void ConvertFolderSettings(IDbConnection conn, IDbTransaction tran) { downloadClientsCmd.Transaction = tran; downloadClientsCmd.CommandText = @"SELECT Value FROM Config WHERE Key = 'downloadedepisodesfolder'"; - var downloadedEpisodesFolder = downloadClientsCmd.ExecuteScalar() as String; + var downloadedEpisodesFolder = downloadClientsCmd.ExecuteScalar() as string; downloadClientsCmd.Transaction = tran; downloadClientsCmd.CommandText = @"SELECT Id, Implementation, Settings, ConfigContract FROM DownloadClients WHERE ConfigContract = 'FolderSettings'"; @@ -65,7 +65,7 @@ private void ConvertFolderSettings(IDbConnection conn, IDbTransaction tran) { var newSettings = new { - NzbFolder = settingsJson.Value("folder"), + NzbFolder = settingsJson.Value("folder"), WatchFolder = downloadedEpisodesFolder }.ToJson(); @@ -85,7 +85,7 @@ private void ConvertFolderSettings(IDbConnection conn, IDbTransaction tran) { var newSettings = new { - NzbFolder = settingsJson.Value("folder") + NzbFolder = settingsJson.Value("folder") }.ToJson(); using (IDbCommand updateCmd = conn.CreateCommand()) @@ -117,12 +117,12 @@ private void ConvertFolderSettings(IDbConnection conn, IDbTransaction tran) private sealed class MigrationHistoryItem { - public Int32 Id { get; set; } - public Int32 EpisodeId { get; set; } - public Int32 SeriesId { get; set; } - public String SourceTitle { get; set; } + public int Id { get; set; } + public int EpisodeId { get; set; } + public int SeriesId { get; set; } + public string SourceTitle { get; set; } public DateTime Date { get; set; } - public Dictionary Data { get; set; } + public Dictionary Data { get; set; } public MigrationHistoryEventType EventType { get; set; } } @@ -154,7 +154,7 @@ private void AssociateImportedHistoryItems(IDbConnection conn, IDbTransaction tr SeriesId = historyRead.GetInt32(2), SourceTitle = historyRead.GetString(3), Date = historyRead.GetDateTime(4), - Data = Json.Deserialize>(historyRead.GetString(5)), + Data = Json.Deserialize>(historyRead.GetString(5)), EventType = (MigrationHistoryEventType)historyRead.GetInt32(6) }); } diff --git a/src/NzbDrone.Core/Datastore/Migration/062_convert_quality_models.cs b/src/NzbDrone.Core/Datastore/Migration/062_convert_quality_models.cs index b592df63d..a032ffa4d 100644 --- a/src/NzbDrone.Core/Datastore/Migration/062_convert_quality_models.cs +++ b/src/NzbDrone.Core/Datastore/Migration/062_convert_quality_models.cs @@ -23,9 +23,9 @@ private void ConvertQualityModels(IDbConnection conn, IDbTransaction tran) ConvertQualityModelsOnTable(conn, tran, "History"); } - private void ConvertQualityModelsOnTable(IDbConnection conn, IDbTransaction tran, String tableName) + private void ConvertQualityModelsOnTable(IDbConnection conn, IDbTransaction tran, string tableName) { - var qualitiesToUpdate = new Dictionary(); + var qualitiesToUpdate = new Dictionary(); using (IDbCommand qualityModelCmd = conn.CreateCommand()) { @@ -71,13 +71,13 @@ private void ConvertQualityModelsOnTable(IDbConnection conn, IDbTransaction tran private class LegacyQualityModel062 { - public Int32 Quality { get; set; } - public Boolean Proper { get; set; } + public int Quality { get; set; } + public bool Proper { get; set; } } private class QualityModel062 { - public Int32 Quality { get; set; } + public int Quality { get; set; } public Revision Revision { get; set; } } } diff --git a/src/NzbDrone.Core/Datastore/Migration/069_quality_proper.cs b/src/NzbDrone.Core/Datastore/Migration/069_quality_proper.cs index 6008faa00..1529c6c1c 100644 --- a/src/NzbDrone.Core/Datastore/Migration/069_quality_proper.cs +++ b/src/NzbDrone.Core/Datastore/Migration/069_quality_proper.cs @@ -61,15 +61,15 @@ private string GetNewFormat(string currentFormat) foreach (Match match in matches) { var tokenMatch = GetTokenMatch(match); - var qualityFullToken = String.Format("Quality{0}Full", tokenMatch.Separator); ; + var qualityFullToken = string.Format("Quality{0}Full", tokenMatch.Separator); ; - if (tokenMatch.Token.All(t => !Char.IsLetter(t) || Char.IsLower(t))) + if (tokenMatch.Token.All(t => !char.IsLetter(t) || char.IsLower(t))) { - qualityFullToken = String.Format("quality{0}full", tokenMatch.Separator); + qualityFullToken = string.Format("quality{0}full", tokenMatch.Separator); } - else if (tokenMatch.Token.All(t => !Char.IsLetter(t) || Char.IsUpper(t))) + else if (tokenMatch.Token.All(t => !char.IsLetter(t) || char.IsUpper(t))) { - qualityFullToken = String.Format("QUALITY{0}FULL", tokenMatch.Separator); + qualityFullToken = string.Format("QUALITY{0}FULL", tokenMatch.Separator); } result = result.Replace(match.Groups["token"].Value, qualityFullToken); diff --git a/src/NzbDrone.Core/Datastore/Migration/070_delay_profile.cs b/src/NzbDrone.Core/Datastore/Migration/070_delay_profile.cs index 8ef186064..e0892cede 100644 --- a/src/NzbDrone.Core/Datastore/Migration/070_delay_profile.cs +++ b/src/NzbDrone.Core/Datastore/Migration/070_delay_profile.cs @@ -30,7 +30,7 @@ protected override void MainDbUpgrade() PreferredProtocol = 1, UsenetDelay = 0, TorrentDelay = 0, - Order = Int32.MaxValue, + Order = int.MaxValue, Tags = "[]" }); @@ -50,9 +50,9 @@ private void ConvertProfile(IDbConnection conn, IDbTransaction tran) var profile = profileClosure; if (profile.GrabDelay == 0) continue; - var tag = String.Format("delay-{0}", profile.GrabDelay); + var tag = string.Format("delay-{0}", profile.GrabDelay); var tagId = InsertTag(conn, tran, tag); - var tags = String.Format("[{0}]", tagId); + var tags = string.Format("[{0}]", tagId); using (IDbCommand insertDelayProfileCmd = conn.CreateCommand()) { @@ -102,7 +102,7 @@ private List GetProfiles(IDbConnection conn, IDbTransaction tran) return profiles; } - private Int32 InsertTag(IDbConnection conn, IDbTransaction tran, string tagLabel) + private int InsertTag(IDbConnection conn, IDbTransaction tran, string tagLabel) { using (IDbCommand insertCmd = conn.CreateCommand()) { @@ -122,7 +122,7 @@ private void UpdateSeries(IDbConnection conn, IDbTransaction tran, IEnumerable quoter.QuoteColumnName(c.Name))); + var columnsToTransfer = string.Join(", ", tableDefinition.Columns.Select(c => quoter.QuoteColumnName(c.Name))); Process(new CreateTableExpression() { TableName = tempTableName, Columns = tableDefinition.Columns.ToList() }); - Process(String.Format("INSERT INTO {0} SELECT {1} FROM {2}", quoter.QuoteTableName(tempTableName), columnsToTransfer, quoter.QuoteTableName(tableName))); + Process(string.Format("INSERT INTO {0} SELECT {1} FROM {2}", quoter.QuoteTableName(tempTableName), columnsToTransfer, quoter.QuoteTableName(tableName))); Process(new DeleteTableExpression() { TableName = tableName }); diff --git a/src/NzbDrone.Core/Datastore/Migration/Framework/NzbDroneSqliteProcessorFactory.cs b/src/NzbDrone.Core/Datastore/Migration/Framework/NzbDroneSqliteProcessorFactory.cs index 431c1ff83..86668647d 100644 --- a/src/NzbDrone.Core/Datastore/Migration/Framework/NzbDroneSqliteProcessorFactory.cs +++ b/src/NzbDrone.Core/Datastore/Migration/Framework/NzbDroneSqliteProcessorFactory.cs @@ -8,7 +8,7 @@ namespace NzbDrone.Core.Datastore.Migration.Framework { public class NzbDroneSqliteProcessorFactory : SqliteProcessorFactory { - public override IMigrationProcessor Create(String connectionString, IAnnouncer announcer, IMigrationProcessorOptions options) + public override IMigrationProcessor Create(string connectionString, IAnnouncer announcer, IMigrationProcessorOptions options) { var factory = new MigrationDbFactory(); var connection = factory.CreateConnection(connectionString); diff --git a/src/NzbDrone.Core/Datastore/Migration/Framework/SqliteSchemaDumper.cs b/src/NzbDrone.Core/Datastore/Migration/Framework/SqliteSchemaDumper.cs index 9ffb97e8f..e627b9b94 100644 --- a/src/NzbDrone.Core/Datastore/Migration/Framework/SqliteSchemaDumper.cs +++ b/src/NzbDrone.Core/Datastore/Migration/Framework/SqliteSchemaDumper.cs @@ -20,7 +20,7 @@ public SqliteSchemaDumper(SqliteProcessor processor, IAnnouncer announcer) public virtual IAnnouncer Announcer { get; set; } public SqliteProcessor Processor { get; set; } - protected internal virtual TableDefinition ReadTableSchema(String sqlSchema) + protected internal virtual TableDefinition ReadTableSchema(string sqlSchema) { var reader = new SqliteSyntaxReader(sqlSchema); @@ -29,7 +29,7 @@ protected internal virtual TableDefinition ReadTableSchema(String sqlSchema) return result; } - protected internal virtual IndexDefinition ReadIndexSchema(String sqlSchema) + protected internal virtual IndexDefinition ReadIndexSchema(string sqlSchema) { var reader = new SqliteSyntaxReader(sqlSchema); @@ -165,7 +165,7 @@ protected virtual IndexDefinition ParseCreateIndexStatement(SqliteSyntaxReader r return index; } - protected virtual String ParseIdentifier(SqliteSyntaxReader reader) + protected virtual string ParseIdentifier(SqliteSyntaxReader reader) { reader.Read(); diff --git a/src/NzbDrone.Core/Datastore/Migration/Framework/SqliteSyntaxReader.cs b/src/NzbDrone.Core/Datastore/Migration/Framework/SqliteSyntaxReader.cs index 4c0ea735b..3eb4b3ffd 100644 --- a/src/NzbDrone.Core/Datastore/Migration/Framework/SqliteSyntaxReader.cs +++ b/src/NzbDrone.Core/Datastore/Migration/Framework/SqliteSyntaxReader.cs @@ -8,20 +8,20 @@ namespace NzbDrone.Core.Datastore.Migration.Framework public class SqliteSyntaxReader { - public String Buffer { get; private set; } - public Int32 Index { get; private set; } + public string Buffer { get; private set; } + public int Index { get; private set; } - private Int32 _previousIndex; + private int _previousIndex; public TokenType Type { get; private set; } - public String Value { get; private set; } + public string Value { get; private set; } - public String ValueToUpper + public string ValueToUpper { get { return Value.ToUpperInvariant(); } } - public Boolean IsEndOfFile + public bool IsEndOfFile { get { return Index >= Buffer.Length; } } @@ -40,7 +40,7 @@ public enum TokenType UnknownSymbol } - public SqliteSyntaxReader(String sql) + public SqliteSyntaxReader(string sql) { Buffer = sql; } @@ -215,7 +215,7 @@ public List ReadList() return result; } - protected String ReadTerminatedString(Char terminator) + protected string ReadTerminatedString(char terminator) { var start = Index + 1; var end = Buffer.IndexOf(terminator, Index); @@ -226,7 +226,7 @@ protected String ReadTerminatedString(Char terminator) return Buffer.Substring(start, end - start); } - protected String ReadEscapedString(Char escape) + protected string ReadEscapedString(char escape) { var identifier = new StringBuilder(); @@ -248,9 +248,9 @@ protected String ReadEscapedString(Char escape) return identifier.ToString(); } - public SyntaxErrorException CreateSyntaxException(String message, params object[] args) + public SyntaxErrorException CreateSyntaxException(string message, params object[] args) { - return new SyntaxErrorException(String.Format("{0}. Syntax Error near: {1}", String.Format(message, args), Buffer.Substring(_previousIndex))); + return new SyntaxErrorException(string.Format("{0}. Syntax Error near: {1}", string.Format(message, args), Buffer.Substring(_previousIndex))); } } } diff --git a/src/NzbDrone.Core/Datastore/TableMapping.cs b/src/NzbDrone.Core/Datastore/TableMapping.cs index 760a07c91..2f2401fb8 100644 --- a/src/NzbDrone.Core/Datastore/TableMapping.cs +++ b/src/NzbDrone.Core/Datastore/TableMapping.cs @@ -120,20 +120,20 @@ private static void RegisterMappers() RegisterEmbeddedConverter(); RegisterProviderSettingConverter(); - MapRepository.Instance.RegisterTypeConverter(typeof(Int32), new Int32Converter()); - MapRepository.Instance.RegisterTypeConverter(typeof(Double), new DoubleConverter()); + MapRepository.Instance.RegisterTypeConverter(typeof(int), new Int32Converter()); + MapRepository.Instance.RegisterTypeConverter(typeof(double), new DoubleConverter()); MapRepository.Instance.RegisterTypeConverter(typeof(DateTime), new UtcConverter()); - MapRepository.Instance.RegisterTypeConverter(typeof(Boolean), new BooleanIntConverter()); + MapRepository.Instance.RegisterTypeConverter(typeof(bool), new BooleanIntConverter()); MapRepository.Instance.RegisterTypeConverter(typeof(Enum), new EnumIntConverter()); MapRepository.Instance.RegisterTypeConverter(typeof(Quality), new QualityIntConverter()); MapRepository.Instance.RegisterTypeConverter(typeof(List), new EmbeddedDocumentConverter(new QualityIntConverter())); MapRepository.Instance.RegisterTypeConverter(typeof(QualityModel), new EmbeddedDocumentConverter(new QualityIntConverter())); - MapRepository.Instance.RegisterTypeConverter(typeof(Dictionary), new EmbeddedDocumentConverter()); - MapRepository.Instance.RegisterTypeConverter(typeof(List), new EmbeddedDocumentConverter()); - MapRepository.Instance.RegisterTypeConverter(typeof(List), new EmbeddedDocumentConverter()); + MapRepository.Instance.RegisterTypeConverter(typeof(Dictionary), new EmbeddedDocumentConverter()); + MapRepository.Instance.RegisterTypeConverter(typeof(List), new EmbeddedDocumentConverter()); + MapRepository.Instance.RegisterTypeConverter(typeof(List), new EmbeddedDocumentConverter()); MapRepository.Instance.RegisterTypeConverter(typeof(ParsedEpisodeInfo), new EmbeddedDocumentConverter()); MapRepository.Instance.RegisterTypeConverter(typeof(ReleaseInfo), new EmbeddedDocumentConverter()); - MapRepository.Instance.RegisterTypeConverter(typeof(HashSet), new EmbeddedDocumentConverter()); + MapRepository.Instance.RegisterTypeConverter(typeof(HashSet), new EmbeddedDocumentConverter()); MapRepository.Instance.RegisterTypeConverter(typeof(OsPath), new OsPathConverter()); MapRepository.Instance.RegisterTypeConverter(typeof(Guid), new GuidConverter()); MapRepository.Instance.RegisterTypeConverter(typeof(Command), new CommandConverter()); diff --git a/src/NzbDrone.Core/DecisionEngine/Decision.cs b/src/NzbDrone.Core/DecisionEngine/Decision.cs index a4402588a..57a6fb707 100644 --- a/src/NzbDrone.Core/DecisionEngine/Decision.cs +++ b/src/NzbDrone.Core/DecisionEngine/Decision.cs @@ -4,8 +4,8 @@ namespace NzbDrone.Core.DecisionEngine { public class Decision { - public Boolean Accepted { get; private set; } - public String Reason { get; private set; } + public bool Accepted { get; private set; } + public string Reason { get; private set; } private static readonly Decision AcceptDecision = new Decision { Accepted = true }; private Decision() @@ -17,12 +17,12 @@ public static Decision Accept() return AcceptDecision; } - public static Decision Reject(String reason, params object[] args) + public static Decision Reject(string reason, params object[] args) { - return Reject(String.Format(reason, args)); + return Reject(string.Format(reason, args)); } - public static Decision Reject(String reason) + public static Decision Reject(string reason) { return new Decision { diff --git a/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs b/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs index 115009d71..566380e6c 100644 --- a/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs +++ b/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs @@ -100,7 +100,7 @@ private IEnumerable GetDecisions(List reports, Se { if (decision.Rejections.Any()) { - _logger.Debug("Release rejected for the following reasons: {0}", String.Join(", ", decision.Rejections)); + _logger.Debug("Release rejected for the following reasons: {0}", string.Join(", ", decision.Rejections)); } yield return decision; @@ -132,7 +132,7 @@ private Rejection EvaluateSpec(IDecisionEngineSpecification spec, RemoteEpisode e.Data.Add("report", remoteEpisode.Release.ToJson()); e.Data.Add("parsed", remoteEpisode.ParsedEpisodeInfo.ToJson()); _logger.ErrorException("Couldn't evaluate decision on " + remoteEpisode.Release.Title, e); - return new Rejection(String.Format("{0}: {1}", spec.GetType().Name, e.Message)); + return new Rejection(string.Format("{0}: {1}", spec.GetType().Name, e.Message)); } return null; diff --git a/src/NzbDrone.Core/DecisionEngine/Rejection.cs b/src/NzbDrone.Core/DecisionEngine/Rejection.cs index 315803b38..d4a6d6261 100644 --- a/src/NzbDrone.Core/DecisionEngine/Rejection.cs +++ b/src/NzbDrone.Core/DecisionEngine/Rejection.cs @@ -4,7 +4,7 @@ namespace NzbDrone.Core.DecisionEngine { public class Rejection { - public String Reason { get; set; } + public string Reason { get; set; } public RejectionType Type { get; set; } public Rejection(string reason, RejectionType type = RejectionType.Permanent) @@ -15,7 +15,7 @@ public Rejection(string reason, RejectionType type = RejectionType.Permanent) public override string ToString() { - return String.Format("[{0}] {1}", Type, Reason); + return string.Format("[{0}] {1}", Type, Reason); } } } diff --git a/src/NzbDrone.Core/DiskSpace/DiskSpace.cs b/src/NzbDrone.Core/DiskSpace/DiskSpace.cs index 137ea6cbe..43b6a4539 100644 --- a/src/NzbDrone.Core/DiskSpace/DiskSpace.cs +++ b/src/NzbDrone.Core/DiskSpace/DiskSpace.cs @@ -4,8 +4,8 @@ namespace NzbDrone.Core.DiskSpace { public class DiskSpace { - public String Path { get; set; } - public String Label { get; set; } + public string Path { get; set; } + public string Label { get; set; } public long FreeSpace { get; set; } public long TotalSpace { get; set; } } diff --git a/src/NzbDrone.Core/DiskSpace/DiskSpaceService.cs b/src/NzbDrone.Core/DiskSpace/DiskSpaceService.cs index 8e8c4f07f..9010dc873 100644 --- a/src/NzbDrone.Core/DiskSpace/DiskSpaceService.cs +++ b/src/NzbDrone.Core/DiskSpace/DiskSpaceService.cs @@ -48,7 +48,7 @@ private IEnumerable GetSeriesFreeSpace() private IEnumerable GetDroneFactoryFreeSpace() { - if (!String.IsNullOrWhiteSpace(_configService.DownloadedEpisodesFolder)) + if (!string.IsNullOrWhiteSpace(_configService.DownloadedEpisodesFolder)) { return GetDiskSpace(new[] { _diskProvider.GetPathRoot(_configService.DownloadedEpisodesFolder) }); } @@ -61,7 +61,7 @@ private IEnumerable GetFixedDisksFreeSpace() return GetDiskSpace(_diskProvider.GetFixedDrives(), true); } - private IEnumerable GetDiskSpace(IEnumerable paths, bool suppressWarnings = false) + private IEnumerable GetDiskSpace(IEnumerable paths, bool suppressWarnings = false) { foreach (var path in paths) { diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs index c524e1b86..dd83cd4d9 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs @@ -31,7 +31,7 @@ public Deluge(IDelugeProxy proxy, _proxy = proxy; } - protected override String AddFromMagnetLink(RemoteEpisode remoteEpisode, String hash, String magnetLink) + protected override string AddFromMagnetLink(RemoteEpisode remoteEpisode, string hash, string magnetLink) { var actualHash = _proxy.AddTorrentFromMagnet(magnetLink, Settings); @@ -53,7 +53,7 @@ protected override String AddFromMagnetLink(RemoteEpisode remoteEpisode, String return actualHash.ToUpper(); } - protected override String AddFromTorrentFile(RemoteEpisode remoteEpisode, String hash, String filename, Byte[] fileContent) + protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, byte[] fileContent) { var actualHash = _proxy.AddTorrentFromFile(filename, fileContent, Settings); @@ -228,13 +228,13 @@ private ValidationFailure TestConnection() DetailedDescription = "Drone is unable to connect to Deluge using SSL. This problem could be computer related. Please try to configure both drone and Deluge to not use SSL." }; default: - return new NzbDroneValidationFailure(String.Empty, "Unknown exception: " + ex.Message); + return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); } } catch (Exception ex) { _logger.ErrorException(ex.Message, ex); - return new NzbDroneValidationFailure(String.Empty, "Unknown exception: " + ex.Message); + return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); } return null; @@ -285,7 +285,7 @@ private ValidationFailure TestGetTorrents() catch (Exception ex) { _logger.ErrorException(ex.Message, ex); - return new NzbDroneValidationFailure(String.Empty, "Failed to get the list of torrents: " + ex.Message); + return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message); } return null; diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeError.cs b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeError.cs index 6c1d96f7e..05935a878 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeError.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeError.cs @@ -4,7 +4,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge { public class DelugeError { - public String Message { get; set; } - public Int32 Code { get; set; } + public string Message { get; set; } + public int Code { get; set; } } } diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeException.cs b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeException.cs index ff175a584..cbbd2ec24 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeException.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeException.cs @@ -4,9 +4,9 @@ namespace NzbDrone.Core.Download.Clients.Deluge { public class DelugeException : DownloadClientException { - public Int32 Code { get; set; } + public int Code { get; set; } - public DelugeException(String message, Int32 code) + public DelugeException(string message, int code) :base (message + " (code " + code + ")") { Code = code; diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs index b60eff61d..a85bfecd2 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeProxy.cs @@ -12,56 +12,56 @@ namespace NzbDrone.Core.Download.Clients.Deluge { public interface IDelugeProxy { - String GetVersion(DelugeSettings settings); - Dictionary GetConfig(DelugeSettings settings); + string GetVersion(DelugeSettings settings); + Dictionary GetConfig(DelugeSettings settings); DelugeTorrent[] GetTorrents(DelugeSettings settings); - DelugeTorrent[] GetTorrentsByLabel(String label, DelugeSettings settings); - String[] GetAvailablePlugins(DelugeSettings settings); - String[] GetEnabledPlugins(DelugeSettings settings); - String[] GetAvailableLabels(DelugeSettings settings); - void SetLabel(String hash, String label, DelugeSettings settings); - void SetTorrentConfiguration(String hash, String key, Object value, DelugeSettings settings); - void SetTorrentSeedingConfiguration(String hash, TorrentSeedConfiguration seedConfiguration, DelugeSettings settings); - void AddLabel(String label, DelugeSettings settings); - String AddTorrentFromMagnet(String magnetLink, DelugeSettings settings); - String AddTorrentFromFile(String filename, Byte[] fileContent, DelugeSettings settings); - Boolean RemoveTorrent(String hash, Boolean removeData, DelugeSettings settings); - void MoveTorrentToTopInQueue(String hash, DelugeSettings settings); + DelugeTorrent[] GetTorrentsByLabel(string label, DelugeSettings settings); + string[] GetAvailablePlugins(DelugeSettings settings); + string[] GetEnabledPlugins(DelugeSettings settings); + string[] GetAvailableLabels(DelugeSettings settings); + void SetLabel(string hash, string label, DelugeSettings settings); + void SetTorrentConfiguration(string hash, string key, object value, DelugeSettings settings); + void SetTorrentSeedingConfiguration(string hash, TorrentSeedConfiguration seedConfiguration, DelugeSettings settings); + void AddLabel(string label, DelugeSettings settings); + string AddTorrentFromMagnet(string magnetLink, DelugeSettings settings); + string AddTorrentFromFile(string filename, byte[] fileContent, DelugeSettings settings); + bool RemoveTorrent(string hash, bool removeData, DelugeSettings settings); + void MoveTorrentToTopInQueue(string hash, DelugeSettings settings); } public class DelugeProxy : IDelugeProxy { - private static readonly String[] requiredProperties = new String[] { "hash", "name", "state", "progress", "eta", "message", "is_finished", "save_path", "total_size", "total_done", "time_added", "active_time", "ratio", "is_auto_managed", "stop_at_ratio", "remove_at_ratio", "stop_ratio" }; + private static readonly string[] requiredProperties = new string[] { "hash", "name", "state", "progress", "eta", "message", "is_finished", "save_path", "total_size", "total_done", "time_added", "active_time", "ratio", "is_auto_managed", "stop_at_ratio", "remove_at_ratio", "stop_ratio" }; private readonly Logger _logger; private string _authPassword; private CookieContainer _authCookieContainer; - private static Int32 _callId; + private static int _callId; public DelugeProxy(Logger logger) { _logger = logger; } - public String GetVersion(DelugeSettings settings) + public string GetVersion(DelugeSettings settings) { - var response = ProcessRequest(settings, "daemon.info"); + var response = ProcessRequest(settings, "daemon.info"); return response.Result; } - public Dictionary GetConfig(DelugeSettings settings) + public Dictionary GetConfig(DelugeSettings settings) { - var response = ProcessRequest>(settings, "core.get_config"); + var response = ProcessRequest>(settings, "core.get_config"); return response.Result; } public DelugeTorrent[] GetTorrents(DelugeSettings settings) { - var filter = new Dictionary(); + var filter = new Dictionary(); // TODO: get_torrents_status returns the files as well, which starts to cause deluge timeouts when you get enough season packs. //var response = ProcessRequest>(settings, "core.get_torrents_status", filter, new String[0]); @@ -70,9 +70,9 @@ public DelugeTorrent[] GetTorrents(DelugeSettings settings) return GetTorrents(response.Result); } - public DelugeTorrent[] GetTorrentsByLabel(String label, DelugeSettings settings) + public DelugeTorrent[] GetTorrentsByLabel(string label, DelugeSettings settings) { - var filter = new Dictionary(); + var filter = new Dictionary(); filter.Add("label", label); //var response = ProcessRequest>(settings, "core.get_torrents_status", filter, new String[0]); @@ -81,83 +81,83 @@ public DelugeTorrent[] GetTorrentsByLabel(String label, DelugeSettings settings) return GetTorrents(response.Result); } - public String AddTorrentFromMagnet(String magnetLink, DelugeSettings settings) + public string AddTorrentFromMagnet(string magnetLink, DelugeSettings settings) { - var response = ProcessRequest(settings, "core.add_torrent_magnet", magnetLink, new JObject()); + var response = ProcessRequest(settings, "core.add_torrent_magnet", magnetLink, new JObject()); return response.Result; } - public String AddTorrentFromFile(String filename, Byte[] fileContent, DelugeSettings settings) + public string AddTorrentFromFile(string filename, byte[] fileContent, DelugeSettings settings) { - var response = ProcessRequest(settings, "core.add_torrent_file", filename, Convert.ToBase64String(fileContent), new JObject()); + var response = ProcessRequest(settings, "core.add_torrent_file", filename, Convert.ToBase64String(fileContent), new JObject()); return response.Result; } - public Boolean RemoveTorrent(String hashString, Boolean removeData, DelugeSettings settings) + public bool RemoveTorrent(string hashString, bool removeData, DelugeSettings settings) { - var response = ProcessRequest(settings, "core.remove_torrent", hashString, removeData); + var response = ProcessRequest(settings, "core.remove_torrent", hashString, removeData); return response.Result; } - public void MoveTorrentToTopInQueue(String hash, DelugeSettings settings) + public void MoveTorrentToTopInQueue(string hash, DelugeSettings settings) { - ProcessRequest(settings, "core.queue_top", (Object)new String[] { hash }); + ProcessRequest(settings, "core.queue_top", (object)new string[] { hash }); } - public String[] GetAvailablePlugins(DelugeSettings settings) + public string[] GetAvailablePlugins(DelugeSettings settings) { - var response = ProcessRequest(settings, "core.get_available_plugins"); + var response = ProcessRequest(settings, "core.get_available_plugins"); return response.Result; } - public String[] GetEnabledPlugins(DelugeSettings settings) + public string[] GetEnabledPlugins(DelugeSettings settings) { - var response = ProcessRequest(settings, "core.get_enabled_plugins"); + var response = ProcessRequest(settings, "core.get_enabled_plugins"); return response.Result; } - public String[] GetAvailableLabels(DelugeSettings settings) + public string[] GetAvailableLabels(DelugeSettings settings) { - var response = ProcessRequest(settings, "label.get_labels"); + var response = ProcessRequest(settings, "label.get_labels"); return response.Result; } - public void SetTorrentConfiguration(String hash, String key, Object value, DelugeSettings settings) + public void SetTorrentConfiguration(string hash, string key, object value, DelugeSettings settings) { - var arguments = new Dictionary(); + var arguments = new Dictionary(); arguments.Add(key, value); - ProcessRequest(settings, "core.set_torrent_options", new String[] { hash }, arguments); + ProcessRequest(settings, "core.set_torrent_options", new string[] { hash }, arguments); } - public void SetTorrentSeedingConfiguration(String hash, TorrentSeedConfiguration seedConfiguration, DelugeSettings settings) + public void SetTorrentSeedingConfiguration(string hash, TorrentSeedConfiguration seedConfiguration, DelugeSettings settings) { if (seedConfiguration.Ratio != null) { - var ratioArguments = new Dictionary(); + var ratioArguments = new Dictionary(); ratioArguments.Add("stop_ratio", seedConfiguration.Ratio.Value); - ProcessRequest(settings, "core.set_torrent_options", new String[]{hash}, ratioArguments); + ProcessRequest(settings, "core.set_torrent_options", new string[]{hash}, ratioArguments); } } - public void AddLabel(String label, DelugeSettings settings) + public void AddLabel(string label, DelugeSettings settings) { - ProcessRequest(settings, "label.add", label); + ProcessRequest(settings, "label.add", label); } - public void SetLabel(String hash, String label, DelugeSettings settings) + public void SetLabel(string hash, string label, DelugeSettings settings) { - ProcessRequest(settings, "label.set_torrent", hash, label); + ProcessRequest(settings, "label.set_torrent", hash, label); } - protected DelugeResponse ProcessRequest(DelugeSettings settings, String action, params Object[] arguments) + protected DelugeResponse ProcessRequest(DelugeSettings settings, string action, params object[] arguments) { var client = BuildClient(settings); @@ -204,14 +204,14 @@ protected DelugeResponse ProcessRequest(DelugeSettings setting return response; } - private DelugeResponse ProcessRequest(IRestClient client, String action, Object[] arguments) + private DelugeResponse ProcessRequest(IRestClient client, string action, object[] arguments) { var request = new RestRequest(Method.POST); request.Resource = "json"; request.RequestFormat = DataFormat.Json; request.AddHeader("Accept-Encoding", "gzip,deflate"); - var data = new Dictionary(); + var data = new Dictionary(); data.Add("id", GetCallId()); data.Add("method", action); @@ -232,14 +232,14 @@ private IRestClient BuildClient(DelugeSettings settings) { var protocol = settings.UseSsl ? "https" : "http"; - String url; + string url; if (!settings.UrlBase.IsNullOrWhiteSpace()) { - url = String.Format(@"{0}://{1}:{2}/{3}", protocol, settings.Host, settings.Port, settings.UrlBase.Trim('/')); + url = string.Format(@"{0}://{1}:{2}/{3}", protocol, settings.Host, settings.Port, settings.UrlBase.Trim('/')); } else { - url = String.Format(@"{0}://{1}:{2}", protocol, settings.Host, settings.Port); + url = string.Format(@"{0}://{1}:{2}", protocol, settings.Host, settings.Port); } var restClient = RestClientFactory.BuildClient(url); @@ -262,7 +262,7 @@ private void AuthenticateClient(IRestClient restClient) { restClient.CookieContainer = new CookieContainer(); - var result = ProcessRequest(restClient, "auth.login", new Object[] { _authPassword }); + var result = ProcessRequest(restClient, "auth.login", new object[] { _authPassword }); if (!result.Result) { @@ -277,23 +277,23 @@ private void AuthenticateClient(IRestClient restClient) private void ConnectDaemon(IRestClient restClient) { - var resultConnected = ProcessRequest(restClient, "web.connected", new Object[0]); + var resultConnected = ProcessRequest(restClient, "web.connected", new object[0]); if (resultConnected.Result) { return; } - var resultHosts = ProcessRequest>(restClient, "web.get_hosts", new Object[0]); + var resultHosts = ProcessRequest>(restClient, "web.get_hosts", new object[0]); if (resultHosts.Result != null) { // The returned list contains the id, ip, port and status of each available connection. We want the 127.0.0.1 - var connection = resultHosts.Result.FirstOrDefault(v => "127.0.0.1" == (v[1] as String)); + var connection = resultHosts.Result.FirstOrDefault(v => "127.0.0.1" == (v[1] as string)); if (connection != null) { - ProcessRequest(restClient, "web.connect", new Object[] { connection[0] }); + ProcessRequest(restClient, "web.connect", new object[] { connection[0] }); } else { @@ -302,7 +302,7 @@ private void ConnectDaemon(IRestClient restClient) } } - private Int32 GetCallId() + private int GetCallId() { return System.Threading.Interlocked.Increment(ref _callId); } diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeResponse.cs b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeResponse.cs index 7e9fd0759..3c4fe26da 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeResponse.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeResponse.cs @@ -4,7 +4,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge { public class DelugeResponse { - public Int32 Id { get; set; } + public int Id { get; set; } public TResult Result { get; set; } public DelugeError Error { get; set; } } diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeSettings.cs b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeSettings.cs index be5b39078..cd84d8798 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeSettings.cs @@ -30,28 +30,28 @@ public DelugeSettings() } [FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)] - public String Host { get; set; } + public string Host { get; set; } [FieldDefinition(1, Label = "Port", Type = FieldType.Textbox)] - public Int32 Port { get; set; } + public int Port { get; set; } [FieldDefinition(2, Label = "Url Base", Type = FieldType.Textbox, Advanced = true, HelpText = "Adds a prefix to the deluge json url, see http://[host]:[port]/[urlBase]/json")] - public String UrlBase { get; set; } + public string UrlBase { get; set; } [FieldDefinition(3, Label = "Password", Type = FieldType.Password)] - public String Password { get; set; } + public string Password { get; set; } [FieldDefinition(4, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Sonarr avoids conflicts with unrelated downloads, but it's optional")] - public String TvCategory { get; set; } + public string TvCategory { get; set; } [FieldDefinition(5, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(DelugePriority), HelpText = "Priority to use when grabbing episodes that aired within the last 14 days")] - public Int32 RecentTvPriority { get; set; } + public int RecentTvPriority { get; set; } [FieldDefinition(6, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(DelugePriority), HelpText = "Priority to use when grabbing episodes that aired over 14 days ago")] - public Int32 OlderTvPriority { get; set; } + public int OlderTvPriority { get; set; } [FieldDefinition(7, Label = "Use SSL", Type = FieldType.Checkbox)] - public Boolean UseSsl { get; set; } + public bool UseSsl { get; set; } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeTorrent.cs b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeTorrent.cs index 13db1d0f0..92f869387 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeTorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeTorrent.cs @@ -5,15 +5,15 @@ namespace NzbDrone.Core.Download.Clients.Deluge { public class DelugeTorrent { - public String Hash { get; set; } - public String Name { get; set; } - public String State { get; set; } - public Double Progress { get; set; } - public Double Eta { get; set; } - public String Message { get; set; } + public string Hash { get; set; } + public string Name { get; set; } + public string State { get; set; } + public double Progress { get; set; } + public double Eta { get; set; } + public string Message { get; set; } [JsonProperty(PropertyName = "is_finished")] - public Boolean IsFinished { get; set; } + public bool IsFinished { get; set; } // Other paths: What is the difference between 'move_completed_path' and 'move_on_completed_path'? /* @@ -24,33 +24,33 @@ public class DelugeTorrent */ [JsonProperty(PropertyName = "save_path")] - public String DownloadPath { get; set; } + public string DownloadPath { get; set; } [JsonProperty(PropertyName = "total_size")] - public Int64 Size { get; set; } + public long Size { get; set; } [JsonProperty(PropertyName = "total_done")] - public Int64 BytesDownloaded { get; set; } + public long BytesDownloaded { get; set; } [JsonProperty(PropertyName = "time_added")] - public Double DateAdded { get; set; } + public double DateAdded { get; set; } [JsonProperty(PropertyName = "active_time")] - public Int32 SecondsDownloading { get; set; } + public int SecondsDownloading { get; set; } [JsonProperty(PropertyName = "ratio")] - public Double Ratio { get; set; } + public double Ratio { get; set; } [JsonProperty(PropertyName = "is_auto_managed")] - public Boolean IsAutoManaged { get; set; } + public bool IsAutoManaged { get; set; } [JsonProperty(PropertyName = "stop_at_ratio")] - public Boolean StopAtRatio { get; set; } + public bool StopAtRatio { get; set; } [JsonProperty(PropertyName = "remove_at_ratio")] - public Boolean RemoveAtRatio { get; set; } + public bool RemoveAtRatio { get; set; } [JsonProperty(PropertyName = "stop_ratio")] - public Double StopRatio { get; set; } + public double StopRatio { get; set; } } } diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeTorrentStatus.cs b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeTorrentStatus.cs index 5c25b50ea..5f1a49085 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeTorrentStatus.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeTorrentStatus.cs @@ -4,11 +4,11 @@ namespace NzbDrone.Core.Download.Clients.Deluge { class DelugeTorrentStatus { - public const String Paused = "Paused"; - public const String Queued = "Queued"; - public const String Downloading = "Downloading"; - public const String Seeding = "Seeding"; - public const String Checking = "Checking"; - public const String Error = "Error"; + public const string Paused = "Paused"; + public const string Queued = "Queued"; + public const string Downloading = "Downloading"; + public const string Seeding = "Seeding"; + public const string Checking = "Checking"; + public const string Error = "Error"; } } diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeUpdateUIResult.cs b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeUpdateUIResult.cs index 624df2bb2..d5ef67c02 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeUpdateUIResult.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeUpdateUIResult.cs @@ -5,8 +5,8 @@ namespace NzbDrone.Core.Download.Clients.Deluge { public class DelugeUpdateUIResult { - public Dictionary Stats { get; set; } - public Boolean Connected { get; set; } - public Dictionary Torrents { get; set; } + public Dictionary Stats { get; set; } + public bool Connected { get; set; } + public Dictionary Torrents { get; set; } } } diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/ErrorModel.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/ErrorModel.cs index 86de9a15a..986ed1020 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/ErrorModel.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/ErrorModel.cs @@ -4,13 +4,13 @@ namespace NzbDrone.Core.Download.Clients.Nzbget { public class ErrorModel { - public String Name { get; set; } - public Int32 Code { get; set; } - public String Message { get; set; } + public string Name { get; set; } + public int Code { get; set; } + public string Message { get; set; } public override string ToString() { - return String.Format("Name: {0}, Code: {1}, Message: {2}", Name, Code, Message); + return string.Format("Name: {0}, Code: {1}, Message: {2}", Name, Code, Message); } } } diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/JsonError.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/JsonError.cs index ab2a132d8..f4db815b8 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/JsonError.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/JsonError.cs @@ -4,7 +4,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget { public class JsonError { - public String Version { get; set; } + public string Version { get; set; } public ErrorModel Error { get; set; } } } diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/JsonRequest.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/JsonRequest.cs index 78eefc23d..a7eaf4804 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/JsonRequest.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/JsonRequest.cs @@ -4,7 +4,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget { public class JsonRequest { - public String Method { get; set; } + public string Method { get; set; } public object[] Params { get; set; } public JsonRequest(string method) diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs index 83313b7ba..9e689c94b 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs @@ -62,7 +62,7 @@ private IEnumerable GetQueue() var queueItems = new List(); - Int64 totalRemainingSize = 0; + long totalRemainingSize = 0; foreach (var item in queue) { @@ -138,7 +138,7 @@ private IEnumerable GetHistory() historyItem.TotalSize = MakeInt64(item.FileSizeHi, item.FileSizeLo); historyItem.OutputPath = _remotePathMappingService.RemapRemoteToLocal(Settings.Host, new OsPath(item.DestDir)); historyItem.Category = item.Category; - historyItem.Message = String.Format("PAR Status: {0} - Unpack Status: {1} - Move Status: {2} - Script Status: {3} - Delete Status: {4} - Mark Status: {5}", item.ParStatus, item.UnpackStatus, item.MoveStatus, item.ScriptStatus, item.DeleteStatus, item.MarkStatus); + historyItem.Message = string.Format("PAR Status: {0} - Unpack Status: {1} - Move Status: {2} - Script Status: {3} - Delete Status: {4} - Mark Status: {5}", item.ParStatus, item.UnpackStatus, item.MoveStatus, item.ScriptStatus, item.DeleteStatus, item.MarkStatus); historyItem.Status = DownloadItemStatus.Completed; historyItem.RemainingTime = TimeSpan.Zero; @@ -229,7 +229,7 @@ public override DownloadClientStatus GetStatus() return status; } - protected IEnumerable GetCategories(Dictionary config) + protected IEnumerable GetCategories(Dictionary config) { for (int i = 1; i < 100; i++) { @@ -242,7 +242,7 @@ protected IEnumerable GetCategories(Dictionary c if (destDir.IsNullOrWhiteSpace()) { var mainDir = config.GetValueOrDefault("MainDir"); - destDir = config.GetValueOrDefault("DestDir", String.Empty).Replace("${MainDir}", mainDir); + destDir = config.GetValueOrDefault("DestDir", string.Empty).Replace("${MainDir}", mainDir); if (config.GetValueOrDefault("AppendCategoryDir", "yes") == "yes") { @@ -300,7 +300,7 @@ private ValidationFailure TestCategory() { return new NzbDroneValidationFailure("TvCategory", "Category does not exist") { - InfoLink = String.Format("http://{0}:{1}/", Settings.Host, Settings.Port), + InfoLink = string.Format("http://{0}:{1}/", Settings.Host, Settings.Port), DetailedDescription = "The Category your entered doesn't exist in NzbGet. Go to NzbGet to create it." }; } @@ -311,11 +311,11 @@ private ValidationFailure TestCategory() // Javascript doesn't support 64 bit integers natively so json officially doesn't either. // NzbGet api thus sends it in two 32 bit chunks. Here we join the two chunks back together. // Simplified decimal example: "42" splits into "4" and "2". To join them I shift (<<) the "4" 1 digit to the left = "40". combine it with "2". which becomes "42" again. - private Int64 MakeInt64(UInt32 high, UInt32 low) + private long MakeInt64(uint high, uint low) { - Int64 result = high; + long result = high; - result = (result << 32) | (Int64)low; + result = (result << 32) | (long)low; return result; } diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetCategory.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetCategory.cs index c9fc19a4e..0b53e32e1 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetCategory.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetCategory.cs @@ -4,10 +4,10 @@ namespace NzbDrone.Core.Download.Clients.Nzbget { public class NzbgetCategory { - public String Name { get; set; } - public String DestDir { get; set; } - public Boolean Unpack { get; set; } - public String DefScript { get; set; } - public String Aliases { get; set; } + public string Name { get; set; } + public string DestDir { get; set; } + public bool Unpack { get; set; } + public string DefScript { get; set; } + public string Aliases { get; set; } } } diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetConfigItem.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetConfigItem.cs index 87bb5e7f6..eb43db0d8 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetConfigItem.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetConfigItem.cs @@ -4,7 +4,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget { public class NzbgetConfigItem { - public String Name { get; set; } - public String Value { get; set; } + public string Name { get; set; } + public string Value { get; set; } } } diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetHistoryItem.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetHistoryItem.cs index f02c483f3..b52efe596 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetHistoryItem.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetHistoryItem.cs @@ -5,18 +5,18 @@ namespace NzbDrone.Core.Download.Clients.Nzbget { public class NzbgetHistoryItem { - public Int32 Id { get; set; } - public String Name { get; set; } - public String Category { get; set; } - public UInt32 FileSizeLo { get; set; } - public UInt32 FileSizeHi { get; set; } - public String ParStatus { get; set; } - public String UnpackStatus { get; set; } - public String MoveStatus { get; set; } - public String ScriptStatus { get; set; } - public String DeleteStatus { get; set; } - public String MarkStatus { get; set; } - public String DestDir { get; set; } + public int Id { get; set; } + public string Name { get; set; } + public string Category { get; set; } + public uint FileSizeLo { get; set; } + public uint FileSizeHi { get; set; } + public string ParStatus { get; set; } + public string UnpackStatus { get; set; } + public string MoveStatus { get; set; } + public string ScriptStatus { get; set; } + public string DeleteStatus { get; set; } + public string MarkStatus { get; set; } + public string DestDir { get; set; } public List Parameters { get; set; } } } diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetParameter.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetParameter.cs index d2b728e85..d786be1cd 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetParameter.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetParameter.cs @@ -3,7 +3,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget { public class NzbgetParameter { - public String Name { get; set; } + public string Name { get; set; } public object Value { get; set; } } } diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetPostQueueItem.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetPostQueueItem.cs index edb436048..b4a847736 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetPostQueueItem.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetPostQueueItem.cs @@ -4,13 +4,13 @@ namespace NzbDrone.Core.Download.Clients.Nzbget { public class NzbgetPostQueueItem { - public Int32 NzbId { get; set; } - public String NzbName { get; set; } - public String Stage { get; set; } - public String ProgressLabel { get; set; } - public Int32 FileProgress { get; set; } - public Int32 StageProgress { get; set; } - public Int32 TotalTimeSec { get; set; } - public Int32 StageTimeSec { get; set; } + public int NzbId { get; set; } + public string NzbName { get; set; } + public string Stage { get; set; } + public string ProgressLabel { get; set; } + public int FileProgress { get; set; } + public int StageProgress { get; set; } + public int TotalTimeSec { get; set; } + public int StageTimeSec { get; set; } } } diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetProxy.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetProxy.cs index f197855d0..c933d58c2 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetProxy.cs @@ -10,12 +10,12 @@ namespace NzbDrone.Core.Download.Clients.Nzbget { public interface INzbgetProxy { - string DownloadNzb(Byte[] nzbData, string title, string category, int priority, NzbgetSettings settings); + string DownloadNzb(byte[] nzbData, string title, string category, int priority, NzbgetSettings settings); NzbgetGlobalStatus GetGlobalStatus(NzbgetSettings settings); List GetQueue(NzbgetSettings settings); List GetHistory(NzbgetSettings settings); - String GetVersion(NzbgetSettings settings); - Dictionary GetConfig(NzbgetSettings settings); + string GetVersion(NzbgetSettings settings); + Dictionary GetConfig(NzbgetSettings settings); void RemoveItem(string id, NzbgetSettings settings); void RetryDownload(string id, NzbgetSettings settings); } @@ -29,12 +29,12 @@ public NzbgetProxy(Logger logger) _logger = logger; } - public string DownloadNzb(Byte[] nzbData, string title, string category, int priority, NzbgetSettings settings) + public string DownloadNzb(byte[] nzbData, string title, string category, int priority, NzbgetSettings settings) { var parameters = new object[] { title, category, priority, false, Convert.ToBase64String(nzbData) }; var request = BuildRequest(new JsonRequest("append", parameters)); - var response = Json.Deserialize>(ProcessRequest(request, settings)); + var response = Json.Deserialize>(ProcessRequest(request, settings)); _logger.Trace("Response: [{0}]", response.Result); if (!response.Result) @@ -82,14 +82,14 @@ public List GetHistory(NzbgetSettings settings) return Json.Deserialize>>(ProcessRequest(request, settings)).Result; } - public String GetVersion(NzbgetSettings settings) + public string GetVersion(NzbgetSettings settings) { var request = BuildRequest(new JsonRequest("version")); - return Json.Deserialize>(ProcessRequest(request, settings)).Result; + return Json.Deserialize>(ProcessRequest(request, settings)).Result; } - public Dictionary GetConfig(NzbgetSettings settings) + public Dictionary GetConfig(NzbgetSettings settings) { var request = BuildRequest(new JsonRequest("config")); @@ -162,7 +162,7 @@ private bool EditQueue(string command, int offset, string editText, int id, Nzbg { var parameters = new object[] { command, offset, editText, id }; var request = BuildRequest(new JsonRequest("editqueue", parameters)); - var response = Json.Deserialize>(ProcessRequest(request, settings)); + var response = Json.Deserialize>(ProcessRequest(request, settings)); return response.Result; } @@ -182,7 +182,7 @@ private IRestClient BuildClient(NzbgetSettings settings) { var protocol = settings.UseSsl ? "https" : "http"; - var url = String.Format("{0}://{1}:{2}/jsonrpc", + var url = string.Format("{0}://{1}:{2}/jsonrpc", protocol, settings.Host, settings.Port); diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetQueueItem.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetQueueItem.cs index a951bd57d..d2b965a72 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetQueueItem.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetQueueItem.cs @@ -5,20 +5,20 @@ namespace NzbDrone.Core.Download.Clients.Nzbget { public class NzbgetQueueItem { - public Int32 NzbId { get; set; } - public Int32 FirstId { get; set; } - public Int32 LastId { get; set; } - public String NzbName { get; set; } - public String Category { get; set; } - public UInt32 FileSizeLo { get; set; } - public UInt32 FileSizeHi { get; set; } - public UInt32 RemainingSizeLo { get; set; } - public UInt32 RemainingSizeHi { get; set; } - public UInt32 PausedSizeLo { get; set; } - public UInt32 PausedSizeHi { get; set; } - public Int32 MinPriority { get; set; } - public Int32 MaxPriority { get; set; } - public Int32 ActiveDownloads { get; set; } + public int NzbId { get; set; } + public int FirstId { get; set; } + public int LastId { get; set; } + public string NzbName { get; set; } + public string Category { get; set; } + public uint FileSizeLo { get; set; } + public uint FileSizeHi { get; set; } + public uint RemainingSizeLo { get; set; } + public uint RemainingSizeHi { get; set; } + public uint PausedSizeLo { get; set; } + public uint PausedSizeHi { get; set; } + public int MinPriority { get; set; } + public int MaxPriority { get; set; } + public int ActiveDownloads { get; set; } public List Parameters { get; set; } } } diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetResponse.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetResponse.cs index a07b37b2d..f77d0ccb3 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetResponse.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetResponse.cs @@ -4,7 +4,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget { public class NzbgetResponse { - public String Version { get; set; } + public string Version { get; set; } public T Result { get; set; } diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetSettings.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetSettings.cs index 3f0f01e9a..a1783c4dc 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetSettings.cs @@ -12,8 +12,8 @@ public NzbgetSettingsValidator() { RuleFor(c => c.Host).ValidHost(); RuleFor(c => c.Port).GreaterThan(0); - RuleFor(c => c.Username).NotEmpty().When(c => !String.IsNullOrWhiteSpace(c.Password)); - RuleFor(c => c.Password).NotEmpty().When(c => !String.IsNullOrWhiteSpace(c.Username)); + RuleFor(c => c.Username).NotEmpty().When(c => !string.IsNullOrWhiteSpace(c.Password)); + RuleFor(c => c.Password).NotEmpty().When(c => !string.IsNullOrWhiteSpace(c.Username)); RuleFor(c => c.TvCategory).NotEmpty().WithMessage("A category is recommended").AsWarning(); } @@ -33,28 +33,28 @@ public NzbgetSettings() } [FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)] - public String Host { get; set; } + public string Host { get; set; } [FieldDefinition(1, Label = "Port", Type = FieldType.Textbox)] - public Int32 Port { get; set; } + public int Port { get; set; } [FieldDefinition(2, Label = "Username", Type = FieldType.Textbox)] - public String Username { get; set; } + public string Username { get; set; } [FieldDefinition(3, Label = "Password", Type = FieldType.Password)] - public String Password { get; set; } + public string Password { get; set; } [FieldDefinition(4, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Sonarr avoids conflicts with unrelated downloads, but it's optional")] - public String TvCategory { get; set; } + public string TvCategory { get; set; } [FieldDefinition(5, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(NzbgetPriority), HelpText = "Priority to use when grabbing episodes that aired within the last 14 days")] - public Int32 RecentTvPriority { get; set; } + public int RecentTvPriority { get; set; } [FieldDefinition(6, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(NzbgetPriority), HelpText = "Priority to use when grabbing episodes that aired over 14 days ago")] - public Int32 OlderTvPriority { get; set; } + public int OlderTvPriority { get; set; } [FieldDefinition(7, Label = "Use SSL", Type = FieldType.Checkbox)] - public Boolean UseSsl { get; set; } + public bool UseSsl { get; set; } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs b/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs index aae8a3eec..5fc631ecd 100644 --- a/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs +++ b/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs @@ -134,9 +134,9 @@ protected override void Test(List failures) failures.AddIfNotNull(TestFolder(Settings.StrmFolder, "StrmFolder")); } - private String WriteStrmFile(String title, String nzbFile) + private string WriteStrmFile(string title, string nzbFile) { - String folder; + string folder; if (Settings.StrmFolder.IsNullOrWhiteSpace()) { @@ -153,7 +153,7 @@ private String WriteStrmFile(String title, String nzbFile) folder = Settings.StrmFolder; } - var contents = String.Format("plugin://plugin.program.pneumatic/?mode=strm&type=add_file&nzb={0}&nzbname={1}", nzbFile, title); + var contents = string.Format("plugin://plugin.program.pneumatic/?mode=strm&type=add_file&nzb={0}&nzbname={1}", nzbFile, title); var filename = Path.Combine(folder, title + ".strm"); _diskProvider.WriteAllText(filename, contents); @@ -161,7 +161,7 @@ private String WriteStrmFile(String title, String nzbFile) return filename; } - private String GetDownloadClientId(String filename) + private string GetDownloadClientId(string filename) { return Definition.Name + "_" + Path.GetFileName(filename) + "_" + _diskProvider.FileGetLastWrite(filename).Ticks; } diff --git a/src/NzbDrone.Core/Download/Clients/Pneumatic/PneumaticSettings.cs b/src/NzbDrone.Core/Download/Clients/Pneumatic/PneumaticSettings.cs index c9aa3fde0..e1e84969b 100644 --- a/src/NzbDrone.Core/Download/Clients/Pneumatic/PneumaticSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/Pneumatic/PneumaticSettings.cs @@ -21,10 +21,10 @@ public class PneumaticSettings : IProviderConfig private static readonly PneumaticSettingsValidator Validator = new PneumaticSettingsValidator(); [FieldDefinition(0, Label = "Nzb Folder", Type = FieldType.Path, HelpText = "This folder will need to be reachable from XBMC")] - public String NzbFolder { get; set; } + public string NzbFolder { get; set; } [FieldDefinition(1, Label = "Strm Folder", Type = FieldType.Path, HelpText = ".strm files in this folder will be import by drone")] - public String StrmFolder { get; set; } + public string StrmFolder { get; set; } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Responses/SabnzbdCategoryResponse.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Responses/SabnzbdCategoryResponse.cs index 03d71bee5..025f5bd53 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Responses/SabnzbdCategoryResponse.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Responses/SabnzbdCategoryResponse.cs @@ -7,9 +7,9 @@ public class SabnzbdCategoryResponse { public SabnzbdCategoryResponse() { - Categories = new List(); + Categories = new List(); } - public List Categories { get; set; } + public List Categories { get; set; } } } diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs index a71b55d2f..d2de74189 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs @@ -303,7 +303,7 @@ private ValidationFailure TestGlobalConfig() { return new NzbDroneValidationFailure("", "Disable 'Check before download' option in Sabnbzd") { - InfoLink = String.Format("http://{0}:{1}/sabnzbd/config/switches/", Settings.Host, Settings.Port), + InfoLink = string.Format("http://{0}:{1}/sabnzbd/config/switches/", Settings.Host, Settings.Port), DetailedDescription = "Using Check before download affects Sonarr ability to track new downloads. Also Sabnzbd recommends 'Abort jobs that cannot be completed' instead since it's more effective." }; } @@ -322,7 +322,7 @@ private ValidationFailure TestCategory() { return new NzbDroneValidationFailure("TvCategory", "Enable Job folders") { - InfoLink = String.Format("http://{0}:{1}/sabnzbd/config/categories/", Settings.Host, Settings.Port), + InfoLink = string.Format("http://{0}:{1}/sabnzbd/config/categories/", Settings.Host, Settings.Port), DetailedDescription = "Sonarr prefers each download to have a separate folder. With * appended to the Folder/Path Sabnzbd will not create these job folders. Go to Sabnzbd to fix it." }; } @@ -333,7 +333,7 @@ private ValidationFailure TestCategory() { return new NzbDroneValidationFailure("TvCategory", "Category does not exist") { - InfoLink = String.Format("http://{0}:{1}/sabnzbd/config/categories/", Settings.Host, Settings.Port), + InfoLink = string.Format("http://{0}:{1}/sabnzbd/config/categories/", Settings.Host, Settings.Port), DetailedDescription = "The Category your entered doesn't exist in Sabnzbd. Go to Sabnzbd to create it." }; } @@ -347,7 +347,7 @@ private ValidationFailure TestCategory() { return new NzbDroneValidationFailure("TvCategory", "Disable TV Sorting") { - InfoLink = String.Format("http://{0}:{1}/sabnzbd/config/sorting/", Settings.Host, Settings.Port), + InfoLink = string.Format("http://{0}:{1}/sabnzbd/config/sorting/", Settings.Host, Settings.Port), DetailedDescription = "You must disable Sabnzbd TV Sorting for the category Sonarr uses to prevent import issues. Go to Sabnzbd to fix it." }; } diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdCategory.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdCategory.cs index 9f9bcec8d..d8885c567 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdCategory.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdCategory.cs @@ -10,24 +10,24 @@ public class SabnzbdConfig public List Categories { get; set; } - public List Servers { get; set; } + public List Servers { get; set; } } public class SabnzbdConfigMisc { - public String complete_dir { get; set; } - public String[] tv_categories { get; set; } - public Boolean enable_tv_sorting { get; set; } - public Boolean pre_check { get; set; } + public string complete_dir { get; set; } + public string[] tv_categories { get; set; } + public bool enable_tv_sorting { get; set; } + public bool pre_check { get; set; } } public class SabnzbdCategory { - public Int32 Priority { get; set; } - public String PP { get; set; } - public String Name { get; set; } - public String Script { get; set; } - public String Dir { get; set; } + public int Priority { get; set; } + public string PP { get; set; } + public string Name { get; set; } + public string Script { get; set; } + public string Dir { get; set; } public OsPath FullPath { get; set; } } diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdHistoryItem.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdHistoryItem.cs index 5a5f80ceb..2cae34c4b 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdHistoryItem.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdHistoryItem.cs @@ -9,7 +9,7 @@ public class SabnzbdHistoryItem public string FailMessage { get; set; } [JsonProperty(PropertyName = "bytes")] - public Int64 Size { get; set; } + public long Size { get; set; } public string Category { get; set; } [JsonProperty(PropertyName = "nzb_name")] diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdJsonError.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdJsonError.cs index 853c7e104..1054cf393 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdJsonError.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdJsonError.cs @@ -11,7 +11,7 @@ public bool Failed { get { - return !String.IsNullOrWhiteSpace(Status) && + return !string.IsNullOrWhiteSpace(Status) && Status.Equals("false", StringComparison.InvariantCultureIgnoreCase); } } diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdProxy.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdProxy.cs index d563c1d50..a656f354a 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdProxy.cs @@ -11,7 +11,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd { public interface ISabnzbdProxy { - SabnzbdAddResponse DownloadNzb(Byte[] nzbData, string filename, string category, int priority, SabnzbdSettings settings); + SabnzbdAddResponse DownloadNzb(byte[] nzbData, string filename, string category, int priority, SabnzbdSettings settings); void RemoveFrom(string source, string id,bool deleteData, SabnzbdSettings settings); string ProcessRequest(IRestRequest restRequest, string action, SabnzbdSettings settings); SabnzbdVersionResponse GetVersion(SabnzbdSettings settings); @@ -30,10 +30,10 @@ public SabnzbdProxy(Logger logger) _logger = logger; } - public SabnzbdAddResponse DownloadNzb(Byte[] nzbData, string filename, string category, int priority, SabnzbdSettings settings) + public SabnzbdAddResponse DownloadNzb(byte[] nzbData, string filename, string category, int priority, SabnzbdSettings settings) { var request = new RestRequest(Method.POST); - var action = String.Format("mode=addfile&cat={0}&priority={1}", Uri.EscapeDataString(category), priority); + var action = string.Format("mode=addfile&cat={0}&priority={1}", Uri.EscapeDataString(category), priority); request.AddFile("name", nzbData, filename, "application/x-nzb"); @@ -52,7 +52,7 @@ public void RemoveFrom(string source, string id, bool deleteData, SabnzbdSetting { var request = new RestRequest(); - var action = String.Format("mode={0}&name=delete&del_files={1}&value={2}", source, deleteData ? 1 : 0, id); + var action = string.Format("mode={0}&name=delete&del_files={1}&value={2}", source, deleteData ? 1 : 0, id); ProcessRequest(request, action, settings); } @@ -96,7 +96,7 @@ public SabnzbdConfig GetConfig(SabnzbdSettings settings) public SabnzbdQueue GetQueue(int start, int limit, SabnzbdSettings settings) { var request = new RestRequest(); - var action = String.Format("mode=queue&start={0}&limit={1}", start, limit); + var action = string.Format("mode=queue&start={0}&limit={1}", start, limit); var response = ProcessRequest(request, action, settings); return Json.Deserialize(JObject.Parse(response).SelectToken("queue").ToString()); @@ -105,7 +105,7 @@ public SabnzbdQueue GetQueue(int start, int limit, SabnzbdSettings settings) public SabnzbdHistory GetHistory(int start, int limit, SabnzbdSettings settings) { var request = new RestRequest(); - var action = String.Format("mode=history&start={0}&limit={1}", start, limit); + var action = string.Format("mode=history&start={0}&limit={1}", start, limit); var response = ProcessRequest(request, action, settings); return Json.Deserialize(JObject.Parse(response).SelectToken("history").ToString()); @@ -114,7 +114,7 @@ public SabnzbdHistory GetHistory(int start, int limit, SabnzbdSettings settings) public string RetryDownload(string id, SabnzbdSettings settings) { var request = new RestRequest(); - var action = String.Format("mode=retry&value={0}", id); + var action = string.Format("mode=retry&value={0}", id); SabnzbdRetryResponse response; @@ -132,10 +132,10 @@ private IRestClient BuildClient(string action, SabnzbdSettings settings) var protocol = settings.UseSsl ? "https" : "http"; var authentication = settings.ApiKey.IsNullOrWhiteSpace() ? - String.Format("ma_username={0}&ma_password={1}", settings.Username, Uri.EscapeDataString(settings.Password)) : - String.Format("apikey={0}", settings.ApiKey); + string.Format("ma_username={0}&ma_password={1}", settings.Username, Uri.EscapeDataString(settings.Password)) : + string.Format("apikey={0}", settings.ApiKey); - var url = String.Format(@"{0}://{1}:{2}/api?{3}&{4}&output=json", + var url = string.Format(@"{0}://{1}:{2}/api?{3}&{4}&output=json", protocol, settings.Host, settings.Port, diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdSettings.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdSettings.cs index 7007f7d3a..beb83541d 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdSettings.cs @@ -15,15 +15,15 @@ public SabnzbdSettingsValidator() RuleFor(c => c.ApiKey).NotEmpty() .WithMessage("API Key is required when username/password are not configured") - .When(c => String.IsNullOrWhiteSpace(c.Username)); + .When(c => string.IsNullOrWhiteSpace(c.Username)); RuleFor(c => c.Username).NotEmpty() .WithMessage("Username is required when API key is not configured") - .When(c => String.IsNullOrWhiteSpace(c.ApiKey)); + .When(c => string.IsNullOrWhiteSpace(c.ApiKey)); RuleFor(c => c.Password).NotEmpty() .WithMessage("Password is required when API key is not configured") - .When(c => String.IsNullOrWhiteSpace(c.ApiKey)); + .When(c => string.IsNullOrWhiteSpace(c.ApiKey)); RuleFor(c => c.TvCategory).NotEmpty() .WithMessage("A category is recommended") @@ -45,31 +45,31 @@ public SabnzbdSettings() } [FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)] - public String Host { get; set; } + public string Host { get; set; } [FieldDefinition(1, Label = "Port", Type = FieldType.Textbox)] - public Int32 Port { get; set; } + public int Port { get; set; } [FieldDefinition(2, Label = "API Key", Type = FieldType.Textbox)] - public String ApiKey { get; set; } + public string ApiKey { get; set; } [FieldDefinition(3, Label = "Username", Type = FieldType.Textbox)] - public String Username { get; set; } + public string Username { get; set; } [FieldDefinition(4, Label = "Password", Type = FieldType.Password)] - public String Password { get; set; } + public string Password { get; set; } [FieldDefinition(5, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Sonarr avoids conflicts with unrelated downloads, but it's optional")] - public String TvCategory { get; set; } + public string TvCategory { get; set; } [FieldDefinition(6, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(SabnzbdPriority), HelpText = "Priority to use when grabbing episodes that aired within the last 14 days")] - public Int32 RecentTvPriority { get; set; } + public int RecentTvPriority { get; set; } [FieldDefinition(7, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(SabnzbdPriority), HelpText = "Priority to use when grabbing episodes that aired over 14 days ago")] - public Int32 OlderTvPriority { get; set; } + public int OlderTvPriority { get; set; } [FieldDefinition(8, Label = "Use SSL", Type = FieldType.Checkbox)] - public Boolean UseSsl { get; set; } + public bool UseSsl { get; set; } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Download/Clients/TorrentBlackhole/TorrentBlackhole.cs b/src/NzbDrone.Core/Download/Clients/TorrentBlackhole/TorrentBlackhole.cs index 8dfc7a55c..21fff8859 100644 --- a/src/NzbDrone.Core/Download/Clients/TorrentBlackhole/TorrentBlackhole.cs +++ b/src/NzbDrone.Core/Download/Clients/TorrentBlackhole/TorrentBlackhole.cs @@ -44,7 +44,7 @@ protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string title = FileNameBuilder.CleanFileName(title); - var filepath = Path.Combine(Settings.TorrentFolder, String.Format("{0}.torrent", title)); + var filepath = Path.Combine(Settings.TorrentFolder, string.Format("{0}.torrent", title)); using (var stream = _diskProvider.OpenWriteStream(filepath)) { diff --git a/src/NzbDrone.Core/Download/Clients/TorrentBlackhole/TorrentBlackholeSettings.cs b/src/NzbDrone.Core/Download/Clients/TorrentBlackhole/TorrentBlackholeSettings.cs index 4a80b2d63..5d953396e 100644 --- a/src/NzbDrone.Core/Download/Clients/TorrentBlackhole/TorrentBlackholeSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/TorrentBlackhole/TorrentBlackholeSettings.cs @@ -21,10 +21,10 @@ public class TorrentBlackholeSettings : IProviderConfig private static readonly TorrentBlackholeSettingsValidator Validator = new TorrentBlackholeSettingsValidator(); [FieldDefinition(0, Label = "Torrent Folder", Type = FieldType.Path, HelpText = "Folder in which Sonarr will store the .torrent file")] - public String TorrentFolder { get; set; } + public string TorrentFolder { get; set; } [FieldDefinition(1, Label = "Watch Folder", Type = FieldType.Path, HelpText = "Folder from which Sonarr should import completed downloads")] - public String WatchFolder { get; set; } + public string WatchFolder { get; set; } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Download/Clients/TorrentSeedConfiguration.cs b/src/NzbDrone.Core/Download/Clients/TorrentSeedConfiguration.cs index ec6572957..9c4b279dc 100644 --- a/src/NzbDrone.Core/Download/Clients/TorrentSeedConfiguration.cs +++ b/src/NzbDrone.Core/Download/Clients/TorrentSeedConfiguration.cs @@ -6,7 +6,7 @@ public class TorrentSeedConfiguration { public static TorrentSeedConfiguration DefaultConfiguration = new TorrentSeedConfiguration(); - public Double? Ratio { get; set; } + public double? Ratio { get; set; } public TimeSpan? SeedTime { get; set; } } } diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/Transmission.cs b/src/NzbDrone.Core/Download/Clients/Transmission/Transmission.cs index 2ad0e6698..4c37bbbbf 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/Transmission.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/Transmission.cs @@ -33,7 +33,7 @@ public Transmission(ITransmissionProxy proxy, } - protected override String AddFromMagnetLink(RemoteEpisode remoteEpisode, String hash, String magnetLink) + protected override string AddFromMagnetLink(RemoteEpisode remoteEpisode, string hash, string magnetLink) { _proxy.AddTorrentFromUrl(magnetLink, GetDownloadDirectory(), Settings); @@ -48,7 +48,7 @@ protected override String AddFromMagnetLink(RemoteEpisode remoteEpisode, String return hash; } - protected override String AddFromTorrentFile(RemoteEpisode remoteEpisode, String hash, String filename, Byte[] fileContent) + protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, byte[] fileContent) { _proxy.AddTorrentFromData(fileContent, GetDownloadDirectory(), Settings); @@ -63,12 +63,12 @@ protected override String AddFromTorrentFile(RemoteEpisode remoteEpisode, String return hash; } - private String GetDownloadDirectory() + private string GetDownloadDirectory() { if (Settings.TvCategory.IsNullOrWhiteSpace()) return null; var config = _proxy.GetConfig(Settings); - var destDir = (String)config.GetValueOrDefault("download-dir"); + var destDir = (string)config.GetValueOrDefault("download-dir"); return string.Format("{0}/{1}", destDir.TrimEnd('/'), Settings.TvCategory); } @@ -104,7 +104,7 @@ public override IEnumerable GetItems() if (Settings.TvCategory.IsNotNullOrWhiteSpace()) { var directories = outputPath.FullPath.Split('\\', '/'); - if (!directories.Contains(String.Format("{0}", Settings.TvCategory))) continue; + if (!directories.Contains(string.Format("{0}", Settings.TvCategory))) continue; } var item = new DownloadClientItem(); @@ -164,7 +164,7 @@ public override DownloadClientStatus GetStatus() if (Settings.TvCategory.IsNotNullOrWhiteSpace()) { - destDir = String.Format("{0}/.{1}", destDir, Settings.TvCategory); + destDir = string.Format("{0}/.{1}", destDir, Settings.TvCategory); } return new DownloadClientStatus @@ -215,12 +215,12 @@ private ValidationFailure TestConnection() DetailedDescription = "Please verify the hostname and port." }; } - return new NzbDroneValidationFailure(String.Empty, "Unknown exception: " + ex.Message); + return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); } catch (Exception ex) { _logger.ErrorException(ex.Message, ex); - return new NzbDroneValidationFailure(String.Empty, "Unknown exception: " + ex.Message); + return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); } return null; @@ -235,7 +235,7 @@ private ValidationFailure TestGetTorrents() catch (Exception ex) { _logger.ErrorException(ex.Message, ex); - return new NzbDroneValidationFailure(String.Empty, "Failed to get the list of torrents: " + ex.Message); + return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message); } return null; diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionException.cs b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionException.cs index 435b51aa0..8cb3d6942 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionException.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionException.cs @@ -4,7 +4,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission { public class TransmissionException : DownloadClientException { - public TransmissionException(String message) + public TransmissionException(string message) : base(message) { diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionProxy.cs b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionProxy.cs index c0c30195d..0bc00da5a 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionProxy.cs @@ -13,19 +13,19 @@ namespace NzbDrone.Core.Download.Clients.Transmission public interface ITransmissionProxy { List GetTorrents(TransmissionSettings settings); - void AddTorrentFromUrl(String torrentUrl, String downloadDirectory, TransmissionSettings settings); - void AddTorrentFromData(Byte[] torrentData, String downloadDirectory, TransmissionSettings settings); - void SetTorrentSeedingConfiguration(String hash, TorrentSeedConfiguration seedConfiguration, TransmissionSettings settings); - Dictionary GetConfig(TransmissionSettings settings); - String GetVersion(TransmissionSettings settings); - void RemoveTorrent(String hash, Boolean removeData, TransmissionSettings settings); - void MoveTorrentToTopInQueue(String hashString, TransmissionSettings settings); + void AddTorrentFromUrl(string torrentUrl, string downloadDirectory, TransmissionSettings settings); + void AddTorrentFromData(byte[] torrentData, string downloadDirectory, TransmissionSettings settings); + void SetTorrentSeedingConfiguration(string hash, TorrentSeedConfiguration seedConfiguration, TransmissionSettings settings); + Dictionary GetConfig(TransmissionSettings settings); + string GetVersion(TransmissionSettings settings); + void RemoveTorrent(string hash, bool removeData, TransmissionSettings settings); + void MoveTorrentToTopInQueue(string hashString, TransmissionSettings settings); } public class TransmissionProxy: ITransmissionProxy { private readonly Logger _logger; - private String _sessionId; + private string _sessionId; public TransmissionProxy(Logger logger) { @@ -41,9 +41,9 @@ public List GetTorrents(TransmissionSettings settings) return torrents; } - public void AddTorrentFromUrl(String torrentUrl, String downloadDirectory, TransmissionSettings settings) + public void AddTorrentFromUrl(string torrentUrl, string downloadDirectory, TransmissionSettings settings) { - var arguments = new Dictionary(); + var arguments = new Dictionary(); arguments.Add("filename", torrentUrl); if (!downloadDirectory.IsNullOrWhiteSpace()) @@ -54,9 +54,9 @@ public void AddTorrentFromUrl(String torrentUrl, String downloadDirectory, Trans ProcessRequest("torrent-add", arguments, settings); } - public void AddTorrentFromData(Byte[] torrentData, String downloadDirectory, TransmissionSettings settings) + public void AddTorrentFromData(byte[] torrentData, string downloadDirectory, TransmissionSettings settings) { - var arguments = new Dictionary(); + var arguments = new Dictionary(); arguments.Add("metainfo", Convert.ToBase64String(torrentData)); if (!downloadDirectory.IsNullOrWhiteSpace()) @@ -67,10 +67,10 @@ public void AddTorrentFromData(Byte[] torrentData, String downloadDirectory, Tra ProcessRequest("torrent-add", arguments, settings); } - public void SetTorrentSeedingConfiguration(String hash, TorrentSeedConfiguration seedConfiguration, TransmissionSettings settings) + public void SetTorrentSeedingConfiguration(string hash, TorrentSeedConfiguration seedConfiguration, TransmissionSettings settings) { - var arguments = new Dictionary(); - arguments.Add("ids", new String[] { hash }); + var arguments = new Dictionary(); + arguments.Add("ids", new string[] { hash }); if (seedConfiguration.Ratio != null) { @@ -87,7 +87,7 @@ public void SetTorrentSeedingConfiguration(String hash, TorrentSeedConfiguration ProcessRequest("torrent-set", arguments, settings); } - public String GetVersion(TransmissionSettings settings) + public string GetVersion(TransmissionSettings settings) { // Gets the transmission version. var config = GetConfig(settings); @@ -97,7 +97,7 @@ public String GetVersion(TransmissionSettings settings) return version.ToString(); } - public Dictionary GetConfig(TransmissionSettings settings) + public Dictionary GetConfig(TransmissionSettings settings) { // Gets the transmission version. var result = GetSessionVariables(settings); @@ -105,19 +105,19 @@ public Dictionary GetConfig(TransmissionSettings settings) return result.Arguments; } - public void RemoveTorrent(String hashString, Boolean removeData, TransmissionSettings settings) + public void RemoveTorrent(string hashString, bool removeData, TransmissionSettings settings) { - var arguments = new Dictionary(); - arguments.Add("ids", new String[] { hashString }); + var arguments = new Dictionary(); + arguments.Add("ids", new string[] { hashString }); arguments.Add("delete-local-data", removeData); ProcessRequest("torrent-remove", arguments, settings); } - public void MoveTorrentToTopInQueue(String hashString, TransmissionSettings settings) + public void MoveTorrentToTopInQueue(string hashString, TransmissionSettings settings) { - var arguments = new Dictionary(); - arguments.Add("ids", new String[] { hashString }); + var arguments = new Dictionary(); + arguments.Add("ids", new string[] { hashString }); ProcessRequest("queue-move-top", arguments, settings); } @@ -139,9 +139,9 @@ private TransmissionResponse GetTorrentStatus(TransmissionSettings settings) return GetTorrentStatus(null, settings); } - private TransmissionResponse GetTorrentStatus(IEnumerable hashStrings, TransmissionSettings settings) + private TransmissionResponse GetTorrentStatus(IEnumerable hashStrings, TransmissionSettings settings) { - var fields = new String[]{ + var fields = new string[]{ "id", "hashString", // Unique torrent ID. Use this instead of the client id? "name", @@ -154,7 +154,7 @@ private TransmissionResponse GetTorrentStatus(IEnumerable hashStrings, T "errorString" }; - var arguments = new Dictionary(); + var arguments = new Dictionary(); arguments.Add("fields", fields); if (hashStrings != null) @@ -167,7 +167,7 @@ private TransmissionResponse GetTorrentStatus(IEnumerable hashStrings, T return result; } - protected String GetSessionId(IRestClient client, TransmissionSettings settings) + protected string GetSessionId(IRestClient client, TransmissionSettings settings) { var request = new RestRequest(); request.RequestFormat = DataFormat.Json; @@ -177,7 +177,7 @@ protected String GetSessionId(IRestClient client, TransmissionSettings settings) if (restResponse.StatusCode == HttpStatusCode.MovedPermanently) { - var uri = new Uri(restResponse.ResponseUri, (String)restResponse.GetHeaderValue("Location")); + var uri = new Uri(restResponse.ResponseUri, (string)restResponse.GetHeaderValue("Location")); throw new DownloadClientException("Remote site redirected to " + uri); } @@ -194,7 +194,7 @@ protected String GetSessionId(IRestClient client, TransmissionSettings settings) throw new DownloadClientException("Remote host did not return a Session Id."); } - return (String)sessionId.Value; + return (string)sessionId.Value; } case HttpStatusCode.Unauthorized: throw new DownloadClientAuthenticationException("User authentication failed."); @@ -205,11 +205,11 @@ protected String GetSessionId(IRestClient client, TransmissionSettings settings) throw new DownloadClientException("Remote host did not return a Session Id."); } - public TransmissionResponse ProcessRequest(String action, Object arguments, TransmissionSettings settings) + public TransmissionResponse ProcessRequest(string action, object arguments, TransmissionSettings settings) { var client = BuildClient(settings); - if (String.IsNullOrWhiteSpace(_sessionId)) + if (string.IsNullOrWhiteSpace(_sessionId)) { _sessionId = GetSessionId(client, settings); } @@ -218,7 +218,7 @@ public TransmissionResponse ProcessRequest(String action, Object arguments, Tran request.RequestFormat = DataFormat.Json; request.AddHeader("X-Transmission-Session-Id", _sessionId); - var data = new Dictionary(); + var data = new Dictionary(); data.Add("method", action); if (arguments != null) @@ -260,7 +260,7 @@ private IRestClient BuildClient(TransmissionSettings settings) { var protocol = settings.UseSsl ? "https" : "http"; - var url = String.Format(@"{0}://{1}:{2}/{3}/rpc", protocol, settings.Host, settings.Port, settings.UrlBase.Trim('/')); + var url = string.Format(@"{0}://{1}:{2}/{3}/rpc", protocol, settings.Host, settings.Port, settings.UrlBase.Trim('/')); var restClient = RestClientFactory.BuildClient(url); restClient.FollowRedirects = false; diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionResponse.cs b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionResponse.cs index 124ac97f3..41c6fd512 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionResponse.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionResponse.cs @@ -5,7 +5,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission { public class TransmissionResponse { - public String Result { get; set; } - public Dictionary Arguments { get; set; } + public string Result { get; set; } + public Dictionary Arguments { get; set; } } } diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs index 15756e01c..0e18f6e26 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs @@ -31,31 +31,31 @@ public TransmissionSettings() } [FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)] - public String Host { get; set; } + public string Host { get; set; } [FieldDefinition(1, Label = "Port", Type = FieldType.Textbox)] - public Int32 Port { get; set; } + public int Port { get; set; } [FieldDefinition(2, Label = "Url Base", Type = FieldType.Textbox, Advanced = true, HelpText = "Adds a prefix to the transmission rpc url, eg http://[host]:[port]/[urlBase]/rpc, defaults to '/transmission/'")] - public String UrlBase { get; set; } + public string UrlBase { get; set; } [FieldDefinition(3, Label = "Username", Type = FieldType.Textbox)] - public String Username { get; set; } + public string Username { get; set; } [FieldDefinition(4, Label = "Password", Type = FieldType.Password)] - public String Password { get; set; } + public string Password { get; set; } [FieldDefinition(5, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Sonarr avoids conflicts with unrelated downloads, but it's optional. Creates a .[category] subdirectory in the output directory.")] - public String TvCategory { get; set; } + public string TvCategory { get; set; } [FieldDefinition(6, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(TransmissionPriority), HelpText = "Priority to use when grabbing episodes that aired within the last 14 days")] - public Int32 RecentTvPriority { get; set; } + public int RecentTvPriority { get; set; } [FieldDefinition(7, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(TransmissionPriority), HelpText = "Priority to use when grabbing episodes that aired over 14 days ago")] - public Int32 OlderTvPriority { get; set; } + public int OlderTvPriority { get; set; } [FieldDefinition(8, Label = "Use SSL", Type = FieldType.Checkbox)] - public Boolean UseSsl { get; set; } + public bool UseSsl { get; set; } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionTorrent.cs b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionTorrent.cs index a2775a3eb..ae832803b 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionTorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionTorrent.cs @@ -4,26 +4,26 @@ namespace NzbDrone.Core.Download.Clients.Transmission { public class TransmissionTorrent { - public Int32 Id { get; set; } + public int Id { get; set; } - public String HashString { get; set; } + public string HashString { get; set; } - public String Name { get; set; } + public string Name { get; set; } - public String DownloadDir { get; set; } + public string DownloadDir { get; set; } - public Int64 TotalSize { get; set; } + public long TotalSize { get; set; } - public Int64 LeftUntilDone { get; set; } + public long LeftUntilDone { get; set; } - public Boolean IsFinished { get; set; } + public bool IsFinished { get; set; } - public Int32 Eta { get; set; } + public int Eta { get; set; } public TransmissionTorrentStatus Status { get; set; } - public Int32 SecondsDownloading { get; set; } + public int SecondsDownloading { get; set; } - public String ErrorString { get; set; } + public string ErrorString { get; set; } } } diff --git a/src/NzbDrone.Core/Download/Clients/UsenetBlackhole/UsenetBlackholeSettings.cs b/src/NzbDrone.Core/Download/Clients/UsenetBlackhole/UsenetBlackholeSettings.cs index d587689ed..5be32d3e6 100644 --- a/src/NzbDrone.Core/Download/Clients/UsenetBlackhole/UsenetBlackholeSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/UsenetBlackhole/UsenetBlackholeSettings.cs @@ -21,10 +21,10 @@ public class UsenetBlackholeSettings : IProviderConfig private static readonly UsenetBlackholeSettingsValidator Validator = new UsenetBlackholeSettingsValidator(); [FieldDefinition(0, Label = "Nzb Folder", Type = FieldType.Path, HelpText = "Folder in which Sonarr will store the .nzb file")] - public String NzbFolder { get; set; } + public string NzbFolder { get; set; } [FieldDefinition(1, Label = "Watch Folder", Type = FieldType.Path, HelpText = "Folder from which Sonarr should import completed downloads")] - public String WatchFolder { get; set; } + public string WatchFolder { get; set; } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrentProxy.cs b/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrentProxy.cs index 1ac0032d1..7a3f21613 100644 --- a/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrentProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrentProxy.cs @@ -129,7 +129,7 @@ public void AddTorrentFromUrl(string torrentUrl, RTorrentSettings settings) } } - public void AddTorrentFromFile(string fileName, Byte[] fileContent, RTorrentSettings settings) + public void AddTorrentFromFile(string fileName, byte[] fileContent, RTorrentSettings settings) { _logger.Debug("Executing remote method: load.raw"); diff --git a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs index 74769f0dc..8979436fd 100644 --- a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs @@ -31,7 +31,7 @@ public UTorrent(IUTorrentProxy proxy, _proxy = proxy; } - protected override String AddFromMagnetLink(RemoteEpisode remoteEpisode, String hash, String magnetLink) + protected override string AddFromMagnetLink(RemoteEpisode remoteEpisode, string hash, string magnetLink) { _proxy.AddTorrentFromUrl(magnetLink, Settings); _proxy.SetTorrentLabel(hash, Settings.TvCategory, Settings); @@ -47,7 +47,7 @@ protected override String AddFromMagnetLink(RemoteEpisode remoteEpisode, String return hash; } - protected override String AddFromTorrentFile(RemoteEpisode remoteEpisode, String hash, String filename, Byte[] fileContent) + protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, byte[] fileContent) { _proxy.AddTorrentFromFile(filename, fileContent, Settings); _proxy.SetTorrentLabel(hash, Settings.TvCategory, Settings); @@ -224,12 +224,12 @@ private ValidationFailure TestConnection() DetailedDescription = "Please verify the hostname and port." }; } - return new NzbDroneValidationFailure(String.Empty, "Unknown exception: " + ex.Message); + return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); } catch (Exception ex) { _logger.ErrorException(ex.Message, ex); - return new NzbDroneValidationFailure(String.Empty, "Unknown exception: " + ex.Message); + return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); } return null; @@ -244,7 +244,7 @@ private ValidationFailure TestGetTorrents() catch (Exception ex) { _logger.ErrorException(ex.Message, ex); - return new NzbDroneValidationFailure(String.Empty, "Failed to get the list of torrents: " + ex.Message); + return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message); } return null; diff --git a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentProxy.cs b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentProxy.cs index 7d1ac2f56..6c89fcb23 100644 --- a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentProxy.cs @@ -11,24 +11,24 @@ namespace NzbDrone.Core.Download.Clients.UTorrent { public interface IUTorrentProxy { - Int32 GetVersion(UTorrentSettings settings); - Dictionary GetConfig(UTorrentSettings settings); + int GetVersion(UTorrentSettings settings); + Dictionary GetConfig(UTorrentSettings settings); List GetTorrents(UTorrentSettings settings); - void AddTorrentFromUrl(String torrentUrl, UTorrentSettings settings); - void AddTorrentFromFile(String fileName, Byte[] fileContent, UTorrentSettings settings); - void SetTorrentSeedingConfiguration(String hash, TorrentSeedConfiguration seedConfiguration, UTorrentSettings settings); + void AddTorrentFromUrl(string torrentUrl, UTorrentSettings settings); + void AddTorrentFromFile(string fileName, byte[] fileContent, UTorrentSettings settings); + void SetTorrentSeedingConfiguration(string hash, TorrentSeedConfiguration seedConfiguration, UTorrentSettings settings); - void RemoveTorrent(String hash, Boolean removeData, UTorrentSettings settings); - void SetTorrentLabel(String hash, String label, UTorrentSettings settings); - void MoveTorrentToTopInQueue(String hash, UTorrentSettings settings); + void RemoveTorrent(string hash, bool removeData, UTorrentSettings settings); + void SetTorrentLabel(string hash, string label, UTorrentSettings settings); + void MoveTorrentToTopInQueue(string hash, UTorrentSettings settings); } public class UTorrentProxy : IUTorrentProxy { private readonly Logger _logger; private readonly CookieContainer _cookieContainer; - private String _authToken; + private string _authToken; public UTorrentProxy(Logger logger) { @@ -36,9 +36,9 @@ public UTorrentProxy(Logger logger) _cookieContainer = new CookieContainer(); } - public Int32 GetVersion(UTorrentSettings settings) + public int GetVersion(UTorrentSettings settings) { - var arguments = new Dictionary(); + var arguments = new Dictionary(); arguments.Add("action", "getsettings"); var result = ProcessRequest(arguments, settings); @@ -46,14 +46,14 @@ public Int32 GetVersion(UTorrentSettings settings) return result.Build; } - public Dictionary GetConfig(UTorrentSettings settings) + public Dictionary GetConfig(UTorrentSettings settings) { - var arguments = new Dictionary(); + var arguments = new Dictionary(); arguments.Add("action", "getsettings"); var result = ProcessRequest(arguments, settings); - var configuration = new Dictionary(); + var configuration = new Dictionary(); foreach (var configItem in result.Settings) { @@ -65,7 +65,7 @@ public Dictionary GetConfig(UTorrentSettings settings) public List GetTorrents(UTorrentSettings settings) { - var arguments = new Dictionary(); + var arguments = new Dictionary(); arguments.Add("list", 1); var result = ProcessRequest(arguments, settings); @@ -73,20 +73,20 @@ public List GetTorrents(UTorrentSettings settings) return result.Torrents; } - public void AddTorrentFromUrl(String torrentUrl, UTorrentSettings settings) + public void AddTorrentFromUrl(string torrentUrl, UTorrentSettings settings) { - var arguments = new Dictionary(); + var arguments = new Dictionary(); arguments.Add("action", "add-url"); arguments.Add("s", torrentUrl); ProcessRequest(arguments, settings); } - public void AddTorrentFromFile(String fileName, Byte[] fileContent, UTorrentSettings settings) + public void AddTorrentFromFile(string fileName, byte[] fileContent, UTorrentSettings settings) { - var arguments = new Dictionary(); + var arguments = new Dictionary(); arguments.Add("action", "add-file"); - arguments.Add("path", String.Empty); + arguments.Add("path", string.Empty); var client = BuildClient(settings); @@ -106,9 +106,9 @@ public void AddTorrentFromFile(String fileName, Byte[] fileContent, UTorrentSett ProcessRequest(request, client); } - public void SetTorrentSeedingConfiguration(String hash, TorrentSeedConfiguration seedConfiguration, UTorrentSettings settings) + public void SetTorrentSeedingConfiguration(string hash, TorrentSeedConfiguration seedConfiguration, UTorrentSettings settings) { - var arguments = new List>(); + var arguments = new List>(); arguments.Add("action", "setprops"); arguments.Add("hash", hash); @@ -130,9 +130,9 @@ public void SetTorrentSeedingConfiguration(String hash, TorrentSeedConfiguration ProcessRequest(arguments, settings); } - public void RemoveTorrent(String hash, Boolean removeData, UTorrentSettings settings) + public void RemoveTorrent(string hash, bool removeData, UTorrentSettings settings) { - var arguments = new Dictionary(); + var arguments = new Dictionary(); if (removeData) { @@ -148,9 +148,9 @@ public void RemoveTorrent(String hash, Boolean removeData, UTorrentSettings sett ProcessRequest(arguments, settings); } - public void SetTorrentLabel(String hash, String label, UTorrentSettings settings) + public void SetTorrentLabel(string hash, string label, UTorrentSettings settings) { - var arguments = new Dictionary(); + var arguments = new Dictionary(); arguments.Add("action", "setprops"); arguments.Add("hash", hash); @@ -160,16 +160,16 @@ public void SetTorrentLabel(String hash, String label, UTorrentSettings settings ProcessRequest(arguments, settings); } - public void MoveTorrentToTopInQueue(String hash, UTorrentSettings settings) + public void MoveTorrentToTopInQueue(string hash, UTorrentSettings settings) { - var arguments = new Dictionary(); + var arguments = new Dictionary(); arguments.Add("action", "queuetop"); arguments.Add("hash", hash); ProcessRequest(arguments, settings); } - public UTorrentResponse ProcessRequest(IEnumerable> arguments, UTorrentSettings settings) + public UTorrentResponse ProcessRequest(IEnumerable> arguments, UTorrentSettings settings) { var client = BuildClient(settings); @@ -211,7 +211,7 @@ private UTorrentResponse ProcessRequest(IRestRequest request, IRestClient client return uTorrentResult; } - private String GetAuthToken(IRestClient client) + private string GetAuthToken(IRestClient client) { var request = new RestRequest(); request.RequestFormat = DataFormat.Json; @@ -239,7 +239,7 @@ private String GetAuthToken(IRestClient client) private IRestClient BuildClient(UTorrentSettings settings) { - var url = String.Format(@"http://{0}:{1}", + var url = string.Format(@"http://{0}:{1}", settings.Host, settings.Port); diff --git a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentResponse.cs b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentResponse.cs index 606137d39..46f560b84 100644 --- a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentResponse.cs +++ b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentResponse.cs @@ -6,15 +6,15 @@ namespace NzbDrone.Core.Download.Clients.UTorrent { public class UTorrentResponse { - public Int32 Build { get; set; } + public int Build { get; set; } public List Torrents { get; set; } - public List Label { get; set; } - public List RssFeeds { get; set; } - public List RssFilters { get; set; } + public List Label { get; set; } + public List RssFeeds { get; set; } + public List RssFilters { get; set; } [JsonProperty(PropertyName = "torrentc")] - public String CacheNumber { get; set; } + public string CacheNumber { get; set; } - public List Settings { get; set; } + public List Settings { get; set; } } } diff --git a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentSettings.cs b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentSettings.cs index bd3f813b7..b00c0806a 100644 --- a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentSettings.cs @@ -28,25 +28,25 @@ public UTorrentSettings() } [FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)] - public String Host { get; set; } + public string Host { get; set; } [FieldDefinition(1, Label = "Port", Type = FieldType.Textbox)] - public Int32 Port { get; set; } + public int Port { get; set; } [FieldDefinition(2, Label = "Username", Type = FieldType.Textbox)] - public String Username { get; set; } + public string Username { get; set; } [FieldDefinition(3, Label = "Password", Type = FieldType.Password)] - public String Password { get; set; } + public string Password { get; set; } [FieldDefinition(4, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Sonarr avoids conflicts with unrelated downloads, but it's optional")] - public String TvCategory { get; set; } + public string TvCategory { get; set; } [FieldDefinition(5, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(UTorrentPriority), HelpText = "Priority to use when grabbing episodes that aired within the last 14 days")] - public Int32 RecentTvPriority { get; set; } + public int RecentTvPriority { get; set; } [FieldDefinition(6, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(UTorrentPriority), HelpText = "Priority to use when grabbing episodes that aired over 14 days ago")] - public Int32 OlderTvPriority { get; set; } + public int OlderTvPriority { get; set; } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentTorrent.cs b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentTorrent.cs index bea6b5a05..9a6a0188f 100644 --- a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentTorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentTorrent.cs @@ -6,37 +6,37 @@ namespace NzbDrone.Core.Download.Clients.UTorrent [JsonConverter(typeof(UTorrentTorrentJsonConverter))] public class UTorrentTorrent { - public String Hash { get; set; } + public string Hash { get; set; } public UTorrentTorrentStatus Status { get; set; } - public String Name { get; set; } - public Int64 Size { get; set; } - public Double Progress { get; set; } - public Int64 Downloaded { get; set; } - public Int64 Uploaded { get; set; } - public Double Ratio { get; set; } - public Int32 UploadSpeed { get; set; } - public Int32 DownloadSpeed { get; set; } + public string Name { get; set; } + public long Size { get; set; } + public double Progress { get; set; } + public long Downloaded { get; set; } + public long Uploaded { get; set; } + public double Ratio { get; set; } + public int UploadSpeed { get; set; } + public int DownloadSpeed { get; set; } - public Int32 Eta { get; set; } - public String Label { get; set; } - public Int32 PeersConnected { get; set; } - public Int32 PeersInSwarm { get; set; } - public Int32 SeedsConnected { get; set; } - public Int32 SeedsInSwarm { get; set; } - public Double Availablity { get; set; } - public Int32 TorrentQueueOrder { get; set; } - public Int64 Remaining { get; set; } - public String DownloadUrl { get; set; } + public int Eta { get; set; } + public string Label { get; set; } + public int PeersConnected { get; set; } + public int PeersInSwarm { get; set; } + public int SeedsConnected { get; set; } + public int SeedsInSwarm { get; set; } + public double Availablity { get; set; } + public int TorrentQueueOrder { get; set; } + public long Remaining { get; set; } + public string DownloadUrl { get; set; } - public Object RssFeedUrl { get; set; } - public Object StatusMessage { get; set; } - public Object StreamId { get; set; } - public Object DateAdded { get; set; } - public Object DateCompleted { get; set; } - public Object AppUpdateUrl { get; set; } - public String RootDownloadPath { get; set; } - public Object Unknown27 { get; set; } - public Object Unknown28 { get; set; } + public object RssFeedUrl { get; set; } + public object StatusMessage { get; set; } + public object StreamId { get; set; } + public object DateAdded { get; set; } + public object DateCompleted { get; set; } + public object AppUpdateUrl { get; set; } + public string RootDownloadPath { get; set; } + public object Unknown27 { get; set; } + public object Unknown28 { get; set; } } class UTorrentTorrentJsonConverter : JsonConverter @@ -54,12 +54,12 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist result.Status = (UTorrentTorrentStatus)reader.ReadAsInt32(); result.Name = reader.ReadAsString(); reader.Read(); - result.Size = (Int64)reader.Value; + result.Size = (long)reader.Value; result.Progress = (int)reader.ReadAsInt32() / 1000.0; reader.Read(); - result.Downloaded = (Int64)reader.Value; + result.Downloaded = (long)reader.Value; reader.Read(); - result.Uploaded = (Int64)reader.Value; + result.Uploaded = (long)reader.Value; result.Ratio = (int)reader.ReadAsInt32() / 1000.0; result.UploadSpeed = (int)reader.ReadAsInt32(); result.DownloadSpeed = (int)reader.ReadAsInt32(); @@ -73,7 +73,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist result.Availablity = (int)reader.ReadAsInt32() / 65536.0; result.TorrentQueueOrder = (int)reader.ReadAsInt32(); reader.Read(); - result.Remaining = (Int64)reader.Value; + result.Remaining = (long)reader.Value; reader.Read(); @@ -81,7 +81,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist if (reader.TokenType != JsonToken.EndArray) { - result.DownloadUrl = (String)reader.Value; + result.DownloadUrl = (string)reader.Value; reader.Read(); result.RssFeedUrl = reader.Value; diff --git a/src/NzbDrone.Core/Download/DownloadClientBase.cs b/src/NzbDrone.Core/Download/DownloadClientBase.cs index 1934a00df..324073b82 100644 --- a/src/NzbDrone.Core/Download/DownloadClientBase.cs +++ b/src/NzbDrone.Core/Download/DownloadClientBase.cs @@ -81,7 +81,7 @@ public abstract DownloadProtocol Protocol get; } - public abstract String Download(RemoteEpisode remoteEpisode); + public abstract string Download(RemoteEpisode remoteEpisode); public abstract IEnumerable GetItems(); public abstract void RemoveItem(string downloadId, bool deleteData); public abstract DownloadClientStatus GetStatus(); @@ -150,7 +150,7 @@ public ValidationResult Test() protected abstract void Test(List failures); - protected ValidationFailure TestFolder(String folder, String propertyName, Boolean mustBeWritable = true) + protected ValidationFailure TestFolder(string folder, string propertyName, bool mustBeWritable = true) { if (!_diskProvider.FolderExists(folder)) { diff --git a/src/NzbDrone.Core/Download/DownloadClientItem.cs b/src/NzbDrone.Core/Download/DownloadClientItem.cs index 88586c4c7..2e0533e50 100644 --- a/src/NzbDrone.Core/Download/DownloadClientItem.cs +++ b/src/NzbDrone.Core/Download/DownloadClientItem.cs @@ -7,21 +7,21 @@ namespace NzbDrone.Core.Download [DebuggerDisplay("{DownloadClient}:{Title}")] public class DownloadClientItem { - public String DownloadClient { get; set; } - public String DownloadId { get; set; } - public String Category { get; set; } - public String Title { get; set; } + public string DownloadClient { get; set; } + public string DownloadId { get; set; } + public string Category { get; set; } + public string Title { get; set; } - public Int64 TotalSize { get; set; } - public Int64 RemainingSize { get; set; } + public long TotalSize { get; set; } + public long RemainingSize { get; set; } public TimeSpan? RemainingTime { get; set; } public OsPath OutputPath { get; set; } - public String Message { get; set; } + public string Message { get; set; } public DownloadItemStatus Status { get; set; } - public Boolean IsEncrypted { get; set; } - public Boolean IsReadOnly { get; set; } + public bool IsEncrypted { get; set; } + public bool IsReadOnly { get; set; } public bool Removed { get; set; } } diff --git a/src/NzbDrone.Core/Download/DownloadClientStatus.cs b/src/NzbDrone.Core/Download/DownloadClientStatus.cs index ed1e0b970..3ef340121 100644 --- a/src/NzbDrone.Core/Download/DownloadClientStatus.cs +++ b/src/NzbDrone.Core/Download/DownloadClientStatus.cs @@ -6,7 +6,7 @@ namespace NzbDrone.Core.Download { public class DownloadClientStatus { - public Boolean IsLocalhost { get; set; } + public bool IsLocalhost { get; set; } public List OutputRootFolders { get; set; } } } diff --git a/src/NzbDrone.Core/Download/DownloadFailedEvent.cs b/src/NzbDrone.Core/Download/DownloadFailedEvent.cs index f6cd06c59..69fa121a6 100644 --- a/src/NzbDrone.Core/Download/DownloadFailedEvent.cs +++ b/src/NzbDrone.Core/Download/DownloadFailedEvent.cs @@ -13,13 +13,13 @@ public DownloadFailedEvent() Data = new Dictionary(); } - public Int32 SeriesId { get; set; } - public List EpisodeIds { get; set; } + public int SeriesId { get; set; } + public List EpisodeIds { get; set; } public QualityModel Quality { get; set; } - public String SourceTitle { get; set; } - public String DownloadClient { get; set; } - public String DownloadId { get; set; } - public String Message { get; set; } + public string SourceTitle { get; set; } + public string DownloadClient { get; set; } + public string DownloadId { get; set; } + public string Message { get; set; } public Dictionary Data { get; set; } public TrackedDownload TrackedDownload { get; set; } } diff --git a/src/NzbDrone.Core/Download/DownloadService.cs b/src/NzbDrone.Core/Download/DownloadService.cs index 115ba1f94..d6da07e32 100644 --- a/src/NzbDrone.Core/Download/DownloadService.cs +++ b/src/NzbDrone.Core/Download/DownloadService.cs @@ -83,7 +83,7 @@ public void DownloadReport(RemoteEpisode remoteEpisode) var episodeGrabbedEvent = new EpisodeGrabbedEvent(remoteEpisode); episodeGrabbedEvent.DownloadClient = downloadClient.GetType().Name; - if (!String.IsNullOrWhiteSpace(downloadClientId)) + if (!string.IsNullOrWhiteSpace(downloadClientId)) { episodeGrabbedEvent.DownloadId = downloadClientId; } diff --git a/src/NzbDrone.Core/Download/EpisodeGrabbedEvent.cs b/src/NzbDrone.Core/Download/EpisodeGrabbedEvent.cs index 53c64695e..a4bac5ff6 100644 --- a/src/NzbDrone.Core/Download/EpisodeGrabbedEvent.cs +++ b/src/NzbDrone.Core/Download/EpisodeGrabbedEvent.cs @@ -7,8 +7,8 @@ namespace NzbDrone.Core.Download public class EpisodeGrabbedEvent : IEvent { public RemoteEpisode Episode { get; private set; } - public String DownloadClient { get; set; } - public String DownloadId { get; set; } + public string DownloadClient { get; set; } + public string DownloadId { get; set; } public EpisodeGrabbedEvent(RemoteEpisode episode) { diff --git a/src/NzbDrone.Core/Download/IDownloadClient.cs b/src/NzbDrone.Core/Download/IDownloadClient.cs index f2b8079c1..aa46cff48 100644 --- a/src/NzbDrone.Core/Download/IDownloadClient.cs +++ b/src/NzbDrone.Core/Download/IDownloadClient.cs @@ -10,7 +10,7 @@ public interface IDownloadClient : IProvider { DownloadProtocol Protocol { get; } - String Download(RemoteEpisode remoteEpisode); + string Download(RemoteEpisode remoteEpisode); IEnumerable GetItems(); void RemoveItem(string downloadId, bool deleteData); DownloadClientStatus GetStatus(); diff --git a/src/NzbDrone.Core/Download/Pending/PendingRelease.cs b/src/NzbDrone.Core/Download/Pending/PendingRelease.cs index c99e5ac6a..a713fe48c 100644 --- a/src/NzbDrone.Core/Download/Pending/PendingRelease.cs +++ b/src/NzbDrone.Core/Download/Pending/PendingRelease.cs @@ -6,8 +6,8 @@ namespace NzbDrone.Core.Download.Pending { public class PendingRelease : ModelBase { - public Int32 SeriesId { get; set; } - public String Title { get; set; } + public int SeriesId { get; set; } + public string Title { get; set; } public DateTime Added { get; set; } public ParsedEpisodeInfo ParsedEpisodeInfo { get; set; } public ReleaseInfo Release { get; set; } diff --git a/src/NzbDrone.Core/Download/Pending/PendingReleaseRepository.cs b/src/NzbDrone.Core/Download/Pending/PendingReleaseRepository.cs index 6b9b48b86..fe298486e 100644 --- a/src/NzbDrone.Core/Download/Pending/PendingReleaseRepository.cs +++ b/src/NzbDrone.Core/Download/Pending/PendingReleaseRepository.cs @@ -7,8 +7,8 @@ namespace NzbDrone.Core.Download.Pending { public interface IPendingReleaseRepository : IBasicRepository { - void DeleteBySeriesId(Int32 seriesId); - List AllBySeriesId(Int32 seriesId); + void DeleteBySeriesId(int seriesId); + List AllBySeriesId(int seriesId); } public class PendingReleaseRepository : BasicRepository, IPendingReleaseRepository @@ -18,12 +18,12 @@ public PendingReleaseRepository(IMainDatabase database, IEventAggregator eventAg { } - public void DeleteBySeriesId(Int32 seriesId) + public void DeleteBySeriesId(int seriesId) { Delete(r => r.SeriesId == seriesId); } - public List AllBySeriesId(Int32 seriesId) + public List AllBySeriesId(int seriesId) { return Query.Where(p => p.SeriesId == seriesId); } diff --git a/src/NzbDrone.Core/Download/Pending/PendingReleaseService.cs b/src/NzbDrone.Core/Download/Pending/PendingReleaseService.cs index 57cc746ca..321d908fd 100644 --- a/src/NzbDrone.Core/Download/Pending/PendingReleaseService.cs +++ b/src/NzbDrone.Core/Download/Pending/PendingReleaseService.cs @@ -316,7 +316,7 @@ private PendingRelease FindPendingRelease(int queueId) private int GetQueueId(PendingRelease pendingRelease, Episode episode) { - return HashConverter.GetHashInt31(String.Format("pending-{0}-ep{1}", pendingRelease.Id, episode.Id)); + return HashConverter.GetHashInt31(string.Format("pending-{0}-ep{1}", pendingRelease.Id, episode.Id)); } private int PrioritizeDownloadProtocol(Series series, DownloadProtocol downloadProtocol) diff --git a/src/NzbDrone.Core/Download/TorrentClientBase.cs b/src/NzbDrone.Core/Download/TorrentClientBase.cs index baaf922dd..c1a81add3 100644 --- a/src/NzbDrone.Core/Download/TorrentClientBase.cs +++ b/src/NzbDrone.Core/Download/TorrentClientBase.cs @@ -42,15 +42,15 @@ public override DownloadProtocol Protocol } } - protected abstract String AddFromMagnetLink(RemoteEpisode remoteEpisode, String hash, String magnetLink); - protected abstract String AddFromTorrentFile(RemoteEpisode remoteEpisode, String hash, String filename, Byte[] fileContent); + protected abstract string AddFromMagnetLink(RemoteEpisode remoteEpisode, string hash, string magnetLink); + protected abstract string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, byte[] fileContent); - public override String Download(RemoteEpisode remoteEpisode) + public override string Download(RemoteEpisode remoteEpisode) { var torrentInfo = remoteEpisode.Release as TorrentInfo; - String magnetUrl = null; - String torrentUrl = null; + string magnetUrl = null; + string torrentUrl = null; if (remoteEpisode.Release.DownloadUrl.StartsWith("magnet:")) { @@ -66,7 +66,7 @@ public override String Download(RemoteEpisode remoteEpisode) magnetUrl = torrentInfo.MagnetUrl; } - String hash = null; + string hash = null; if (magnetUrl.IsNotNullOrWhiteSpace()) { @@ -93,9 +93,9 @@ public override String Download(RemoteEpisode remoteEpisode) return hash; } - private string DownloadFromWebUrl(RemoteEpisode remoteEpisode, String torrentUrl) + private string DownloadFromWebUrl(RemoteEpisode remoteEpisode, string torrentUrl) { - Byte[] torrentFile = null; + byte[] torrentFile = null; try { @@ -130,20 +130,20 @@ private string DownloadFromWebUrl(RemoteEpisode remoteEpisode, String torrentUrl } catch (HttpException ex) { - _logger.ErrorException(String.Format("Downloading torrent file for episode '{0}' failed ({1})", + _logger.ErrorException(string.Format("Downloading torrent file for episode '{0}' failed ({1})", remoteEpisode.Release.Title, torrentUrl), ex); throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading torrent failed", ex); } catch (WebException ex) { - _logger.ErrorException(String.Format("Downloading torrent file for episode '{0}' failed ({1})", + _logger.ErrorException(string.Format("Downloading torrent file for episode '{0}' failed ({1})", remoteEpisode.Release.Title, torrentUrl), ex); throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading torrent failed", ex); } - var filename = String.Format("{0}.torrent", FileNameBuilder.CleanFileName(remoteEpisode.Release.Title)); + var filename = string.Format("{0}.torrent", FileNameBuilder.CleanFileName(remoteEpisode.Release.Title)); var hash = _torrentFileInfoReader.GetHashFromTorrentFile(torrentFile); var actualHash = AddFromTorrentFile(remoteEpisode, hash, filename, torrentFile); @@ -157,10 +157,10 @@ private string DownloadFromWebUrl(RemoteEpisode remoteEpisode, String torrentUrl return actualHash; } - private String DownloadFromMagnetUrl(RemoteEpisode remoteEpisode, String magnetUrl) + private string DownloadFromMagnetUrl(RemoteEpisode remoteEpisode, string magnetUrl) { - String hash = null; - String actualHash = null; + string hash = null; + string actualHash = null; try { @@ -168,7 +168,7 @@ private String DownloadFromMagnetUrl(RemoteEpisode remoteEpisode, String magnetU } catch (FormatException ex) { - _logger.ErrorException(String.Format("Failed to parse magnetlink for episode '{0}': '{1}'", + _logger.ErrorException(string.Format("Failed to parse magnetlink for episode '{0}': '{1}'", remoteEpisode.Release.Title, magnetUrl), ex); return null; diff --git a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownload.cs b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownload.cs index 9bc80de4f..1076b4fa5 100644 --- a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownload.cs +++ b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownload.cs @@ -6,7 +6,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads { public class TrackedDownload { - public Int32 DownloadClient { get; set; } + public int DownloadClient { get; set; } public DownloadClientItem DownloadItem { get; set; } public TrackedDownloadStage State { get; set; } public TrackedDownloadStatus Status { get; private set; } @@ -19,9 +19,9 @@ public TrackedDownload() StatusMessages = new TrackedDownloadStatusMessage[] {}; } - public void Warn(String message, params object[] args) + public void Warn(string message, params object[] args) { - var statusMessage = String.Format(message, args); + var statusMessage = string.Format(message, args); Warn(new TrackedDownloadStatusMessage(DownloadItem.Title, statusMessage)); } diff --git a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadStatusMessage.cs b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadStatusMessage.cs index 5bd920432..26400a873 100644 --- a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadStatusMessage.cs +++ b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadStatusMessage.cs @@ -5,20 +5,20 @@ namespace NzbDrone.Core.Download.TrackedDownloads { public class TrackedDownloadStatusMessage { - public String Title { get; set; } - public List Messages { get; set; } + public string Title { get; set; } + public List Messages { get; set; } - public TrackedDownloadStatusMessage(String title, List messages) + public TrackedDownloadStatusMessage(string title, List messages) { Title = title; Messages = messages; } - public TrackedDownloadStatusMessage(String title, String message) + public TrackedDownloadStatusMessage(string title, string message) { Title = title; - Messages = new List{ message }; + Messages = new List { message }; } //Constructor for use when deserializing JSON diff --git a/src/NzbDrone.Core/Download/UsenetClientBase.cs b/src/NzbDrone.Core/Download/UsenetClientBase.cs index fd7c93c8c..d6bf5b42a 100644 --- a/src/NzbDrone.Core/Download/UsenetClientBase.cs +++ b/src/NzbDrone.Core/Download/UsenetClientBase.cs @@ -36,14 +36,14 @@ public override DownloadProtocol Protocol } } - protected abstract String AddFromNzbFile(RemoteEpisode remoteEpisode, String filename, Byte[] fileContent); + protected abstract string AddFromNzbFile(RemoteEpisode remoteEpisode, string filename, byte[] fileContent); - public override String Download(RemoteEpisode remoteEpisode) + public override string Download(RemoteEpisode remoteEpisode) { var url = remoteEpisode.Release.DownloadUrl; var filename = FileNameBuilder.CleanFileName(remoteEpisode.Release.Title) + ".nzb"; - Byte[] nzbData; + byte[] nzbData; try { @@ -53,14 +53,14 @@ public override String Download(RemoteEpisode remoteEpisode) } catch (HttpException ex) { - _logger.ErrorException(String.Format("Downloading nzb for episode '{0}' failed ({1})", + _logger.ErrorException(string.Format("Downloading nzb for episode '{0}' failed ({1})", remoteEpisode.Release.Title, url), ex); throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading nzb failed", ex); } catch (WebException ex) { - _logger.ErrorException(String.Format("Downloading nzb for episode '{0}' failed ({1})", + _logger.ErrorException(string.Format("Downloading nzb for episode '{0}' failed ({1})", remoteEpisode.Release.Title, url), ex); throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading nzb failed", ex); diff --git a/src/NzbDrone.Core/Exceptions/ReleaseDownloadException.cs b/src/NzbDrone.Core/Exceptions/ReleaseDownloadException.cs index 0f3f681b0..c9582ddde 100644 --- a/src/NzbDrone.Core/Exceptions/ReleaseDownloadException.cs +++ b/src/NzbDrone.Core/Exceptions/ReleaseDownloadException.cs @@ -8,24 +8,24 @@ public class ReleaseDownloadException : NzbDroneException { public ReleaseInfo Release { get; set; } - public ReleaseDownloadException(ReleaseInfo release, String message, params Object[] args) : base(message, args) + public ReleaseDownloadException(ReleaseInfo release, string message, params object[] args) : base(message, args) { Release = release; } - public ReleaseDownloadException(ReleaseInfo release, String message) + public ReleaseDownloadException(ReleaseInfo release, string message) : base(message) { Release = release; } - public ReleaseDownloadException(ReleaseInfo release, String message, Exception innerException, params Object[] args) + public ReleaseDownloadException(ReleaseInfo release, string message, Exception innerException, params object[] args) : base(message, innerException, args) { Release = release; } - public ReleaseDownloadException(ReleaseInfo release, String message, Exception innerException) + public ReleaseDownloadException(ReleaseInfo release, string message, Exception innerException) : base(message, innerException) { Release = release; diff --git a/src/NzbDrone.Core/Exceptions/StatusCodeToExceptions.cs b/src/NzbDrone.Core/Exceptions/StatusCodeToExceptions.cs index 8deb955bb..87732a191 100644 --- a/src/NzbDrone.Core/Exceptions/StatusCodeToExceptions.cs +++ b/src/NzbDrone.Core/Exceptions/StatusCodeToExceptions.cs @@ -7,7 +7,7 @@ public static class StatusCodeToExceptions { public static void VerifyStatusCode(this HttpStatusCode statusCode, string message = null) { - if (String.IsNullOrEmpty(message)) + if (string.IsNullOrEmpty(message)) { message = statusCode.ToString(); } diff --git a/src/NzbDrone.Core/Fluent.cs b/src/NzbDrone.Core/Fluent.cs index 710eb7cf6..bb6dcecae 100644 --- a/src/NzbDrone.Core/Fluent.cs +++ b/src/NzbDrone.Core/Fluent.cs @@ -12,7 +12,7 @@ public static string WithDefault(this string actual, object defaultValue) { Ensure.That(defaultValue, () => defaultValue).IsNotNull(); - if (String.IsNullOrWhiteSpace(actual)) + if (string.IsNullOrWhiteSpace(actual)) { return defaultValue.ToString(); } @@ -20,28 +20,28 @@ public static string WithDefault(this string actual, object defaultValue) return actual; } - public static Int64 Megabytes(this int megabytes) + public static long Megabytes(this int megabytes) { return Convert.ToInt64(megabytes * 1024L * 1024L); } - public static Int64 Gigabytes(this int gigabytes) + public static long Gigabytes(this int gigabytes) { return Convert.ToInt64(gigabytes * 1024L * 1024L * 1024L); } - public static Int64 Megabytes(this double megabytes) + public static long Megabytes(this double megabytes) { return Convert.ToInt64(megabytes * 1024L * 1024L); } - public static Int64 Gigabytes(this double gigabytes) + public static long Gigabytes(this double gigabytes) { return Convert.ToInt64(gigabytes * 1024L * 1024L * 1024L); } - public static Int64 Round(this long number, long level) + public static long Round(this long number, long level) { return Convert.ToInt64(Math.Floor((decimal)number / level) * level); } @@ -65,7 +65,7 @@ public static string ToBestDateString(this DateTime dateTime) public static string ParentUriString(this Uri uri) { - return uri.AbsoluteUri.Remove(uri.AbsoluteUri.Length - String.Join("", uri.Segments).Length - uri.Query.Length); + return uri.AbsoluteUri.Remove(uri.AbsoluteUri.Length - string.Join("", uri.Segments).Length - uri.Query.Length); } public static int MaxOrDefault(this IEnumerable ints) diff --git a/src/NzbDrone.Core/HealthCheck/Checks/RootFolderCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/RootFolderCheck.cs index 59a79c4cc..f84d0054b 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/RootFolderCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/RootFolderCheck.cs @@ -31,7 +31,7 @@ public override HealthCheck Check() return new HealthCheck(GetType(), HealthCheckResult.Error, "Missing root folder: " + missingRootFolders.First(), "#missing-root-folder"); } - var message = String.Format("Multiple root folders are missing: {0}", String.Join(" | ", missingRootFolders)); + var message = string.Format("Multiple root folders are missing: {0}", string.Join(" | ", missingRootFolders)); return new HealthCheck(GetType(), HealthCheckResult.Error, message, "#missing-root-folder"); } diff --git a/src/NzbDrone.Core/HealthCheck/HealthCheck.cs b/src/NzbDrone.Core/HealthCheck/HealthCheck.cs index e720aca8f..49b3c9f41 100644 --- a/src/NzbDrone.Core/HealthCheck/HealthCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/HealthCheck.cs @@ -10,7 +10,7 @@ public class HealthCheck : ModelBase public Type Source { get; set; } public HealthCheckResult Type { get; set; } - public String Message { get; set; } + public string Message { get; set; } public Uri WikiUrl { get; set; } public HealthCheck(Type source) @@ -19,7 +19,7 @@ public HealthCheck(Type source) Type = HealthCheckResult.Ok; } - public HealthCheck(Type source, HealthCheckResult type, String message, String wikiFragment = null) + public HealthCheck(Type source, HealthCheckResult type, string message, string wikiFragment = null) { Source = source; Type = type; @@ -27,12 +27,12 @@ public HealthCheck(Type source, HealthCheckResult type, String message, String w WikiUrl = MakeWikiUrl(wikiFragment ?? MakeWikiFragment(message)); } - private static String MakeWikiFragment(String message) + private static string MakeWikiFragment(string message) { - return "#" + CleanFragmentRegex.Replace(message.ToLower(), String.Empty).Replace(' ', '-'); + return "#" + CleanFragmentRegex.Replace(message.ToLower(), string.Empty).Replace(' ', '-'); } - private static Uri MakeWikiUrl(String fragment) + private static Uri MakeWikiUrl(string fragment) { var rootUri = new Uri("https://github.com/Sonarr/Sonarr/wiki/Health-checks"); if (fragment.StartsWith("#")) diff --git a/src/NzbDrone.Core/HealthCheck/IProvideHealthCheck.cs b/src/NzbDrone.Core/HealthCheck/IProvideHealthCheck.cs index 17035b0d7..b9bae97f9 100644 --- a/src/NzbDrone.Core/HealthCheck/IProvideHealthCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/IProvideHealthCheck.cs @@ -5,8 +5,8 @@ namespace NzbDrone.Core.HealthCheck public interface IProvideHealthCheck { HealthCheck Check(); - Boolean CheckOnStartup { get; } - Boolean CheckOnConfigChange { get; } - Boolean CheckOnSchedule { get; } + bool CheckOnStartup { get; } + bool CheckOnConfigChange { get; } + bool CheckOnSchedule { get; } } } diff --git a/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs b/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs index 90d660942..fe1e18260 100644 --- a/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs +++ b/src/NzbDrone.Core/IndexerSearch/Definitions/SearchCriteriaBase.cs @@ -15,11 +15,11 @@ public abstract class SearchCriteriaBase private static readonly Regex BeginningThe = new Regex(@"^the\s", RegexOptions.IgnoreCase | RegexOptions.Compiled); public Series Series { get; set; } - public List SceneTitles { get; set; } + public List SceneTitles { get; set; } public List Episodes { get; set; } public virtual bool MonitoredEpisodesOnly { get; set; } - public List QueryTitles + public List QueryTitles { get { @@ -31,7 +31,7 @@ public static string GetQueryTitle(string title) { Ensure.That(title,() => title).IsNotNullOrWhiteSpace(); - var cleanTitle = BeginningThe.Replace(title, String.Empty); + var cleanTitle = BeginningThe.Replace(title, string.Empty); cleanTitle = cleanTitle.Replace("&", "and"); cleanTitle = SpecialCharacter.Replace(cleanTitle, ""); diff --git a/src/NzbDrone.Core/IndexerSearch/Definitions/SpecialEpisodeSearchCriteria.cs b/src/NzbDrone.Core/IndexerSearch/Definitions/SpecialEpisodeSearchCriteria.cs index 785cae196..ccb548188 100644 --- a/src/NzbDrone.Core/IndexerSearch/Definitions/SpecialEpisodeSearchCriteria.cs +++ b/src/NzbDrone.Core/IndexerSearch/Definitions/SpecialEpisodeSearchCriteria.cs @@ -8,7 +8,7 @@ public class SpecialEpisodeSearchCriteria : SearchCriteriaBase public override string ToString() { - return string.Format("[{0} : {1}]", Series.Title, String.Join(",", EpisodeQueryTitles)); + return string.Format("[{0} : {1}]", Series.Title, string.Join(",", EpisodeQueryTitles)); } } } diff --git a/src/NzbDrone.Core/IndexerSearch/EpisodeSearchCommand.cs b/src/NzbDrone.Core/IndexerSearch/EpisodeSearchCommand.cs index fb1d43113..78f7ad038 100644 --- a/src/NzbDrone.Core/IndexerSearch/EpisodeSearchCommand.cs +++ b/src/NzbDrone.Core/IndexerSearch/EpisodeSearchCommand.cs @@ -6,7 +6,7 @@ namespace NzbDrone.Core.IndexerSearch { public class EpisodeSearchCommand : Command { - public List EpisodeIds { get; set; } + public List EpisodeIds { get; set; } public override bool SendUpdatesToClient { @@ -20,7 +20,7 @@ public EpisodeSearchCommand() { } - public EpisodeSearchCommand(List episodeIds) + public EpisodeSearchCommand(List episodeIds) { EpisodeIds = episodeIds; } diff --git a/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs b/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs index 7211dbea1..dcb713b2a 100644 --- a/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs @@ -209,7 +209,7 @@ private List SearchSpecial(Series series, List episod { var searchSpec = Get(series, episodes); // build list of queries for each episode in the form: " " - searchSpec.EpisodeQueryTitles = episodes.Where(e => !String.IsNullOrWhiteSpace(e.Title)) + searchSpec.EpisodeQueryTitles = episodes.Where(e => !string.IsNullOrWhiteSpace(e.Title)) .SelectMany(e => searchSpec.QueryTitles.Select(title => title + " " + SearchCriteriaBase.GetQueryTitle(e.Title))) .ToArray(); diff --git a/src/NzbDrone.Core/Indexers/BitMeTv/BitMeTv.cs b/src/NzbDrone.Core/Indexers/BitMeTv/BitMeTv.cs index 0ed0cefd5..cb9a0b2cc 100644 --- a/src/NzbDrone.Core/Indexers/BitMeTv/BitMeTv.cs +++ b/src/NzbDrone.Core/Indexers/BitMeTv/BitMeTv.cs @@ -17,8 +17,8 @@ public override string Name } public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } } - public override Boolean SupportsSearch { get { return false; } } - public override Int32 PageSize { get { return 0; } } + public override bool SupportsSearch { get { return false; } } + public override int PageSize { get { return 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/BitMeTv/BitMeTvRequestGenerator.cs b/src/NzbDrone.Core/Indexers/BitMeTv/BitMeTvRequestGenerator.cs index d23c42efa..826e4537f 100644 --- a/src/NzbDrone.Core/Indexers/BitMeTv/BitMeTvRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/BitMeTv/BitMeTvRequestGenerator.cs @@ -46,7 +46,7 @@ public virtual IList> GetSearchRequests(SpecialEpiso private IEnumerable GetRssRequests() { - var request = new IndexerRequest(String.Format("{0}/rss.php?uid={1}&passkey={2}", Settings.BaseUrl.Trim().TrimEnd('/'), Settings.UserId, Settings.RssPasskey), HttpAccept.Html); + var request = new IndexerRequest(string.Format("{0}/rss.php?uid={1}&passkey={2}", Settings.BaseUrl.Trim().TrimEnd('/'), Settings.UserId, Settings.RssPasskey), HttpAccept.Html); request.HttpRequest.AddCookie(Settings.Cookie); diff --git a/src/NzbDrone.Core/Indexers/BitMeTv/BitMeTvSettings.cs b/src/NzbDrone.Core/Indexers/BitMeTv/BitMeTvSettings.cs index 60233f963..a39954750 100644 --- a/src/NzbDrone.Core/Indexers/BitMeTv/BitMeTvSettings.cs +++ b/src/NzbDrone.Core/Indexers/BitMeTv/BitMeTvSettings.cs @@ -34,16 +34,16 @@ public BitMeTvSettings() } [FieldDefinition(0, Label = "Website URL")] - public String BaseUrl { get; set; } + public string BaseUrl { get; set; } [FieldDefinition(1, Label = "UserId")] - public String UserId { get; set; } + public string UserId { get; set; } [FieldDefinition(2, Label = "RSS Passkey")] - public String RssPasskey { get; set; } + public string RssPasskey { get; set; } [FieldDefinition(3, Label = "Cookie", HelpText = "BitMeTv uses a login cookie needed to access the rss, you'll have to retrieve it via a browser.")] - public String Cookie { get; set; } + public string Cookie { get; set; } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetRequestGenerator.cs b/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetRequestGenerator.cs index db41099b8..24fb674c9 100644 --- a/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetRequestGenerator.cs @@ -9,8 +9,8 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet { public class BroadcastheNetRequestGenerator : IIndexerRequestGenerator { - public Int32 MaxPages { get; set; } - public Int32 PageSize { get; set; } + public int MaxPages { get; set; } + public int PageSize { get; set; } public BroadcastheNetSettings Settings { get; set; } public BroadcastheNetRequestGenerator() @@ -40,7 +40,7 @@ public virtual IList> GetSearchRequests(SingleEpisod parameters = parameters.Clone(); parameters.Category = "Episode"; - parameters.Name = String.Format("S{0:00}E{1:00}", episode.SeasonNumber, episode.EpisodeNumber); + parameters.Name = string.Format("S{0:00}E{1:00}", episode.SeasonNumber, episode.EpisodeNumber); pageableRequest.AddIfNotNull(GetPagedRequests(MaxPages, parameters)); } @@ -50,7 +50,7 @@ public virtual IList> GetSearchRequests(SingleEpisod parameters = parameters.Clone(); parameters.Category = "Season"; - parameters.Name = String.Format("Season {0}", seasonNumber); + parameters.Name = string.Format("Season {0}", seasonNumber); pageableRequest.AddIfNotNull(GetPagedRequests(MaxPages, parameters)); } @@ -69,14 +69,14 @@ public virtual IList> GetSearchRequests(SeasonSearch foreach (var seasonNumber in searchCriteria.Episodes.Select(v => v.SeasonNumber).Distinct()) { parameters.Category = "Episode"; - parameters.Name = String.Format("S{0:00}E%", seasonNumber); + parameters.Name = string.Format("S{0:00}E%", seasonNumber); pageableRequest.AddIfNotNull(GetPagedRequests(MaxPages, parameters)); parameters = parameters.Clone(); parameters.Category = "Season"; - parameters.Name = String.Format("Season {0}", seasonNumber); + parameters.Name = string.Format("Season {0}", seasonNumber); pageableRequest.AddIfNotNull(GetPagedRequests(MaxPages, parameters)); } @@ -93,7 +93,7 @@ public virtual IList> GetSearchRequests(DailyEpisode if (AddSeriesSearchParameters(parameters, searchCriteria)) { parameters.Category = "Episode"; - parameters.Name = String.Format("{0:yyyy}.{0:MM}.{0:dd}", searchCriteria.AirDate); + parameters.Name = string.Format("{0:yyyy}.{0:MM}.{0:dd}", searchCriteria.AirDate); pageableRequest.AddIfNotNull(GetPagedRequests(MaxPages, parameters)); } @@ -113,7 +113,7 @@ public virtual IList> GetSearchRequests(AnimeEpisode parameters = parameters.Clone(); parameters.Category = "Episode"; - parameters.Name = String.Format("S{0:00}E{1:00}", episode.SeasonNumber, episode.EpisodeNumber); + parameters.Name = string.Format("S{0:00}E{1:00}", episode.SeasonNumber, episode.EpisodeNumber); pageableRequest.AddIfNotNull(GetPagedRequests(MaxPages, parameters)); } @@ -123,7 +123,7 @@ public virtual IList> GetSearchRequests(AnimeEpisode parameters = parameters.Clone(); parameters.Category = "Season"; - parameters.Name = String.Format("Season {0}", seasonNumber); + parameters.Name = string.Format("Season {0}", seasonNumber); pageableRequest.AddIfNotNull(GetPagedRequests(MaxPages, parameters)); } @@ -141,26 +141,26 @@ private bool AddSeriesSearchParameters(BroadcastheNetTorrentQuery parameters, Se { if (searchCriteria.Series.TvdbId != 0) { - parameters.Tvdb = String.Format("{0}", searchCriteria.Series.TvdbId); + parameters.Tvdb = string.Format("{0}", searchCriteria.Series.TvdbId); return true; } if (searchCriteria.Series.TvRageId != 0) { - parameters.Tvrage = String.Format("{0}", searchCriteria.Series.TvRageId); + parameters.Tvrage = string.Format("{0}", searchCriteria.Series.TvRageId); return true; } // BTN is very neatly managed, so it's unlikely they map tvrage/tvdb wrongly. return false; } - private IEnumerable GetPagedRequests(Int32 maxPages, BroadcastheNetTorrentQuery parameters) + private IEnumerable GetPagedRequests(int maxPages, BroadcastheNetTorrentQuery parameters) { if (parameters == null) { parameters = new BroadcastheNetTorrentQuery(); } - var builder = new JsonRpcRequestBuilder(Settings.BaseUrl, "getTorrents", new Object[] { Settings.ApiKey, parameters, PageSize, 0 }); + var builder = new JsonRpcRequestBuilder(Settings.BaseUrl, "getTorrents", new object[] { Settings.ApiKey, parameters, PageSize, 0 }); builder.SupressHttpError = true; for (var page = 0; page < maxPages;page++) diff --git a/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetSettings.cs b/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetSettings.cs index 49745f7fd..2032c9823 100644 --- a/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetSettings.cs +++ b/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetSettings.cs @@ -25,10 +25,10 @@ public BroadcastheNetSettings() } [FieldDefinition(0, Label = "API URL", Advanced = true, HelpText = "Do not change this unless you know what you're doing. Since your API key will be sent to that host.")] - public String BaseUrl { get; set; } + public string BaseUrl { get; set; } [FieldDefinition(1, Label = "API Key")] - public String ApiKey { get; set; } + public string ApiKey { get; set; } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetTorrent.cs b/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetTorrent.cs index 9444878f8..8280d8414 100644 --- a/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetTorrent.cs +++ b/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetTorrent.cs @@ -4,30 +4,30 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet { public class BroadcastheNetTorrent { - public String GroupName { get; set; } - public Int32 GroupID { get; set; } - public Int32 TorrentID { get; set; } - public Int32 SeriesID { get; set; } - public String Series { get; set; } - public String SeriesBanner { get; set; } - public String SeriesPoster { get; set; } - public String YoutubeTrailer { get; set; } - public String Category { get; set; } - public Int32? Snatched { get; set; } - public Int32? Seeders { get; set; } - public Int32? Leechers { get; set; } - public String Source { get; set; } - public String Container { get; set; } - public String Codec { get; set; } - public String Resolution { get; set; } - public String Origin { get; set; } - public String ReleaseName { get; set; } - public Int64 Size { get; set; } - public Int64 Time { get; set; } - public Int32? TvdbID { get; set; } - public Int32? TvrageID { get; set; } - public String ImdbID { get; set; } - public String InfoHash { get; set; } - public String DownloadURL { get; set; } + public string GroupName { get; set; } + public int GroupID { get; set; } + public int TorrentID { get; set; } + public int SeriesID { get; set; } + public string Series { get; set; } + public string SeriesBanner { get; set; } + public string SeriesPoster { get; set; } + public string YoutubeTrailer { get; set; } + public string Category { get; set; } + public int? Snatched { get; set; } + public int? Seeders { get; set; } + public int? Leechers { get; set; } + public string Source { get; set; } + public string Container { get; set; } + public string Codec { get; set; } + public string Resolution { get; set; } + public string Origin { get; set; } + public string ReleaseName { get; set; } + public long Size { get; set; } + public long Time { get; set; } + public int? TvdbID { get; set; } + public int? TvrageID { get; set; } + public string ImdbID { get; set; } + public string InfoHash { get; set; } + public string DownloadURL { get; set; } } } diff --git a/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetTorrentQuery.cs b/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetTorrentQuery.cs index 9750b8a52..ea3369210 100644 --- a/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetTorrentQuery.cs +++ b/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetTorrentQuery.cs @@ -6,31 +6,31 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet public class BroadcastheNetTorrentQuery { [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] - public String Id { get; set; } + public string Id { get; set; } [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] - public String Category { get; set; } + public string Category { get; set; } [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] - public String Name { get; set; } + public string Name { get; set; } [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] - public String Search { get; set; } + public string Search { get; set; } [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] - public String Codec { get; set; } + public string Codec { get; set; } [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] - public String Container { get; set; } + public string Container { get; set; } [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] - public String Source { get; set; } + public string Source { get; set; } [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] - public String Resolution { get; set; } + public string Resolution { get; set; } [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] - public String Origin { get; set; } + public string Origin { get; set; } [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] - public String Hash { get; set; } + public string Hash { get; set; } [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] - public String Tvdb { get; set; } + public string Tvdb { get; set; } [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] - public String Tvrage { get; set; } + public string Tvrage { get; set; } [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] - public String Age { get; set; } + public string Age { get; set; } public BroadcastheNetTorrentQuery Clone() { diff --git a/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetTorrents.cs b/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetTorrents.cs index 186a902b7..6118bd6ca 100644 --- a/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetTorrents.cs +++ b/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetTorrents.cs @@ -5,7 +5,7 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet { public class BroadcastheNetTorrents { - public Dictionary Torrents { get; set; } - public Int32 Results { get; set; } + public Dictionary Torrents { get; set; } + public int Results { get; set; } } } diff --git a/src/NzbDrone.Core/Indexers/EzrssTorrentRssParser.cs b/src/NzbDrone.Core/Indexers/EzrssTorrentRssParser.cs index 017a1a89e..204e59a7b 100644 --- a/src/NzbDrone.Core/Indexers/EzrssTorrentRssParser.cs +++ b/src/NzbDrone.Core/Indexers/EzrssTorrentRssParser.cs @@ -33,47 +33,47 @@ protected override bool PreProcess(IndexerResponse indexerResponse) return base.PreProcess(indexerResponse); } - protected override Int64 GetSize(XElement item) + protected override long GetSize(XElement item) { var contentLength = item.FindDecendants("contentLength").SingleOrDefault(); if (contentLength != null) { - return (Int64)contentLength; + return (long)contentLength; } return base.GetSize(item); } - protected override String GetInfoHash(XElement item) + protected override string GetInfoHash(XElement item) { var infoHash = item.FindDecendants("infoHash").SingleOrDefault(); - return (String)infoHash; + return (string)infoHash; } - protected override String GetMagnetUrl(XElement item) + protected override string GetMagnetUrl(XElement item) { var magnetURI = item.FindDecendants("magnetURI").SingleOrDefault(); - return (String)magnetURI; + return (string)magnetURI; } - protected override Int32? GetSeeders(XElement item) + protected override int? GetSeeders(XElement item) { var seeds = item.FindDecendants("seeds").SingleOrDefault(); if (seeds != null) { - return (Int32)seeds; + return (int)seeds; } return base.GetSeeders(item); } - protected override Int32? GetPeers(XElement item) + protected override int? GetPeers(XElement item) { var peers = item.FindDecendants("peers").SingleOrDefault(); if (peers != null) { - return (Int32)peers; + return (int)peers; } return base.GetPeers(item); diff --git a/src/NzbDrone.Core/Indexers/Fanzub/FanzubRequestGenerator.cs b/src/NzbDrone.Core/Indexers/Fanzub/FanzubRequestGenerator.cs index a04364004..89bf9fc0a 100644 --- a/src/NzbDrone.Core/Indexers/Fanzub/FanzubRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/Fanzub/FanzubRequestGenerator.cs @@ -14,7 +14,7 @@ public class FanzubRequestGenerator : IIndexerRequestGenerator private static readonly Regex RemoveCharactersRegex = new Regex(@"[!?`]", RegexOptions.Compiled); public FanzubSettings Settings { get; set; } - public Int32 PageSize { get; set; } + public int PageSize { get; set; } public FanzubRequestGenerator() { @@ -51,7 +51,7 @@ public virtual IList> GetSearchRequests(AnimeEpisode var searchTitles = searchCriteria.QueryTitles.SelectMany(v => GetTitleSearchStrings(v, searchCriteria.AbsoluteEpisodeNumber)).ToList(); - pageableRequests.Add(GetPagedRequests(String.Join("|", searchTitles))); + pageableRequests.Add(GetPagedRequests(string.Join("|", searchTitles))); return pageableRequests; } @@ -61,7 +61,7 @@ public virtual IList> GetSearchRequests(SpecialEpiso return new List>(); } - private IEnumerable GetPagedRequests(String query) + private IEnumerable GetPagedRequests(string query) { var url = new StringBuilder(); url.AppendFormat("{0}?cat=anime&max={1}", Settings.BaseUrl, PageSize); @@ -74,14 +74,14 @@ private IEnumerable GetPagedRequests(String query) yield return new IndexerRequest(url.ToString(), HttpAccept.Rss); } - private IEnumerable GetTitleSearchStrings(string title, int absoluteEpisodeNumber) + private IEnumerable GetTitleSearchStrings(string title, int absoluteEpisodeNumber) { var formats = new[] { "{0}%20{1:00}", "{0}%20-%20{1:00}" }; - return formats.Select(s => "\"" + String.Format(s, CleanTitle(title), absoluteEpisodeNumber) + "\""); + return formats.Select(s => "\"" + string.Format(s, CleanTitle(title), absoluteEpisodeNumber) + "\""); } - private String CleanTitle(String title) + private string CleanTitle(string title) { return RemoveCharactersRegex.Replace(title, ""); } diff --git a/src/NzbDrone.Core/Indexers/Fanzub/FanzubSettings.cs b/src/NzbDrone.Core/Indexers/Fanzub/FanzubSettings.cs index 5586b9f8b..b7425b5b0 100644 --- a/src/NzbDrone.Core/Indexers/Fanzub/FanzubSettings.cs +++ b/src/NzbDrone.Core/Indexers/Fanzub/FanzubSettings.cs @@ -24,7 +24,7 @@ public FanzubSettings() } [FieldDefinition(0, Label = "Rss URL", HelpText = "Enter to URL to an Fanzub compatible RSS feed")] - public String BaseUrl { get; set; } + public string BaseUrl { get; set; } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Indexers/HDBits/HDBitsRequestGenerator.cs b/src/NzbDrone.Core/Indexers/HDBits/HDBitsRequestGenerator.cs index 7c59f2359..bf3979cad 100644 --- a/src/NzbDrone.Core/Indexers/HDBits/HDBitsRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/HDBits/HDBitsRequestGenerator.cs @@ -51,7 +51,7 @@ public IList> GetSearchRequests(DailyEpisodeSearchCr var query = new TorrentQuery(); if (TryAddSearchParameters(query, searchCriteria)) { - query.Search = String.Format("{0:yyyy}-{0:MM}-{0:dd}", searchCriteria.AirDate); + query.Search = string.Format("{0:yyyy}-{0:MM}-{0:dd}", searchCriteria.AirDate); requests.Add(GetRequest(query)); } diff --git a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs index d01f806bf..b4fdee029 100644 --- a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs +++ b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs @@ -19,7 +19,7 @@ namespace NzbDrone.Core.Indexers public abstract class HttpIndexerBase : IndexerBase where TSettings : IProviderConfig, new() { - protected const Int32 MaxNumResultsPerQuery = 1000; + protected const int MaxNumResultsPerQuery = 1000; private readonly IHttpClient _httpClient; @@ -27,7 +27,7 @@ public abstract class HttpIndexerBase : IndexerBase public override bool SupportsSearch { get { return true; } } public bool SupportsPaging { get { return PageSize > 0; } } - public virtual Int32 PageSize { get { return 0; } } + public virtual int PageSize { get { return 0; } } public virtual TimeSpan RateLimit { get { return TimeSpan.FromSeconds(2); } } public abstract IIndexerRequestGenerator GetRequestGenerator(); @@ -114,7 +114,7 @@ public override IList Fetch(SpecialEpisodeSearchCriteria searchCrit protected virtual IList FetchReleases(IList> pageableRequests, bool isRecent = false) { var releases = new List(); - var url = String.Empty; + var url = string.Empty; var parser = GetParser(); @@ -229,7 +229,7 @@ protected virtual IList FetchReleases(IList FetchReleases(IList page) + protected virtual bool IsFullPage(IList page) { return PageSize != 0 && page.Count >= PageSize; } diff --git a/src/NzbDrone.Core/Indexers/IIndexer.cs b/src/NzbDrone.Core/Indexers/IIndexer.cs index 93aefa7cf..317afdf0d 100644 --- a/src/NzbDrone.Core/Indexers/IIndexer.cs +++ b/src/NzbDrone.Core/Indexers/IIndexer.cs @@ -8,8 +8,8 @@ namespace NzbDrone.Core.Indexers { public interface IIndexer : IProvider { - Boolean SupportsRss { get; } - Boolean SupportsSearch { get; } + bool SupportsRss { get; } + bool SupportsSearch { get; } DownloadProtocol Protocol { get; } IList FetchRecent(); diff --git a/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrents.cs b/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrents.cs index edf1ddd45..0e602bafc 100644 --- a/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrents.cs +++ b/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrents.cs @@ -17,8 +17,8 @@ public override string Name } public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } } - public override Boolean SupportsSearch { get { return false; } } - public override Int32 PageSize { get { return 0; } } + public override bool SupportsSearch { get { return false; } } + public override int PageSize { get { return 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/IPTorrents/IPTorrentsSettings.cs b/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrentsSettings.cs index 5326dc537..ef7884145 100644 --- a/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrentsSettings.cs +++ b/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrentsSettings.cs @@ -31,7 +31,7 @@ public IPTorrentsSettings() } [FieldDefinition(0, Label = "Feed URL", HelpText = "The full RSS feed url generated by IPTorrents, using only the categories you selected (HD, SD, x264, etc ...)")] - public String Url { get; set; } + public string Url { get; set; } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Indexers/IndexerBase.cs b/src/NzbDrone.Core/Indexers/IndexerBase.cs index 92f923087..3c8f130ab 100644 --- a/src/NzbDrone.Core/Indexers/IndexerBase.cs +++ b/src/NzbDrone.Core/Indexers/IndexerBase.cs @@ -23,8 +23,8 @@ public abstract class IndexerBase : IIndexer public abstract string Name { get; } public abstract DownloadProtocol Protocol { get; } - public abstract Boolean SupportsRss { get; } - public abstract Boolean SupportsSearch { get; } + public abstract bool SupportsRss { get; } + public abstract bool SupportsSearch { get; } public IndexerBase(IIndexerStatusService indexerStatusService, IConfigService configService, IParsingService parsingService, Logger logger) { diff --git a/src/NzbDrone.Core/Indexers/IndexerDefinition.cs b/src/NzbDrone.Core/Indexers/IndexerDefinition.cs index 29004a1ab..499487b15 100644 --- a/src/NzbDrone.Core/Indexers/IndexerDefinition.cs +++ b/src/NzbDrone.Core/Indexers/IndexerDefinition.cs @@ -5,13 +5,13 @@ namespace NzbDrone.Core.Indexers { public class IndexerDefinition : ProviderDefinition { - public Boolean EnableRss { get; set; } - public Boolean EnableSearch { get; set; } + public bool EnableRss { get; set; } + public bool EnableSearch { get; set; } public DownloadProtocol Protocol { get; set; } - public Boolean SupportsRss { get; set; } - public Boolean SupportsSearch { get; set; } + public bool SupportsRss { get; set; } + public bool SupportsSearch { get; set; } - public override Boolean Enable + public override bool Enable { get { diff --git a/src/NzbDrone.Core/Indexers/IndexerRequest.cs b/src/NzbDrone.Core/Indexers/IndexerRequest.cs index c26799f8d..374f567f9 100644 --- a/src/NzbDrone.Core/Indexers/IndexerRequest.cs +++ b/src/NzbDrone.Core/Indexers/IndexerRequest.cs @@ -7,7 +7,7 @@ public class IndexerRequest { public HttpRequest HttpRequest { get; private set; } - public IndexerRequest(String url, HttpAccept httpAccept) + public IndexerRequest(string url, HttpAccept httpAccept) { HttpRequest = new HttpRequest(url, httpAccept); } diff --git a/src/NzbDrone.Core/Indexers/IndexerResponse.cs b/src/NzbDrone.Core/Indexers/IndexerResponse.cs index 07ad347b6..ffc4dc5e2 100644 --- a/src/NzbDrone.Core/Indexers/IndexerResponse.cs +++ b/src/NzbDrone.Core/Indexers/IndexerResponse.cs @@ -29,7 +29,7 @@ public HttpResponse HttpResponse get { return _httpResponse; } } - public String Content + public string Content { get { return _httpResponse.Content; } } diff --git a/src/NzbDrone.Core/Indexers/KickassTorrents/KickassTorrents.cs b/src/NzbDrone.Core/Indexers/KickassTorrents/KickassTorrents.cs index 3532cf2f2..34a545b78 100644 --- a/src/NzbDrone.Core/Indexers/KickassTorrents/KickassTorrents.cs +++ b/src/NzbDrone.Core/Indexers/KickassTorrents/KickassTorrents.cs @@ -17,7 +17,7 @@ public override string Name } public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } } - public override Int32 PageSize { get { return 25; } } + public override int PageSize { get { return 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/KickassTorrents/KickassTorrentsRequestGenerator.cs b/src/NzbDrone.Core/Indexers/KickassTorrents/KickassTorrentsRequestGenerator.cs index a310cd1f0..b887ec112 100644 --- a/src/NzbDrone.Core/Indexers/KickassTorrents/KickassTorrentsRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/KickassTorrents/KickassTorrentsRequestGenerator.cs @@ -11,8 +11,8 @@ public class KickassTorrentsRequestGenerator : IIndexerRequestGenerator { public KickassTorrentsSettings Settings { get; set; } - public Int32 MaxPages { get; set; } - public Int32 PageSize { get; set; } + public int MaxPages { get; set; } + public int PageSize { get; set; } public KickassTorrentsRequestGenerator() { @@ -38,12 +38,12 @@ public virtual IList> GetSearchRequests(SingleEpisod pageableRequests.AddIfNotNull(GetPagedRequests(MaxPages, "usearch", PrepareQuery(queryTitle), "category:tv", - String.Format("season:{0}", searchCriteria.SeasonNumber), - String.Format("episode:{0}", searchCriteria.EpisodeNumber))); + string.Format("season:{0}", searchCriteria.SeasonNumber), + string.Format("episode:{0}", searchCriteria.EpisodeNumber))); pageableRequests.AddIfNotNull(GetPagedRequests(MaxPages, "usearch", PrepareQuery(queryTitle), - String.Format("S{0:00}E{1:00}", searchCriteria.SeasonNumber, searchCriteria.EpisodeNumber), + string.Format("S{0:00}E{1:00}", searchCriteria.SeasonNumber, searchCriteria.EpisodeNumber), "category:tv")); } @@ -59,12 +59,12 @@ public virtual IList> GetSearchRequests(SeasonSearch pageableRequests.AddIfNotNull(GetPagedRequests(MaxPages, "usearch", PrepareQuery(queryTitle), "category:tv", - String.Format("season:{0}", searchCriteria.SeasonNumber))); + string.Format("season:{0}", searchCriteria.SeasonNumber))); pageableRequests.AddIfNotNull(GetPagedRequests(MaxPages, "usearch", PrepareQuery(queryTitle), "category:tv", - String.Format("S{0:00}", searchCriteria.SeasonNumber))); + string.Format("S{0:00}", searchCriteria.SeasonNumber))); } return pageableRequests; @@ -78,7 +78,7 @@ public virtual IList> GetSearchRequests(DailyEpisode { pageableRequests.AddIfNotNull(GetPagedRequests(MaxPages, "usearch", PrepareQuery(queryTitle), - String.Format("{0:yyyy-MM-dd}", searchCriteria.AirDate), + string.Format("{0:yyyy-MM-dd}", searchCriteria.AirDate), "category:tv")); } @@ -104,26 +104,26 @@ public virtual IList> GetSearchRequests(SpecialEpiso return pageableRequests; } - private IEnumerable GetPagedRequests(Int32 maxPages, String rssType, params String[] searchParameters) + private IEnumerable GetPagedRequests(int maxPages, string rssType, params string[] searchParameters) { - String searchUrl = null; + string searchUrl = null; if (searchParameters.Any()) { // Prevent adding a '/' if no search parameters are specified if (Settings.VerifiedOnly) { - searchUrl = String.Format("/{0} verified:1", String.Join(" ", searchParameters)); + searchUrl = string.Format("/{0} verified:1", string.Join(" ", searchParameters)); } else { - searchUrl = String.Format("/{0}", String.Join(" ", searchParameters)).Trim(); + searchUrl = string.Format("/{0}", string.Join(" ", searchParameters)).Trim(); } } if (PageSize == 0) { - var request = new IndexerRequest(String.Format("{0}/{1}{2}/?rss=1&field=time_add&sorder=desc", Settings.BaseUrl.TrimEnd('/'), rssType, searchUrl), HttpAccept.Rss); + var request = new IndexerRequest(string.Format("{0}/{1}{2}/?rss=1&field=time_add&sorder=desc", Settings.BaseUrl.TrimEnd('/'), rssType, searchUrl), HttpAccept.Rss); request.HttpRequest.SuppressHttpError = true; yield return request; @@ -132,7 +132,7 @@ private IEnumerable GetPagedRequests(Int32 maxPages, String rssT { for (var page = 0; page < maxPages; page++) { - var request = new IndexerRequest(String.Format("{0}/{1}{2}/{3}/?rss=1&field=time_add&sorder=desc", Settings.BaseUrl.TrimEnd('/'), rssType, searchUrl, page + 1), HttpAccept.Rss); + var request = new IndexerRequest(string.Format("{0}/{1}{2}/{3}/?rss=1&field=time_add&sorder=desc", Settings.BaseUrl.TrimEnd('/'), rssType, searchUrl, page + 1), HttpAccept.Rss); request.HttpRequest.SuppressHttpError = true; yield return request; @@ -140,7 +140,7 @@ private IEnumerable GetPagedRequests(Int32 maxPages, String rssT } } - private String PrepareQuery(String query) + private string PrepareQuery(string query) { return query.Replace('+', ' '); } diff --git a/src/NzbDrone.Core/Indexers/KickassTorrents/KickassTorrentsSettings.cs b/src/NzbDrone.Core/Indexers/KickassTorrents/KickassTorrentsSettings.cs index aac647d30..fe8c49625 100644 --- a/src/NzbDrone.Core/Indexers/KickassTorrents/KickassTorrentsSettings.cs +++ b/src/NzbDrone.Core/Indexers/KickassTorrents/KickassTorrentsSettings.cs @@ -25,10 +25,10 @@ public KickassTorrentsSettings() } [FieldDefinition(0, Label = "Website URL")] - public String BaseUrl { get; set; } + public string BaseUrl { get; set; } [FieldDefinition(1, Label = "Verified Only", Type = FieldType.Checkbox, HelpText = "By setting this to No you will likely get more junk and unconfirmed releases, so use it with caution.")] - public Boolean VerifiedOnly { get; set; } + public bool VerifiedOnly { get; set; } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs b/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs index 96a17a769..82d83ecb6 100644 --- a/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs +++ b/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs @@ -20,7 +20,7 @@ public override string Name } public override DownloadProtocol Protocol { get { return DownloadProtocol.Usenet; } } - public override Int32 PageSize { get { return 100; } } + public override int PageSize { get { return 100; } } public override IIndexerRequestGenerator GetRequestGenerator() { @@ -56,7 +56,7 @@ public Newznab(IHttpClient httpClient, IIndexerStatusService indexerStatusServic } - private IndexerDefinition GetDefinition(String name, NewznabSettings settings) + private IndexerDefinition GetDefinition(string name, NewznabSettings settings) { return new IndexerDefinition { @@ -71,7 +71,7 @@ private IndexerDefinition GetDefinition(String name, NewznabSettings settings) }; } - private NewznabSettings GetSettings(String url, params int[] categories) + private NewznabSettings GetSettings(string url, params int[] categories) { var settings = new NewznabSettings { Url = url }; diff --git a/src/NzbDrone.Core/Indexers/Newznab/NewznabRssParser.cs b/src/NzbDrone.Core/Indexers/Newznab/NewznabRssParser.cs index 0a895530d..6c8b3aa77 100644 --- a/src/NzbDrone.Core/Indexers/Newznab/NewznabRssParser.cs +++ b/src/NzbDrone.Core/Indexers/Newznab/NewznabRssParser.cs @@ -9,7 +9,7 @@ namespace NzbDrone.Core.Indexers.Newznab { public class NewznabRssParser : RssParser { - public const String ns = "{http://www.newznab.com/DTD/2010/feeds/attributes/}"; + public const string ns = "{http://www.newznab.com/DTD/2010/feeds/attributes/}"; protected override bool PreProcess(IndexerResponse indexerResponse) { @@ -45,22 +45,22 @@ protected override ReleaseInfo ProcessItem(XElement item, ReleaseInfo releaseInf return releaseInfo; } - protected override String GetInfoUrl(XElement item) + protected override string GetInfoUrl(XElement item) { return ParseUrl(item.TryGetValue("comments").TrimEnd("#comments")); } - protected override String GetCommentUrl(XElement item) + protected override string GetCommentUrl(XElement item) { return ParseUrl(item.TryGetValue("comments")); } - protected override Int64 GetSize(XElement item) + protected override long GetSize(XElement item) { - Int64 size; + long size; var sizeString = TryGetNewznabAttribute(item, "size"); - if (!sizeString.IsNullOrWhiteSpace() && Int64.TryParse(sizeString, out size)) + if (!sizeString.IsNullOrWhiteSpace() && long.TryParse(sizeString, out size)) { return size; } @@ -93,12 +93,12 @@ protected override string GetDownloadUrl(XElement item) return url; } - protected virtual Int32 GetTvRageId(XElement item) + protected virtual int GetTvRageId(XElement item) { var tvRageIdString = TryGetNewznabAttribute(item, "rageid"); - Int32 tvRageId; + int tvRageId; - if (!tvRageIdString.IsNullOrWhiteSpace() && Int32.TryParse(tvRageIdString, out tvRageId)) + if (!tvRageIdString.IsNullOrWhiteSpace() && int.TryParse(tvRageIdString, out tvRageId)) { return tvRageId; } @@ -106,7 +106,7 @@ protected virtual Int32 GetTvRageId(XElement item) return 0; } - protected String TryGetNewznabAttribute(XElement item, String key, String defaultValue = "") + protected string TryGetNewznabAttribute(XElement item, string key, string defaultValue = "") { var attr = item.Elements(ns + "attr").SingleOrDefault(e => e.Attribute("name").Value.Equals(key, StringComparison.CurrentCultureIgnoreCase)); diff --git a/src/NzbDrone.Core/Indexers/Nyaa/Nyaa.cs b/src/NzbDrone.Core/Indexers/Nyaa/Nyaa.cs index c5faae14b..12ad72197 100644 --- a/src/NzbDrone.Core/Indexers/Nyaa/Nyaa.cs +++ b/src/NzbDrone.Core/Indexers/Nyaa/Nyaa.cs @@ -17,7 +17,7 @@ public override string Name } public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } } - public override Int32 PageSize { get { return 100; } } + public override int PageSize { get { return 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/Nyaa/NyaaRequestGenerator.cs b/src/NzbDrone.Core/Indexers/Nyaa/NyaaRequestGenerator.cs index c794cfd33..543b26ee9 100644 --- a/src/NzbDrone.Core/Indexers/Nyaa/NyaaRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/Nyaa/NyaaRequestGenerator.cs @@ -10,8 +10,8 @@ public class NyaaRequestGenerator : IIndexerRequestGenerator { public NyaaSettings Settings { get; set; } - public Int32 MaxPages { get; set; } - public Int32 PageSize { get; set; } + public int MaxPages { get; set; } + public int PageSize { get; set; } public NyaaRequestGenerator() { @@ -52,14 +52,14 @@ public virtual IList> GetSearchRequests(AnimeEpisode var searchTitle = PrepareQuery(queryTitle); pageableRequests.AddIfNotNull(GetPagedRequests(MaxPages, - String.Format("&term={0}+{1:0}", + string.Format("&term={0}+{1:0}", searchTitle, searchCriteria.AbsoluteEpisodeNumber))); if (searchCriteria.AbsoluteEpisodeNumber < 10) { pageableRequests.AddIfNotNull(GetPagedRequests(MaxPages, - String.Format("&term={0}+{1:00}", + string.Format("&term={0}+{1:00}", searchTitle, searchCriteria.AbsoluteEpisodeNumber))); } @@ -75,31 +75,31 @@ public virtual IList> GetSearchRequests(SpecialEpiso foreach (var queryTitle in searchCriteria.EpisodeQueryTitles) { pageableRequests.AddIfNotNull(GetPagedRequests(MaxPages, - String.Format("&term={0}", + string.Format("&term={0}", PrepareQuery(queryTitle)))); } return pageableRequests; } - private IEnumerable GetPagedRequests(Int32 maxPages, String searchParameters) + private IEnumerable GetPagedRequests(int maxPages, string searchParameters) { - var baseUrl = String.Format("{0}/?page=rss{1}", Settings.BaseUrl.TrimEnd('/'), Settings.AdditionalParameters); + var baseUrl = string.Format("{0}/?page=rss{1}", Settings.BaseUrl.TrimEnd('/'), Settings.AdditionalParameters); if (PageSize == 0) { - yield return new IndexerRequest(String.Format("{0}{1}", baseUrl, searchParameters), HttpAccept.Rss); + yield return new IndexerRequest(string.Format("{0}{1}", baseUrl, searchParameters), HttpAccept.Rss); } else { for (var page = 0; page < maxPages; page++) { - yield return new IndexerRequest(String.Format("{0}&offset={1}{2}", baseUrl, page + 1, searchParameters), HttpAccept.Rss); + yield return new IndexerRequest(string.Format("{0}&offset={1}{2}", baseUrl, page + 1, searchParameters), HttpAccept.Rss); } } } - private String PrepareQuery(String query) + private string PrepareQuery(string query) { return query.Replace(' ', '+'); } diff --git a/src/NzbDrone.Core/Indexers/Nyaa/NyaaSettings.cs b/src/NzbDrone.Core/Indexers/Nyaa/NyaaSettings.cs index aeccd4963..555e2b007 100644 --- a/src/NzbDrone.Core/Indexers/Nyaa/NyaaSettings.cs +++ b/src/NzbDrone.Core/Indexers/Nyaa/NyaaSettings.cs @@ -26,10 +26,10 @@ public NyaaSettings() } [FieldDefinition(0, Label = "Website URL")] - public String BaseUrl { get; set; } + public string BaseUrl { get; set; } [FieldDefinition(1, Label = "Additional Parameters", Advanced = true, HelpText = "Please note if you change the category you will have to add required/restricted rules about the subgroups to avoid foreign language releases.")] - public String AdditionalParameters { get; set; } + public string AdditionalParameters { get; set; } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Indexers/Omgwtfnzbs/OmgwtfnzbsRequestGenerator.cs b/src/NzbDrone.Core/Indexers/Omgwtfnzbs/OmgwtfnzbsRequestGenerator.cs index bb98e7aff..a557d0e32 100644 --- a/src/NzbDrone.Core/Indexers/Omgwtfnzbs/OmgwtfnzbsRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/Omgwtfnzbs/OmgwtfnzbsRequestGenerator.cs @@ -9,7 +9,7 @@ namespace NzbDrone.Core.Indexers.Omgwtfnzbs { public class OmgwtfnzbsRequestGenerator : IIndexerRequestGenerator { - public String BaseUrl { get; set; } + public string BaseUrl { get; set; } public OmgwtfnzbsSettings Settings { get; set; } public OmgwtfnzbsRequestGenerator() @@ -32,7 +32,7 @@ public virtual IList> GetSearchRequests(SingleEpisod foreach (var queryTitle in searchCriteria.QueryTitles) { - pageableRequests.AddIfNotNull(GetPagedRequests(String.Format("{0}+S{1:00}E{2:00}", + pageableRequests.AddIfNotNull(GetPagedRequests(string.Format("{0}+S{1:00}E{2:00}", queryTitle, searchCriteria.SeasonNumber, searchCriteria.EpisodeNumber))); @@ -47,7 +47,7 @@ public virtual IList> GetSearchRequests(SeasonSearch foreach (var queryTitle in searchCriteria.QueryTitles) { - pageableRequests.AddIfNotNull(GetPagedRequests(String.Format("{0}+S{1:00}", + pageableRequests.AddIfNotNull(GetPagedRequests(string.Format("{0}+S{1:00}", queryTitle, searchCriteria.SeasonNumber))); } @@ -61,7 +61,7 @@ public virtual IList> GetSearchRequests(DailyEpisode foreach (var queryTitle in searchCriteria.QueryTitles) { - pageableRequests.AddIfNotNull(GetPagedRequests(String.Format("{0}+{1:yyyy MM dd}", + pageableRequests.AddIfNotNull(GetPagedRequests(string.Format("{0}+{1:yyyy MM dd}", queryTitle, searchCriteria.AirDate))); } @@ -89,7 +89,7 @@ public virtual IList> GetSearchRequests(SpecialEpiso return pageableRequests; } - private IEnumerable GetPagedRequests(String query) + private IEnumerable GetPagedRequests(string query) { var url = new StringBuilder(); url.AppendFormat("{0}?catid=19,20&user={1}&api={2}&eng=1&delay={3}", BaseUrl, Settings.Username, Settings.ApiKey, Settings.Delay); diff --git a/src/NzbDrone.Core/Indexers/Omgwtfnzbs/OmgwtfnzbsRssParser.cs b/src/NzbDrone.Core/Indexers/Omgwtfnzbs/OmgwtfnzbsRssParser.cs index 497a3cdae..4077cd26a 100644 --- a/src/NzbDrone.Core/Indexers/Omgwtfnzbs/OmgwtfnzbsRssParser.cs +++ b/src/NzbDrone.Core/Indexers/Omgwtfnzbs/OmgwtfnzbsRssParser.cs @@ -38,7 +38,7 @@ protected override string GetInfoUrl(XElement item) return match.Groups["URL"].Value; } - return String.Empty; + return string.Empty; } } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Indexers/RssIndexerRequestGenerator.cs b/src/NzbDrone.Core/Indexers/RssIndexerRequestGenerator.cs index 98b8a313b..0c94604ad 100644 --- a/src/NzbDrone.Core/Indexers/RssIndexerRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/RssIndexerRequestGenerator.cs @@ -7,9 +7,9 @@ namespace NzbDrone.Core.Indexers { public class RssIndexerRequestGenerator : IIndexerRequestGenerator { - private readonly String _baseUrl; + private readonly string _baseUrl; - public RssIndexerRequestGenerator(String baseUrl) + public RssIndexerRequestGenerator(string baseUrl) { _baseUrl = baseUrl; } diff --git a/src/NzbDrone.Core/Indexers/RssParser.cs b/src/NzbDrone.Core/Indexers/RssParser.cs index 2b60153d1..27f1496ee 100644 --- a/src/NzbDrone.Core/Indexers/RssParser.cs +++ b/src/NzbDrone.Core/Indexers/RssParser.cs @@ -19,14 +19,14 @@ public class RssParser : IParseIndexerResponse protected readonly Logger _logger; // Use the 'guid' element content as InfoUrl. - public Boolean UseGuidInfoUrl { get; set; } + public bool UseGuidInfoUrl { get; set; } // Use the enclosure as download url and/or length. - public Boolean UseEnclosureUrl { get; set; } - public Boolean UseEnclosureLength { get; set; } + public bool UseEnclosureUrl { get; set; } + public bool UseEnclosureLength { get; set; } // Parse "Size: 1.3 GB" or "1.3 GB" parts in the description element and use that as Size. - public Boolean ParseSizeInDescription { get; set; } + public bool ParseSizeInDescription { get; set; } private IndexerResponse _indexerResponse; @@ -93,7 +93,7 @@ protected virtual ReleaseInfo CreateNewReleaseInfo() return new ReleaseInfo(); } - protected virtual Boolean PreProcess(IndexerResponse indexerResponse) + protected virtual bool PreProcess(IndexerResponse indexerResponse) { if (indexerResponse.HttpResponse.StatusCode != System.Net.HttpStatusCode.OK) { @@ -146,12 +146,12 @@ protected virtual ReleaseInfo PostProcess(XElement item, ReleaseInfo releaseInfo return releaseInfo; } - protected virtual String GetGuid(XElement item) + protected virtual string GetGuid(XElement item) { return item.TryGetValue("guid", Guid.NewGuid().ToString()); } - protected virtual String GetTitle(XElement item) + protected virtual string GetTitle(XElement item) { return item.TryGetValue("title", "Unknown"); } @@ -266,18 +266,18 @@ protected virtual string ParseUrl(string value) private static readonly Regex ParseSizeRegex = new Regex(@"(?(?:\d+,)*\d+(?:\.\d{1,2})?)\W?(?[KMG]i?B)(?![\w/])", RegexOptions.IgnoreCase | RegexOptions.Compiled); - public static Int64 ParseSize(String sizeString, Boolean defaultToBinaryPrefix) + public static long ParseSize(string sizeString, bool defaultToBinaryPrefix) { if (sizeString.All(char.IsDigit)) { - return Int64.Parse(sizeString); + return long.Parse(sizeString); } var match = ParseSizeRegex.Matches(sizeString); if (match.Count != 0) { - var value = Decimal.Parse(Regex.Replace(match[0].Groups["value"].Value, "\\,", ""), CultureInfo.InvariantCulture); + var value = decimal.Parse(Regex.Replace(match[0].Groups["value"].Value, "\\,", ""), CultureInfo.InvariantCulture); var unit = match[0].Groups["unit"].Value.ToLower(); @@ -296,13 +296,13 @@ public static Int64 ParseSize(String sizeString, Boolean defaultToBinaryPrefix) case "gib": return ConvertToBytes(Convert.ToDouble(value), 3, true); default: - return (Int64)value; + return (long)value; } } return 0; } - private static Int64 ConvertToBytes(Double value, Int32 power, Boolean binaryPrefix) + private static long ConvertToBytes(double value, int power, bool binaryPrefix) { var prefix = binaryPrefix ? 1024 : 1000; var multiplier = Math.Pow(prefix, power); diff --git a/src/NzbDrone.Core/Indexers/RssSyncService.cs b/src/NzbDrone.Core/Indexers/RssSyncService.cs index b328d19b8..4fc2cf0d9 100644 --- a/src/NzbDrone.Core/Indexers/RssSyncService.cs +++ b/src/NzbDrone.Core/Indexers/RssSyncService.cs @@ -55,7 +55,7 @@ private ProcessedDecisions Sync() var decisions = _downloadDecisionMaker.GetRssDecision(reports); var processed = _processDownloadDecisions.ProcessDecisions(decisions); - var message = String.Format("RSS Sync Completed. Reports found: {0}, Reports grabbed: {1}", reports.Count, processed.Grabbed.Count); + var message = string.Format("RSS Sync Completed. Reports found: {0}, Reports grabbed: {1}", reports.Count, processed.Grabbed.Count); if (processed.Pending.Any()) { diff --git a/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssIndexer.cs b/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssIndexer.cs index b8d96e9f7..f67506bf3 100644 --- a/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssIndexer.cs +++ b/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssIndexer.cs @@ -17,8 +17,8 @@ public override string Name } public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } } - public override Boolean SupportsSearch { get { return false; } } - public override Int32 PageSize { get { return 0; } } + public override bool SupportsSearch { get { return false; } } + public override int PageSize { get { return 0; } } private readonly ITorrentRssParserFactory _torrentRssParserFactory; diff --git a/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssIndexerRequestGenerator.cs b/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssIndexerRequestGenerator.cs index f330b4112..b288a5acd 100644 --- a/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssIndexerRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssIndexerRequestGenerator.cs @@ -44,7 +44,7 @@ public virtual IList> GetSearchRequests(SpecialEpiso return new List>(); } - private IEnumerable GetRssRequests(String searchParameters) + private IEnumerable GetRssRequests(string searchParameters) { var request = new IndexerRequest(Settings.BaseUrl.Trim().TrimEnd('/'), HttpAccept.Rss); diff --git a/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssSettingsDetector.cs b/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssSettingsDetector.cs index 7e0f55932..fb98b7b46 100644 --- a/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssSettingsDetector.cs +++ b/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssSettingsDetector.cs @@ -186,7 +186,7 @@ private TorrentRssIndexerParserSettings GetGenericTorrentRssParserSettings(Index return settings; } - private Boolean IsEZTVFeed(IndexerResponse response) + private bool IsEZTVFeed(IndexerResponse response) { using (var xmlTextReader = XmlReader.Create(new StringReader(response.Content), new XmlReaderSettings { DtdProcessing = DtdProcessing.Parse, ValidationType = ValidationType.None, IgnoreComments = true, XmlResolver = null })) { diff --git a/src/NzbDrone.Core/Indexers/TorrentRssParser.cs b/src/NzbDrone.Core/Indexers/TorrentRssParser.cs index c3b13aba9..af94ac174 100644 --- a/src/NzbDrone.Core/Indexers/TorrentRssParser.cs +++ b/src/NzbDrone.Core/Indexers/TorrentRssParser.cs @@ -10,10 +10,10 @@ namespace NzbDrone.Core.Indexers public class TorrentRssParser : RssParser { // Parse various seeder/leecher/peers formats in the description element to determine number of seeders. - public Boolean ParseSeedersInDescription { get; set; } + public bool ParseSeedersInDescription { get; set; } // Use the specified element name to determine the size - public String SizeElementName { get; set; } + public string SizeElementName { get; set; } public TorrentRssParser() { @@ -45,7 +45,7 @@ protected override ReleaseInfo ProcessItem(XElement item, ReleaseInfo releaseInf return result; } - protected virtual String GetInfoHash(XElement item) + protected virtual string GetInfoHash(XElement item) { var magnetUrl = GetMagnetUrl(item); if (magnetUrl.IsNotNullOrWhiteSpace()) @@ -63,7 +63,7 @@ protected virtual String GetInfoHash(XElement item) return null; } - protected virtual String GetMagnetUrl(XElement item) + protected virtual string GetMagnetUrl(XElement item) { var downloadUrl = GetDownloadUrl(item); if (downloadUrl.IsNotNullOrWhiteSpace() && downloadUrl.StartsWith("magnet:")) @@ -74,7 +74,7 @@ protected virtual String GetMagnetUrl(XElement item) return null; } - protected virtual Int32? GetSeeders(XElement item) + protected virtual int? GetSeeders(XElement item) { if (ParseSeedersInDescription && item.Element("description") != null) { @@ -82,7 +82,7 @@ protected virtual String GetMagnetUrl(XElement item) if (matchSeeders.Success) { - return Int32.Parse(matchSeeders.Groups["value"].Value); + return int.Parse(matchSeeders.Groups["value"].Value); } var matchPeers = ParsePeersRegex.Match(item.Element("description").Value); @@ -90,14 +90,14 @@ protected virtual String GetMagnetUrl(XElement item) if (matchPeers.Success && matchLeechers.Success) { - return Int32.Parse(matchPeers.Groups["value"].Value) - Int32.Parse(matchLeechers.Groups["value"].Value); + return int.Parse(matchPeers.Groups["value"].Value) - int.Parse(matchLeechers.Groups["value"].Value); } } return null; } - protected virtual Int32? GetPeers(XElement item) + protected virtual int? GetPeers(XElement item) { if (ParseSeedersInDescription && item.Element("description") != null) { @@ -105,7 +105,7 @@ protected virtual String GetMagnetUrl(XElement item) if (matchPeers.Success) { - return Int32.Parse(matchPeers.Groups["value"].Value); + return int.Parse(matchPeers.Groups["value"].Value); } var matchSeeders = ParseSeedersRegex.Match(item.Element("description").Value); @@ -113,7 +113,7 @@ protected virtual String GetMagnetUrl(XElement item) if (matchSeeders.Success && matchLeechers.Success) { - return Int32.Parse(matchSeeders.Groups["value"].Value) + Int32.Parse(matchLeechers.Groups["value"].Value); + return int.Parse(matchSeeders.Groups["value"].Value) + int.Parse(matchLeechers.Groups["value"].Value); } } diff --git a/src/NzbDrone.Core/Indexers/Torrentleech/Torrentleech.cs b/src/NzbDrone.Core/Indexers/Torrentleech/Torrentleech.cs index e6f6bea9f..f7ef5366c 100644 --- a/src/NzbDrone.Core/Indexers/Torrentleech/Torrentleech.cs +++ b/src/NzbDrone.Core/Indexers/Torrentleech/Torrentleech.cs @@ -17,8 +17,8 @@ public override string Name } public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } } - public override Boolean SupportsSearch { get { return false; } } - public override Int32 PageSize { get { return 0; } } + public override bool SupportsSearch { get { return false; } } + public override int PageSize { get { return 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/Torrentleech/TorrentleechRequestGenerator.cs b/src/NzbDrone.Core/Indexers/Torrentleech/TorrentleechRequestGenerator.cs index 4b4605b77..dc6e6c72f 100644 --- a/src/NzbDrone.Core/Indexers/Torrentleech/TorrentleechRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/Torrentleech/TorrentleechRequestGenerator.cs @@ -44,9 +44,9 @@ public virtual IList> GetSearchRequests(SpecialEpiso return new List>(); } - private IEnumerable GetRssRequests(String searchParameters) + private IEnumerable GetRssRequests(string searchParameters) { - yield return new IndexerRequest(String.Format("{0}/{1}{2}", Settings.BaseUrl.Trim().TrimEnd('/'), Settings.ApiKey, searchParameters), HttpAccept.Rss); + yield return new IndexerRequest(string.Format("{0}/{1}{2}", Settings.BaseUrl.Trim().TrimEnd('/'), Settings.ApiKey, searchParameters), HttpAccept.Rss); } } } diff --git a/src/NzbDrone.Core/Indexers/Torrentleech/TorrentleechSettings.cs b/src/NzbDrone.Core/Indexers/Torrentleech/TorrentleechSettings.cs index bd99f4075..3cbedeefc 100644 --- a/src/NzbDrone.Core/Indexers/Torrentleech/TorrentleechSettings.cs +++ b/src/NzbDrone.Core/Indexers/Torrentleech/TorrentleechSettings.cs @@ -25,10 +25,10 @@ public TorrentleechSettings() } [FieldDefinition(0, Label = "Website URL")] - public String BaseUrl { get; set; } + public string BaseUrl { get; set; } [FieldDefinition(1, Label = "API Key")] - public String ApiKey { get; set; } + public string ApiKey { get; set; } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Indexers/Torznab/Torznab.cs b/src/NzbDrone.Core/Indexers/Torznab/Torznab.cs index 98d0c0f33..e4550e8df 100644 --- a/src/NzbDrone.Core/Indexers/Torznab/Torznab.cs +++ b/src/NzbDrone.Core/Indexers/Torznab/Torznab.cs @@ -24,7 +24,7 @@ public override string Name } public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } } - public override Int32 PageSize { get { return 100; } } + public override int PageSize { get { return 100; } } public override IIndexerRequestGenerator GetRequestGenerator() { @@ -54,7 +54,7 @@ public Torznab(ITorznabCapabilitiesProvider torznabCapabilitiesProvider, IHttpCl _torznabCapabilitiesProvider = torznabCapabilitiesProvider; } - private IndexerDefinition GetDefinition(String name, TorznabSettings settings) + private IndexerDefinition GetDefinition(string name, TorznabSettings settings) { return new IndexerDefinition { @@ -69,7 +69,7 @@ private IndexerDefinition GetDefinition(String name, TorznabSettings settings) }; } - private TorznabSettings GetSettings(String url, params int[] categories) + private TorznabSettings GetSettings(string url, params int[] categories) { var settings = new TorznabSettings { Url = url }; diff --git a/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs b/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs index bce7cd028..0c82a7ab5 100644 --- a/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs +++ b/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs @@ -9,7 +9,7 @@ namespace NzbDrone.Core.Indexers.Torznab { public class TorznabRssParser : TorrentRssParser { - public const String ns = "{http://torznab.com/schemas/2015/feed}"; + public const string ns = "{http://torznab.com/schemas/2015/feed}"; protected override bool PreProcess(IndexerResponse indexerResponse) { @@ -57,12 +57,12 @@ protected override ReleaseInfo PostProcess(XElement item, ReleaseInfo releaseInf } - protected override String GetInfoUrl(XElement item) + protected override string GetInfoUrl(XElement item) { return ParseUrl(item.TryGetValue("comments").TrimEnd("#comments")); } - protected override String GetCommentUrl(XElement item) + protected override string GetCommentUrl(XElement item) { return ParseUrl(item.TryGetValue("comments")); } @@ -111,12 +111,12 @@ protected virtual Int32 GetTvRageId(XElement item) return 0; } - protected override String GetInfoHash(XElement item) + protected override string GetInfoHash(XElement item) { return TryGetTorznabAttribute(item, "infohash"); } - protected override String GetMagnetUrl(XElement item) + protected override string GetMagnetUrl(XElement item) { return TryGetTorznabAttribute(item, "magneturl"); } @@ -153,7 +153,7 @@ protected override String GetMagnetUrl(XElement item) return base.GetPeers(item); } - protected String TryGetTorznabAttribute(XElement item, String key, String defaultValue = "") + protected string TryGetTorznabAttribute(XElement item, string key, string defaultValue = "") { var attr = item.Elements(ns + "attr").SingleOrDefault(e => e.Attribute("name").Value.Equals(key, StringComparison.CurrentCultureIgnoreCase)); diff --git a/src/NzbDrone.Core/Indexers/XElementExtensions.cs b/src/NzbDrone.Core/Indexers/XElementExtensions.cs index fd1521937..bd0b6b32a 100644 --- a/src/NzbDrone.Core/Indexers/XElementExtensions.cs +++ b/src/NzbDrone.Core/Indexers/XElementExtensions.cs @@ -62,7 +62,7 @@ public static DateTime PublishDate(this XElement item) return ParseDate(dateString); } - public static List Links(this XElement item) + public static List Links(this XElement item) { var elements = item.Elements("link"); diff --git a/src/NzbDrone.Core/Instrumentation/DatabaseTarget.cs b/src/NzbDrone.Core/Instrumentation/DatabaseTarget.cs index b61f217fc..0fe6c4a63 100644 --- a/src/NzbDrone.Core/Instrumentation/DatabaseTarget.cs +++ b/src/NzbDrone.Core/Instrumentation/DatabaseTarget.cs @@ -69,7 +69,7 @@ protected override void Write(LogEventInfo logEvent) if (logEvent.Exception != null) { - if (String.IsNullOrWhiteSpace(log.Message)) + if (string.IsNullOrWhiteSpace(log.Message)) { log.Message = logEvent.Exception.Message; } diff --git a/src/NzbDrone.Core/Instrumentation/Log.cs b/src/NzbDrone.Core/Instrumentation/Log.cs index 67cd0c1f9..6410ab6e9 100644 --- a/src/NzbDrone.Core/Instrumentation/Log.cs +++ b/src/NzbDrone.Core/Instrumentation/Log.cs @@ -17,6 +17,6 @@ public class Log : ModelBase public string ExceptionType { get; set; } - public String Level { get; set; } + public string Level { get; set; } } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Jobs/ScheduledTask.cs b/src/NzbDrone.Core/Jobs/ScheduledTask.cs index 99dfc5f75..5d842696d 100644 --- a/src/NzbDrone.Core/Jobs/ScheduledTask.cs +++ b/src/NzbDrone.Core/Jobs/ScheduledTask.cs @@ -5,8 +5,8 @@ namespace NzbDrone.Core.Jobs { public class ScheduledTask : ModelBase { - public String TypeName { get; set; } - public Int32 Interval { get; set; } + public string TypeName { get; set; } + public int Interval { get; set; } public DateTime LastExecution { get; set; } } } \ 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 b59664629..7d0bb0ec6 100644 --- a/src/NzbDrone.Core/MediaFiles/Commands/DownloadedEpisodesScanCommand.cs +++ b/src/NzbDrone.Core/MediaFiles/Commands/DownloadedEpisodesScanCommand.cs @@ -13,10 +13,10 @@ public override bool SendUpdatesToClient } } - public Boolean SendUpdates { get; set; } + public bool SendUpdates { get; set; } // Properties used by third-party apps, do not modify. - public String Path { get; set; } - public String DownloadClientId { get; set; } + public string Path { get; set; } + public string DownloadClientId { get; set; } } } \ No newline at end of file diff --git a/src/NzbDrone.Core/MediaFiles/DiskScanService.cs b/src/NzbDrone.Core/MediaFiles/DiskScanService.cs index 5c8896fdf..82c5822aa 100644 --- a/src/NzbDrone.Core/MediaFiles/DiskScanService.cs +++ b/src/NzbDrone.Core/MediaFiles/DiskScanService.cs @@ -139,7 +139,7 @@ private IEnumerable FilterFiles(Series series, IEnumerable video .Where(file => !ExcludedFilesRegex.IsMatch(Path.GetFileName(file))); } - private void SetPermissions(String path) + private void SetPermissions(string path) { if (!_configService.SetPermissionsLinux) { diff --git a/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesCommandService.cs b/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesCommandService.cs index 732e76902..8250d92f0 100644 --- a/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesCommandService.cs +++ b/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesCommandService.cs @@ -39,7 +39,7 @@ private List ProcessDroneFactoryFolder() { var downloadedEpisodesFolder = _configService.DownloadedEpisodesFolder; - if (String.IsNullOrEmpty(downloadedEpisodesFolder)) + if (string.IsNullOrEmpty(downloadedEpisodesFolder)) { _logger.Trace("Drone Factory folder is not configured"); return new List(); diff --git a/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs b/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs index ec9beee5e..043870e1f 100644 --- a/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs +++ b/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs @@ -209,7 +209,7 @@ private List ProcessFile(FileInfo fileInfo, DownloadClientItem dow return new List { - UnknownSeriesResult(String.Format("Unknown Series for file: {0}", fileInfo.Name), fileInfo.FullName) + UnknownSeriesResult(string.Format("Unknown Series for file: {0}", fileInfo.Name), fileInfo.FullName) }; } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeFile.cs b/src/NzbDrone.Core/MediaFiles/EpisodeFile.cs index 8da87eca4..ecce449b4 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeFile.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeFile.cs @@ -10,22 +10,22 @@ namespace NzbDrone.Core.MediaFiles { public class EpisodeFile : ModelBase { - public Int32 SeriesId { get; set; } - public Int32 SeasonNumber { get; set; } - public String RelativePath { get; set; } - public String Path { get; set; } - public Int64 Size { get; set; } + public int SeriesId { get; set; } + public int SeasonNumber { get; set; } + public string RelativePath { get; set; } + public string Path { get; set; } + public long Size { get; set; } public DateTime DateAdded { get; set; } - public String SceneName { get; set; } - public String ReleaseGroup { get; set; } + public string SceneName { get; set; } + public string ReleaseGroup { get; set; } public QualityModel Quality { get; set; } public MediaInfoModel MediaInfo { get; set; } public LazyLoaded> Episodes { get; set; } public LazyLoaded Series { get; set; } - public override String ToString() + public override string ToString() { - return String.Format("[{0}] {1}", Id, RelativePath); + return string.Format("[{0}] {1}", Id, RelativePath); } } } \ No newline at end of file diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs index b302f8d4b..ae1450167 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs @@ -17,7 +17,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport { public interface IMakeImportDecision { - List GetImportDecisions(List videoFiles, Series series); + List GetImportDecisions(List videoFiles, Series series); List GetImportDecisions(List videoFiles, Series series, ParsedEpisodeInfo folderInfo, bool sceneSource); } @@ -141,7 +141,7 @@ private Rejection EvaluateSpec(IImportDecisionEngineSpecification spec, LocalEpi //e.Data.Add("report", remoteEpisode.Report.ToJson()); //e.Data.Add("parsed", remoteEpisode.ParsedEpisodeInfo.ToJson()); _logger.ErrorException("Couldn't evaluate decision on " + localEpisode.Path, e); - return new Rejection(String.Format("{0}: {1}", spec.GetType().Name, e.Message)); + return new Rejection(string.Format("{0}: {1}", spec.GetType().Name, e.Message)); } return null; diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecification.cs index 5c761e631..02c293328 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecification.cs @@ -50,14 +50,14 @@ public Decision IsSatisfiedBy(LocalEpisode localEpisode) if (unexpected.Any()) { - _logger.Debug("Unexpected episode number(s) in file: {0}", String.Join(", ", unexpected)); + _logger.Debug("Unexpected episode number(s) in file: {0}", string.Join(", ", unexpected)); if (unexpected.Count == 1) { return Decision.Reject("Episode Number {0} was unexpected", unexpected.First()); } - return Decision.Reject("Episode Numbers {0} were unexpected", String.Join(", ", unexpected)); + return Decision.Reject("Episode Numbers {0} were unexpected", string.Join(", ", unexpected)); } return Decision.Accept(); diff --git a/src/NzbDrone.Core/MediaFiles/Events/EpisodeImportedEvent.cs b/src/NzbDrone.Core/MediaFiles/Events/EpisodeImportedEvent.cs index 84b40d7b6..84275022a 100644 --- a/src/NzbDrone.Core/MediaFiles/Events/EpisodeImportedEvent.cs +++ b/src/NzbDrone.Core/MediaFiles/Events/EpisodeImportedEvent.cs @@ -8,9 +8,9 @@ public class EpisodeImportedEvent : IEvent { public LocalEpisode EpisodeInfo { get; private set; } public EpisodeFile ImportedEpisode { get; private set; } - public Boolean NewDownload { get; private set; } - public String DownloadClient { get; private set; } - public String DownloadId { get; private set; } + public bool NewDownload { get; private set; } + public string DownloadClient { get; private set; } + public string DownloadId { get; private set; } public EpisodeImportedEvent(LocalEpisode episodeInfo, EpisodeFile importedEpisode, bool newDownload) { diff --git a/src/NzbDrone.Core/MediaFiles/MediaFileExtensions.cs b/src/NzbDrone.Core/MediaFiles/MediaFileExtensions.cs index 29de999c8..f2372dfb6 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaFileExtensions.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaFileExtensions.cs @@ -7,11 +7,11 @@ namespace NzbDrone.Core.MediaFiles { public static class MediaFileExtensions { - private static Dictionary _fileExtensions; + private static Dictionary _fileExtensions; static MediaFileExtensions() { - _fileExtensions = new Dictionary + _fileExtensions = new Dictionary { { ".m4v", Quality.SDTV }, { ".3gp", Quality.SDTV }, @@ -67,9 +67,9 @@ static MediaFileExtensions() }; } - public static HashSet Extensions + public static HashSet Extensions { - get { return new HashSet(_fileExtensions.Keys); } + get { return new HashSet(_fileExtensions.Keys); } } public static Quality GetQualityForExtension(string extension) diff --git a/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs b/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs index 263500dd8..53bf40dfd 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs @@ -33,7 +33,7 @@ public void Clean(Series series, List filesOnDisk) var seriesFiles = _mediaFileService.GetFilesBySeries(series.Id); var episodes = _episodeService.GetEpisodeBySeries(series.Id); - var filesOnDiskKeys = new HashSet(filesOnDisk, PathEqualityComparer.Instance); + var filesOnDiskKeys = new HashSet(filesOnDisk, PathEqualityComparer.Instance); foreach (var seriesFile in seriesFiles) { @@ -68,7 +68,7 @@ public void Clean(Series series, List filesOnDisk) catch (Exception ex) { - var errorMessage = String.Format("Unable to cleanup EpisodeFile in DB: {0}", episodeFile.Id); + var errorMessage = string.Format("Unable to cleanup EpisodeFile in DB: {0}", episodeFile.Id); _logger.ErrorException(errorMessage, ex); } } diff --git a/src/NzbDrone.Core/MediaFiles/MediaInfo/MediaInfoLib.cs b/src/NzbDrone.Core/MediaFiles/MediaInfo/MediaInfoLib.cs index ea10f4842..b7b2f7d38 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaInfo/MediaInfoLib.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaInfo/MediaInfoLib.cs @@ -265,7 +265,7 @@ public string Get(StreamKind streamKind, int streamNumber, int parameter, InfoKi } } - public String Option(String option, String value) + public string Option(string option, string value) { var pOption = MakeStringParameter(option); var pValue = MakeStringParameter(value); @@ -304,11 +304,11 @@ public int Count_Get(StreamKind streamKind, int streamNumber = -1) [DllImport("MediaInfo.dll")] private static extern IntPtr MediaInfo_Open(IntPtr handle, IntPtr fileName); [DllImport("MediaInfo.dll")] - private static extern IntPtr MediaInfo_Open_Buffer_Init(IntPtr handle, Int64 fileSize, Int64 fileOffset); + private static extern IntPtr MediaInfo_Open_Buffer_Init(IntPtr handle, long fileSize, long fileOffset); [DllImport("MediaInfo.dll")] private static extern IntPtr MediaInfo_Open_Buffer_Continue(IntPtr handle, byte[] buffer, IntPtr bufferSize); [DllImport("MediaInfo.dll")] - private static extern Int64 MediaInfo_Open_Buffer_Continue_GoTo_Get(IntPtr handle); + private static extern long MediaInfo_Open_Buffer_Continue_GoTo_Get(IntPtr handle); [DllImport("MediaInfo.dll")] private static extern IntPtr MediaInfo_Open_Buffer_Finalize(IntPtr handle); [DllImport("MediaInfo.dll")] @@ -331,11 +331,11 @@ public int Count_Get(StreamKind streamKind, int streamNumber = -1) [DllImport("MediaInfo.dll")] private static extern IntPtr MediaInfoA_Open(IntPtr handle, IntPtr fileName); [DllImport("MediaInfo.dll")] - private static extern IntPtr MediaInfoA_Open_Buffer_Init(IntPtr handle, Int64 fileSize, Int64 fileOffset); + private static extern IntPtr MediaInfoA_Open_Buffer_Init(IntPtr handle, long fileSize, long fileOffset); [DllImport("MediaInfo.dll")] private static extern IntPtr MediaInfoA_Open_Buffer_Continue(IntPtr handle, byte[] buffer, IntPtr bufferSize); [DllImport("MediaInfo.dll")] - private static extern Int64 MediaInfoA_Open_Buffer_Continue_GoTo_Get(IntPtr handle); + private static extern long MediaInfoA_Open_Buffer_Continue_GoTo_Get(IntPtr handle); [DllImport("MediaInfo.dll")] private static extern IntPtr MediaInfoA_Open_Buffer_Finalize(IntPtr handle); [DllImport("MediaInfo.dll")] diff --git a/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs b/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs index 8b17a4082..bc34f10cb 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs @@ -62,9 +62,9 @@ public MediaInfoModel GetMediaInfo(string filename) int generalRuntime; //Runtime - Int32.TryParse(mediaInfo.Get(StreamKind.Video, 0, "PlayTime"), out videoRuntime); - Int32.TryParse(mediaInfo.Get(StreamKind.Audio, 0, "PlayTime"), out audioRuntime); - Int32.TryParse(mediaInfo.Get(StreamKind.General, 0, "PlayTime"), out generalRuntime); + int.TryParse(mediaInfo.Get(StreamKind.Video, 0, "PlayTime"), out videoRuntime); + int.TryParse(mediaInfo.Get(StreamKind.Audio, 0, "PlayTime"), out audioRuntime); + int.TryParse(mediaInfo.Get(StreamKind.General, 0, "PlayTime"), out generalRuntime); if (audioRuntime == 0 && videoRuntime == 0 && generalRuntime == 0) { @@ -92,23 +92,23 @@ public MediaInfoModel GetMediaInfo(string filename) string subtitles = mediaInfo.Get(StreamKind.General, 0, "Text_Language_List"); string scanType = mediaInfo.Get(StreamKind.Video, 0, "ScanType"); - Int32.TryParse(mediaInfo.Get(StreamKind.Video, 0, "Width"), out width); - Int32.TryParse(mediaInfo.Get(StreamKind.Video, 0, "Height"), out height); - Int32.TryParse(mediaInfo.Get(StreamKind.Video, 0, "BitRate"), out videoBitRate); - Decimal.TryParse(mediaInfo.Get(StreamKind.Video, 0, "FrameRate"), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out videoFrameRate); + int.TryParse(mediaInfo.Get(StreamKind.Video, 0, "Width"), out width); + int.TryParse(mediaInfo.Get(StreamKind.Video, 0, "Height"), out height); + int.TryParse(mediaInfo.Get(StreamKind.Video, 0, "BitRate"), out videoBitRate); + decimal.TryParse(mediaInfo.Get(StreamKind.Video, 0, "FrameRate"), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out videoFrameRate); //Runtime - Int32.TryParse(mediaInfo.Get(StreamKind.Video, 0, "PlayTime"), out videoRuntime); - Int32.TryParse(mediaInfo.Get(StreamKind.Audio, 0, "PlayTime"), out audioRuntime); - Int32.TryParse(mediaInfo.Get(StreamKind.General, 0, "PlayTime"), out generalRuntime); + int.TryParse(mediaInfo.Get(StreamKind.Video, 0, "PlayTime"), out videoRuntime); + int.TryParse(mediaInfo.Get(StreamKind.Audio, 0, "PlayTime"), out audioRuntime); + int.TryParse(mediaInfo.Get(StreamKind.General, 0, "PlayTime"), out generalRuntime); string aBitRate = mediaInfo.Get(StreamKind.Audio, 0, "BitRate"); int aBindex = aBitRate.IndexOf(" /", StringComparison.InvariantCultureIgnoreCase); if (aBindex > 0) aBitRate = aBitRate.Remove(aBindex); - Int32.TryParse(aBitRate, out audioBitRate); - Int32.TryParse(mediaInfo.Get(StreamKind.Audio, 0, "StreamCount"), out streamCount); + int.TryParse(aBitRate, out audioBitRate); + int.TryParse(mediaInfo.Get(StreamKind.Audio, 0, "StreamCount"), out streamCount); string audioChannelsStr = mediaInfo.Get(StreamKind.Audio, 0, "Channel(s)"); @@ -123,7 +123,7 @@ public MediaInfoModel GetMediaInfo(string filename) if (aPindex > 0) audioProfile = audioProfile.Remove(aPindex); - Int32.TryParse(audioChannelsStr, out audioChannels); + int.TryParse(audioChannelsStr, out audioChannels); var mediaInfoModel = new MediaInfoModel { VideoCodec = mediaInfo.Get(StreamKind.Video, 0, "Codec/String"), diff --git a/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs b/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs index 076a749ef..95345f405 100644 --- a/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs +++ b/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs @@ -44,7 +44,7 @@ public void DeleteFolder(string path) _logger.Info("Attempting to send '{0}' to recycling bin", path); var recyclingBin = _configService.RecycleBin; - if (String.IsNullOrWhiteSpace(recyclingBin)) + if (string.IsNullOrWhiteSpace(recyclingBin)) { _logger.Info("Recycling Bin has not been configured, deleting permanently. {0}", path); _diskProvider.DeleteFolder(path, true); @@ -78,7 +78,7 @@ public void DeleteFile(string path) _logger.Debug("Attempting to send '{0}' to recycling bin", path); var recyclingBin = _configService.RecycleBin; - if (String.IsNullOrWhiteSpace(recyclingBin)) + if (string.IsNullOrWhiteSpace(recyclingBin)) { _logger.Info("Recycling Bin has not been configured, deleting permanently. {0}", path); @@ -117,7 +117,7 @@ public void DeleteFile(string path) } catch (IOException e) { - var message = String.Format("Unable to move '{0}' to the recycling bin: '{1}'", path, destination); + var message = string.Format("Unable to move '{0}' to the recycling bin: '{1}'", path, destination); _logger.ErrorException(message, e); throw; } @@ -134,7 +134,7 @@ public void DeleteFile(string path) public void Empty() { - if (String.IsNullOrWhiteSpace(_configService.RecycleBin)) + if (string.IsNullOrWhiteSpace(_configService.RecycleBin)) { _logger.Info("Recycle Bin has not been configured, cannot empty."); return; @@ -157,7 +157,7 @@ public void Empty() public void Cleanup() { - if (String.IsNullOrWhiteSpace(_configService.RecycleBin)) + if (string.IsNullOrWhiteSpace(_configService.RecycleBin)) { _logger.Info("Recycle Bin has not been configured, cannot cleanup."); return; diff --git a/src/NzbDrone.Core/MediaFiles/RenameEpisodeFilePreview.cs b/src/NzbDrone.Core/MediaFiles/RenameEpisodeFilePreview.cs index fe546f4b5..0564016f4 100644 --- a/src/NzbDrone.Core/MediaFiles/RenameEpisodeFilePreview.cs +++ b/src/NzbDrone.Core/MediaFiles/RenameEpisodeFilePreview.cs @@ -5,11 +5,11 @@ namespace NzbDrone.Core.MediaFiles { public class RenameEpisodeFilePreview { - public Int32 SeriesId { get; set; } - public Int32 SeasonNumber { get; set; } - public List EpisodeNumbers { get; set; } - public Int32 EpisodeFileId { get; set; } - public String ExistingPath { get; set; } - public String NewPath { get; set; } + public int SeriesId { get; set; } + public int SeasonNumber { get; set; } + public List EpisodeNumbers { get; set; } + public int EpisodeFileId { get; set; } + public string ExistingPath { get; set; } + public string NewPath { get; set; } } } diff --git a/src/NzbDrone.Core/MediaFiles/SameFilenameException.cs b/src/NzbDrone.Core/MediaFiles/SameFilenameException.cs index d80fe4ba1..c2a8cbd1f 100644 --- a/src/NzbDrone.Core/MediaFiles/SameFilenameException.cs +++ b/src/NzbDrone.Core/MediaFiles/SameFilenameException.cs @@ -4,7 +4,7 @@ namespace NzbDrone.Core.MediaFiles { public class SameFilenameException : Exception { - public String Filename { get; set; } + public string Filename { get; set; } public SameFilenameException(string message, string filename) : base(message) { diff --git a/src/NzbDrone.Core/MediaFiles/TorrentInfo/TorrentFileInfoReader.cs b/src/NzbDrone.Core/MediaFiles/TorrentInfo/TorrentFileInfoReader.cs index 2e8f12758..9b07782ba 100644 --- a/src/NzbDrone.Core/MediaFiles/TorrentInfo/TorrentFileInfoReader.cs +++ b/src/NzbDrone.Core/MediaFiles/TorrentInfo/TorrentFileInfoReader.cs @@ -5,12 +5,12 @@ namespace NzbDrone.Core.MediaFiles.TorrentInfo { public interface ITorrentFileInfoReader { - String GetHashFromTorrentFile(Byte[] fileContents); + string GetHashFromTorrentFile(byte[] fileContents); } public class TorrentFileInfoReader: ITorrentFileInfoReader { - public String GetHashFromTorrentFile(byte[] fileContents) + public string GetHashFromTorrentFile(byte[] fileContents) { return Torrent.Load(fileContents).InfoHash.ToHex(); } diff --git a/src/NzbDrone.Core/Messaging/Commands/Command.cs b/src/NzbDrone.Core/Messaging/Commands/Command.cs index e68a9f6d5..7dd845a04 100644 --- a/src/NzbDrone.Core/Messaging/Commands/Command.cs +++ b/src/NzbDrone.Core/Messaging/Commands/Command.cs @@ -28,7 +28,7 @@ public virtual string CompletionMessage } } - public String Name { get; private set; } + public string Name { get; private set; } public DateTime? LastExecutionTime { get; set; } public CommandTrigger Trigger { get; set; } diff --git a/src/NzbDrone.Core/Messaging/Events/EventAggregator.cs b/src/NzbDrone.Core/Messaging/Events/EventAggregator.cs index c5d41a047..2853dd57d 100644 --- a/src/NzbDrone.Core/Messaging/Events/EventAggregator.cs +++ b/src/NzbDrone.Core/Messaging/Events/EventAggregator.cs @@ -83,7 +83,7 @@ private static string GetEventName(Type eventType) return eventType.Name; } - return String.Format("{0}<{1}>", eventType.Name.Remove(eventType.Name.IndexOf('`')), eventType.GetGenericArguments()[0].Name); + return string.Format("{0}<{1}>", eventType.Name.Remove(eventType.Name.IndexOf('`')), eventType.GetGenericArguments()[0].Name); } } } diff --git a/src/NzbDrone.Core/Metadata/Consumers/MediaBrowser/MediaBrowserMetadataSettings.cs b/src/NzbDrone.Core/Metadata/Consumers/MediaBrowser/MediaBrowserMetadataSettings.cs index d490d9097..e4201e8ba 100644 --- a/src/NzbDrone.Core/Metadata/Consumers/MediaBrowser/MediaBrowserMetadataSettings.cs +++ b/src/NzbDrone.Core/Metadata/Consumers/MediaBrowser/MediaBrowserMetadataSettings.cs @@ -23,7 +23,7 @@ public MediaBrowserMetadataSettings() } [FieldDefinition(0, Label = "Series Metadata", Type = FieldType.Checkbox)] - public Boolean SeriesMetadata { get; set; } + public bool SeriesMetadata { get; set; } public bool IsValid { diff --git a/src/NzbDrone.Core/Metadata/Consumers/Roksbox/RoksboxMetadata.cs b/src/NzbDrone.Core/Metadata/Consumers/Roksbox/RoksboxMetadata.cs index 726f518ff..c479d7e3b 100644 --- a/src/NzbDrone.Core/Metadata/Consumers/Roksbox/RoksboxMetadata.cs +++ b/src/NzbDrone.Core/Metadata/Consumers/Roksbox/RoksboxMetadata.cs @@ -168,7 +168,7 @@ public override MetadataFileResult EpisodeMetadata(Series series, EpisodeFile ep _logger.Debug("Generating Episode Metadata for: {0}", episodeFile.RelativePath); - var xmlResult = String.Empty; + var xmlResult = string.Empty; foreach (var episode in episodeFile.Episodes.Value) { var sb = new StringBuilder(); @@ -181,10 +181,10 @@ public override MetadataFileResult EpisodeMetadata(Series series, EpisodeFile ep var doc = new XDocument(); var details = new XElement("video"); - details.Add(new XElement("title", String.Format("{0} - {1}x{2} - {3}", series.Title, episode.SeasonNumber, episode.EpisodeNumber, episode.Title))); + details.Add(new XElement("title", string.Format("{0} - {1}x{2} - {3}", series.Title, episode.SeasonNumber, episode.EpisodeNumber, episode.Title))); details.Add(new XElement("year", episode.AirDate)); - details.Add(new XElement("genre", String.Join(" / ", series.Genres))); - var actors = String.Join(" , ", series.Actors.ConvertAll(c => c.Name + " - " + c.Character).GetRange(0, Math.Min(3, series.Actors.Count))); + details.Add(new XElement("genre", string.Join(" / ", series.Genres))); + var actors = string.Join(" , ", series.Actors.ConvertAll(c => c.Name + " - " + c.Character).GetRange(0, Math.Min(3, series.Actors.Count))); details.Add(new XElement("actors", actors)); details.Add(new XElement("description", episode.Overview)); details.Add(new XElement("length", series.Runtime)); @@ -263,9 +263,9 @@ private string GetEpisodeImageFilename(string episodeFilePath) return Path.ChangeExtension(episodeFilePath, "jpg"); } - private Dictionary GetSeasonFolders(Series series) + private Dictionary GetSeasonFolders(Series series) { - var seasonFolderMap = new Dictionary(); + var seasonFolderMap = new Dictionary(); foreach (var folder in _diskProvider.GetDirectories(series.Path)) { @@ -283,7 +283,7 @@ private Dictionary GetSeasonFolders(Series series) else { int matchedSeason; - if (Int32.TryParse(seasonNumber, out matchedSeason)) + if (int.TryParse(seasonNumber, out matchedSeason)) { seasonFolderMap[matchedSeason] = folder; } diff --git a/src/NzbDrone.Core/Metadata/Consumers/Roksbox/RoksboxMetadataSettings.cs b/src/NzbDrone.Core/Metadata/Consumers/Roksbox/RoksboxMetadataSettings.cs index 040643e5e..08858653a 100644 --- a/src/NzbDrone.Core/Metadata/Consumers/Roksbox/RoksboxMetadataSettings.cs +++ b/src/NzbDrone.Core/Metadata/Consumers/Roksbox/RoksboxMetadataSettings.cs @@ -26,16 +26,16 @@ public RoksboxMetadataSettings() } [FieldDefinition(0, Label = "Episode Metadata", Type = FieldType.Checkbox)] - public Boolean EpisodeMetadata { get; set; } + public bool EpisodeMetadata { get; set; } [FieldDefinition(1, Label = "Series Images", Type = FieldType.Checkbox)] - public Boolean SeriesImages { get; set; } + public bool SeriesImages { get; set; } [FieldDefinition(2, Label = "Season Images", Type = FieldType.Checkbox)] - public Boolean SeasonImages { get; set; } + public bool SeasonImages { get; set; } [FieldDefinition(3, Label = "Episode Images", Type = FieldType.Checkbox)] - public Boolean EpisodeImages { get; set; } + public bool EpisodeImages { get; set; } public bool IsValid { diff --git a/src/NzbDrone.Core/Metadata/Consumers/Wdtv/WdtvMetadata.cs b/src/NzbDrone.Core/Metadata/Consumers/Wdtv/WdtvMetadata.cs index bc4e5edca..076797c1f 100644 --- a/src/NzbDrone.Core/Metadata/Consumers/Wdtv/WdtvMetadata.cs +++ b/src/NzbDrone.Core/Metadata/Consumers/Wdtv/WdtvMetadata.cs @@ -159,7 +159,7 @@ public override MetadataFileResult EpisodeMetadata(Series series, EpisodeFile ep _logger.Debug("Generating Episode Metadata for: {0}", Path.Combine(series.Path, episodeFile.RelativePath)); - var xmlResult = String.Empty; + var xmlResult = string.Empty; foreach (var episode in episodeFile.Episodes.Value) { var sb = new StringBuilder(); @@ -173,14 +173,14 @@ public override MetadataFileResult EpisodeMetadata(Series series, EpisodeFile ep var details = new XElement("details"); details.Add(new XElement("id", series.Id)); - details.Add(new XElement("title", String.Format("{0} - {1}x{2:00} - {3}", series.Title, episode.SeasonNumber, episode.EpisodeNumber, episode.Title))); + details.Add(new XElement("title", string.Format("{0} - {1}x{2:00} - {3}", series.Title, episode.SeasonNumber, episode.EpisodeNumber, episode.Title))); details.Add(new XElement("series_name", series.Title)); details.Add(new XElement("episode_name", episode.Title)); details.Add(new XElement("season_number", episode.SeasonNumber.ToString("00"))); details.Add(new XElement("episode_number", episode.EpisodeNumber.ToString("00"))); details.Add(new XElement("firstaired", episode.AirDate)); - details.Add(new XElement("genre", String.Join(" / ", series.Genres))); - details.Add(new XElement("actor", String.Join(" / ", series.Actors.ConvertAll(c => c.Name + " - " + c.Character)))); + details.Add(new XElement("genre", string.Join(" / ", series.Genres))); + details.Add(new XElement("actor", string.Join(" / ", series.Actors.ConvertAll(c => c.Name + " - " + c.Character)))); details.Add(new XElement("overview", episode.Overview)); @@ -283,9 +283,9 @@ private string GetEpisodeImageFilename(string episodeFilePath) return Path.ChangeExtension(episodeFilePath, "metathumb"); } - private Dictionary GetSeasonFolders(Series series) + private Dictionary GetSeasonFolders(Series series) { - var seasonFolderMap = new Dictionary(); + var seasonFolderMap = new Dictionary(); foreach (var folder in _diskProvider.GetDirectories(series.Path)) { @@ -303,7 +303,7 @@ private Dictionary GetSeasonFolders(Series series) else { int matchedSeason; - if (Int32.TryParse(seasonNumber, out matchedSeason)) + if (int.TryParse(seasonNumber, out matchedSeason)) { seasonFolderMap[matchedSeason] = folder; } diff --git a/src/NzbDrone.Core/Metadata/Consumers/Wdtv/WdtvMetadataSettings.cs b/src/NzbDrone.Core/Metadata/Consumers/Wdtv/WdtvMetadataSettings.cs index 31ce00b60..b8fcfe599 100644 --- a/src/NzbDrone.Core/Metadata/Consumers/Wdtv/WdtvMetadataSettings.cs +++ b/src/NzbDrone.Core/Metadata/Consumers/Wdtv/WdtvMetadataSettings.cs @@ -26,16 +26,16 @@ public WdtvMetadataSettings() } [FieldDefinition(0, Label = "Episode Metadata", Type = FieldType.Checkbox)] - public Boolean EpisodeMetadata { get; set; } + public bool EpisodeMetadata { get; set; } [FieldDefinition(1, Label = "Series Images", Type = FieldType.Checkbox)] - public Boolean SeriesImages { get; set; } + public bool SeriesImages { get; set; } [FieldDefinition(2, Label = "Season Images", Type = FieldType.Checkbox)] - public Boolean SeasonImages { get; set; } + public bool SeasonImages { get; set; } [FieldDefinition(3, Label = "Episode Images", Type = FieldType.Checkbox)] - public Boolean EpisodeImages { get; set; } + public bool EpisodeImages { get; set; } public bool IsValid { diff --git a/src/NzbDrone.Core/Metadata/Consumers/Xbmc/XbmcMetadata.cs b/src/NzbDrone.Core/Metadata/Consumers/Xbmc/XbmcMetadata.cs index 19fc5406f..3ca83e18f 100644 --- a/src/NzbDrone.Core/Metadata/Consumers/Xbmc/XbmcMetadata.cs +++ b/src/NzbDrone.Core/Metadata/Consumers/Xbmc/XbmcMetadata.cs @@ -121,7 +121,7 @@ public override MetadataFile FindMetadataFile(Series series, string path) metadata.SeasonNumber = 0; } - else if (Int32.TryParse(seasonNumberMatch, out seasonNumber)) + else if (int.TryParse(seasonNumberMatch, out seasonNumber)) { metadata.SeasonNumber = seasonNumber; } @@ -172,7 +172,7 @@ public override MetadataFileResult SeriesMetadata(Series series) xws.OmitXmlDeclaration = true; xws.Indent = false; - var episodeGuideUrl = String.Format("http://www.thetvdb.com/api/1D62F2F90030C444/series/{0}/all/en.zip", series.TvdbId); + var episodeGuideUrl = string.Format("http://www.thetvdb.com/api/1D62F2F90030C444/series/{0}/all/en.zip", series.TvdbId); using (var xw = XmlWriter.Create(sb, xws)) { @@ -235,7 +235,7 @@ public override MetadataFileResult EpisodeMetadata(Series series, EpisodeFile ep _logger.Debug("Generating Episode Metadata for: {0}", Path.Combine(series.Path, episodeFile.RelativePath)); - var xmlResult = String.Empty; + var xmlResult = string.Empty; foreach (var episode in episodeFile.Episodes.Value) { var sb = new StringBuilder(); @@ -356,11 +356,11 @@ private IEnumerable ProcessSeasonImages(Series series, Season s { foreach (var image in season.Images) { - var filename = String.Format("season{0:00}-{1}.jpg", season.SeasonNumber, image.CoverType.ToString().ToLower()); + var filename = string.Format("season{0:00}-{1}.jpg", season.SeasonNumber, image.CoverType.ToString().ToLower()); if (season.SeasonNumber == 0) { - filename = String.Format("season-specials-{0}.jpg", image.CoverType.ToString().ToLower()); + filename = string.Format("season-specials-{0}.jpg", image.CoverType.ToString().ToLower()); } yield return new ImageFileResult(Path.Combine(series.Path, filename), image.Url); diff --git a/src/NzbDrone.Core/Metadata/Consumers/Xbmc/XbmcMetadataSettings.cs b/src/NzbDrone.Core/Metadata/Consumers/Xbmc/XbmcMetadataSettings.cs index 72a7e59da..0908ff69f 100644 --- a/src/NzbDrone.Core/Metadata/Consumers/Xbmc/XbmcMetadataSettings.cs +++ b/src/NzbDrone.Core/Metadata/Consumers/Xbmc/XbmcMetadataSettings.cs @@ -27,19 +27,19 @@ public XbmcMetadataSettings() } [FieldDefinition(0, Label = "Series Metadata", Type = FieldType.Checkbox)] - public Boolean SeriesMetadata { get; set; } + public bool SeriesMetadata { get; set; } [FieldDefinition(1, Label = "Episode Metadata", Type = FieldType.Checkbox)] - public Boolean EpisodeMetadata { get; set; } + public bool EpisodeMetadata { get; set; } [FieldDefinition(2, Label = "Series Images", Type = FieldType.Checkbox)] - public Boolean SeriesImages { get; set; } + public bool SeriesImages { get; set; } [FieldDefinition(3, Label = "Season Images", Type = FieldType.Checkbox)] - public Boolean SeasonImages { get; set; } + public bool SeasonImages { get; set; } [FieldDefinition(4, Label = "Episode Images", Type = FieldType.Checkbox)] - public Boolean EpisodeImages { get; set; } + public bool EpisodeImages { get; set; } public bool IsValid { diff --git a/src/NzbDrone.Core/Metadata/Files/ImageFileResult.cs b/src/NzbDrone.Core/Metadata/Files/ImageFileResult.cs index 18c152038..26a2e41df 100644 --- a/src/NzbDrone.Core/Metadata/Files/ImageFileResult.cs +++ b/src/NzbDrone.Core/Metadata/Files/ImageFileResult.cs @@ -4,8 +4,8 @@ namespace NzbDrone.Core.Metadata.Files { public class ImageFileResult { - public String RelativePath { get; set; } - public String Url { get; set; } + public string RelativePath { get; set; } + public string Url { get; set; } public ImageFileResult(string relativePath, string url) { diff --git a/src/NzbDrone.Core/Metadata/Files/MetadataFile.cs b/src/NzbDrone.Core/Metadata/Files/MetadataFile.cs index c30e9064d..96cdd1fe0 100644 --- a/src/NzbDrone.Core/Metadata/Files/MetadataFile.cs +++ b/src/NzbDrone.Core/Metadata/Files/MetadataFile.cs @@ -5,13 +5,13 @@ namespace NzbDrone.Core.Metadata.Files { public class MetadataFile : ModelBase { - public Int32 SeriesId { get; set; } - public String Consumer { get; set; } + public int SeriesId { get; set; } + public string Consumer { get; set; } public MetadataType Type { get; set; } - public String RelativePath { get; set; } + public string RelativePath { get; set; } public DateTime LastUpdated { get; set; } - public Int32? EpisodeFileId { get; set; } - public Int32? SeasonNumber { get; set; } - public String Hash { get; set; } + public int? EpisodeFileId { get; set; } + public int? SeasonNumber { get; set; } + public string Hash { get; set; } } } diff --git a/src/NzbDrone.Core/Metadata/Files/MetadataFileResult.cs b/src/NzbDrone.Core/Metadata/Files/MetadataFileResult.cs index fdd90883b..fd0b69316 100644 --- a/src/NzbDrone.Core/Metadata/Files/MetadataFileResult.cs +++ b/src/NzbDrone.Core/Metadata/Files/MetadataFileResult.cs @@ -4,8 +4,8 @@ namespace NzbDrone.Core.Metadata.Files { public class MetadataFileResult { - public String RelativePath { get; set; } - public String Contents { get; set; } + public string RelativePath { get; set; } + public string Contents { get; set; } public MetadataFileResult(string relativePath, string contents) { diff --git a/src/NzbDrone.Core/Metadata/MetadataService.cs b/src/NzbDrone.Core/Metadata/MetadataService.cs index 15847acd6..99d6e9733 100644 --- a/src/NzbDrone.Core/Metadata/MetadataService.cs +++ b/src/NzbDrone.Core/Metadata/MetadataService.cs @@ -367,7 +367,7 @@ private List ProcessEpisodeImages(IMetadata consumer, Series serie return result; } - private void DownloadImage(Series series, String url, String path) + private void DownloadImage(Series series, string url, string path) { try { @@ -384,7 +384,7 @@ private void DownloadImage(Series series, String url, String path) } } - private void SaveMetadataFile(String path, String contents) + private void SaveMetadataFile(string path, string contents) { _diskProvider.WriteAllText(path, contents); _mediaFileAttributeService.SetFilePermissions(path); diff --git a/src/NzbDrone.Core/MetadataSource/SearchSeriesComparer.cs b/src/NzbDrone.Core/MetadataSource/SearchSeriesComparer.cs index ba8121c47..05d9a1223 100644 --- a/src/NzbDrone.Core/MetadataSource/SearchSeriesComparer.cs +++ b/src/NzbDrone.Core/MetadataSource/SearchSeriesComparer.cs @@ -12,12 +12,12 @@ public class SearchSeriesComparer : IComparer private static readonly Regex RegexCleanCountryYearPostfix = new Regex(@"(?<=.+)( \([A-Z]{2}\)| \(\d{4}\)| \([A-Z]{2}\) \(\d{4}\))$", RegexOptions.Compiled); private static readonly Regex ArticleRegex = new Regex(@"^(a|an|the)\s", RegexOptions.IgnoreCase | RegexOptions.Compiled); - public String SearchQuery { get; private set; } + public string SearchQuery { get; private set; } - private readonly String _searchQueryWithoutYear; - private Int32? _year; + private readonly string _searchQueryWithoutYear; + private int? _year; - public SearchSeriesComparer(String searchQuery) + public SearchSeriesComparer(string searchQuery) { SearchQuery = searchQuery; @@ -25,7 +25,7 @@ public SearchSeriesComparer(String searchQuery) if (match.Success) { _searchQueryWithoutYear = match.Groups["query"].Value.ToLowerInvariant(); - _year = Int32.Parse(match.Groups["year"].Value); + _year = int.Parse(match.Groups["year"].Value); } else { @@ -60,7 +60,7 @@ public int Compare(Series x, Series y) return Compare(x, y, s => SearchQuery.LevenshteinDistanceClean(s.Title) - GetYearFactor(s)); } - public Int32 Compare(Series x, Series y, Func keySelector) + public int Compare(Series x, Series y, Func keySelector) where T : IComparable { var keyX = keySelector(x); @@ -69,7 +69,7 @@ public Int32 Compare(Series x, Series y, Func keySelector) return keyX.CompareTo(keyY); } - public Int32 CompareWithYear(Series x, Series y, Predicate canMatch) + public int CompareWithYear(Series x, Series y, Predicate canMatch) { var matchX = canMatch(x); var matchY = canMatch(y); @@ -88,14 +88,14 @@ public Int32 CompareWithYear(Series x, Series y, Predicate canMatch) return matchX.CompareTo(matchY); } - private String CleanPunctuation(String title) + private string CleanPunctuation(string title) { title = RegexCleanPunctuation.Replace(title, ""); return title.ToLowerInvariant(); } - private String CleanTitle(String title) + private string CleanTitle(string title) { title = RegexCleanPunctuation.Replace(title, ""); title = RegexCleanCountryYearPostfix.Replace(title, ""); @@ -103,14 +103,14 @@ private String CleanTitle(String title) return title.ToLowerInvariant(); } - private String CleanArticles(String title) + private string CleanArticles(string title) { title = ArticleRegex.Replace(title, ""); return title.Trim().ToLowerInvariant(); } - private Int32 GetYearFactor(Series series) + private int GetYearFactor(Series series) { if (_year.HasValue) { diff --git a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs index 68754995e..7efdfe207 100644 --- a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs +++ b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs @@ -65,7 +65,7 @@ public List SearchForNewSeries(string title) int tvdbId; - if (slug.IsNullOrWhiteSpace() || slug.Any(char.IsWhiteSpace) || !Int32.TryParse(slug, out tvdbId) || tvdbId <= 0) + if (slug.IsNullOrWhiteSpace() || slug.Any(char.IsWhiteSpace) || !int.TryParse(slug, out tvdbId) || tvdbId <= 0) { return new List(); } diff --git a/src/NzbDrone.Core/Notifications/CustomScript/CustomScriptService.cs b/src/NzbDrone.Core/Notifications/CustomScript/CustomScriptService.cs index f33d892ff..964ba30d6 100644 --- a/src/NzbDrone.Core/Notifications/CustomScript/CustomScriptService.cs +++ b/src/NzbDrone.Core/Notifications/CustomScript/CustomScriptService.cs @@ -45,13 +45,13 @@ public void OnDownload(Series series, EpisodeFile episodeFile, string sourcePath environmentVariables.Add("Sonarr_EpisodeFile_RelativePath", episodeFile.RelativePath); environmentVariables.Add("Sonarr_EpisodeFile_Path", Path.Combine(series.Path, episodeFile.RelativePath)); environmentVariables.Add("Sonarr_EpisodeFile_SeasonNumber", episodeFile.SeasonNumber.ToString()); - environmentVariables.Add("Sonarr_EpisodeFile_EpisodeNumbers", String.Join(",", episodeFile.Episodes.Value.Select(e => e.EpisodeNumber))); - environmentVariables.Add("Sonarr_EpisodeFile_EpisodeAirDates", String.Join(",", episodeFile.Episodes.Value.Select(e => e.AirDate))); - environmentVariables.Add("Sonarr_EpisodeFile_EpisodeAirDatesUtc", String.Join(",", episodeFile.Episodes.Value.Select(e => e.AirDateUtc))); + environmentVariables.Add("Sonarr_EpisodeFile_EpisodeNumbers", string.Join(",", episodeFile.Episodes.Value.Select(e => e.EpisodeNumber))); + environmentVariables.Add("Sonarr_EpisodeFile_EpisodeAirDates", string.Join(",", episodeFile.Episodes.Value.Select(e => e.AirDate))); + environmentVariables.Add("Sonarr_EpisodeFile_EpisodeAirDatesUtc", string.Join(",", episodeFile.Episodes.Value.Select(e => e.AirDateUtc))); environmentVariables.Add("Sonarr_EpisodeFile_Quality", episodeFile.Quality.Quality.Name); environmentVariables.Add("Sonarr_EpisodeFile_QualityVersion", episodeFile.Quality.Revision.Version.ToString()); - environmentVariables.Add("Sonarr_EpisodeFile_ReleaseGroup", episodeFile.ReleaseGroup ?? String.Empty); - environmentVariables.Add("Sonarr_EpisodeFile_SceneName", episodeFile.SceneName ?? String.Empty); + environmentVariables.Add("Sonarr_EpisodeFile_ReleaseGroup", episodeFile.ReleaseGroup ?? string.Empty); + environmentVariables.Add("Sonarr_EpisodeFile_SceneName", episodeFile.SceneName ?? string.Empty); environmentVariables.Add("Sonarr_EpisodeFile_SourcePath", sourcePath); environmentVariables.Add("Sonarr_EpisodeFile_SourceFolder", Path.GetDirectoryName(sourcePath)); @@ -88,7 +88,7 @@ private void ExecuteScript(StringDictionary environmentVariables, CustomScriptSe var process = _processProvider.StartAndCapture(settings.Path, settings.Arguments, environmentVariables); _logger.Debug("Executed external script: {0} - Status: {1}", settings.Path, process.ExitCode); - _logger.Debug("Script Output: \r\n{0}", String.Join("\r\n", process.Lines)); + _logger.Debug("Script Output: \r\n{0}", string.Join("\r\n", process.Lines)); } } } diff --git a/src/NzbDrone.Core/Notifications/CustomScript/CustomScriptSettings.cs b/src/NzbDrone.Core/Notifications/CustomScript/CustomScriptSettings.cs index 55a317859..4227a10fb 100644 --- a/src/NzbDrone.Core/Notifications/CustomScript/CustomScriptSettings.cs +++ b/src/NzbDrone.Core/Notifications/CustomScript/CustomScriptSettings.cs @@ -20,10 +20,10 @@ public class CustomScriptSettings : IProviderConfig private static readonly CustomScriptSettingsValidator Validator = new CustomScriptSettingsValidator(); [FieldDefinition(0, Label = "Path", Type = FieldType.Path)] - public String Path { get; set; } + public string Path { get; set; } [FieldDefinition(1, Label = "Arguments", HelpText = "Arguments to pass to the script")] - public String Arguments { get; set; } + public string Arguments { get; set; } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Notifications/Email/Email.cs b/src/NzbDrone.Core/Notifications/Email/Email.cs index da265305d..bc49e6c71 100644 --- a/src/NzbDrone.Core/Notifications/Email/Email.cs +++ b/src/NzbDrone.Core/Notifications/Email/Email.cs @@ -23,7 +23,7 @@ public override string Link public override void OnGrab(GrabMessage grabMessage) { const string subject = "Sonarr [TV] - Grabbed"; - var body = String.Format("{0} sent to queue.", grabMessage.Message); + var body = string.Format("{0} sent to queue.", grabMessage.Message); _emailService.SendEmail(Settings, subject, body); } @@ -31,7 +31,7 @@ public override void OnGrab(GrabMessage grabMessage) public override void OnDownload(DownloadMessage message) { const string subject = "Sonarr [TV] - Downloaded"; - var body = String.Format("{0} Downloaded and sorted.", message.Message); + var body = string.Format("{0} Downloaded and sorted.", message.Message); _emailService.SendEmail(Settings, subject, body); } diff --git a/src/NzbDrone.Core/Notifications/Email/EmailService.cs b/src/NzbDrone.Core/Notifications/Email/EmailService.cs index cb4d2a578..d4cbd0e42 100644 --- a/src/NzbDrone.Core/Notifications/Email/EmailService.cs +++ b/src/NzbDrone.Core/Notifications/Email/EmailService.cs @@ -34,7 +34,7 @@ public void SendEmail(EmailSettings settings, string subject, string body, bool NetworkCredential credentials = null; - if (!String.IsNullOrWhiteSpace(settings.Username)) + if (!string.IsNullOrWhiteSpace(settings.Username)) credentials = new NetworkCredential(settings.Username, settings.Password); try diff --git a/src/NzbDrone.Core/Notifications/Email/EmailSettings.cs b/src/NzbDrone.Core/Notifications/Email/EmailSettings.cs index dabe966cf..1d649f2db 100644 --- a/src/NzbDrone.Core/Notifications/Email/EmailSettings.cs +++ b/src/NzbDrone.Core/Notifications/Email/EmailSettings.cs @@ -27,25 +27,25 @@ public EmailSettings() } [FieldDefinition(0, Label = "Server", HelpText = "Hostname or IP of Email server")] - public String Server { get; set; } + public string Server { get; set; } [FieldDefinition(1, Label = "Port")] - public Int32 Port { get; set; } + public int Port { get; set; } [FieldDefinition(2, Label = "SSL", Type = FieldType.Checkbox)] - public Boolean Ssl { get; set; } + public bool Ssl { get; set; } [FieldDefinition(3, Label = "Username")] - public String Username { get; set; } + public string Username { get; set; } [FieldDefinition(4, Label = "Password", Type = FieldType.Password)] - public String Password { get; set; } + public string Password { get; set; } [FieldDefinition(5, Label = "From Address")] - public String From { get; set; } + public string From { get; set; } [FieldDefinition(6, Label = "Recipient Address")] - public String To { get; set; } + public string To { get; set; } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Notifications/GrabMessage.cs b/src/NzbDrone.Core/Notifications/GrabMessage.cs index 13c287468..6984040ae 100644 --- a/src/NzbDrone.Core/Notifications/GrabMessage.cs +++ b/src/NzbDrone.Core/Notifications/GrabMessage.cs @@ -9,7 +9,7 @@ namespace NzbDrone.Core.Notifications { public class GrabMessage { - public String Message { get; set; } + public string Message { get; set; } public Series Series { get; set; } public RemoteEpisode Episode { get; set; } public QualityModel Quality { get; set; } diff --git a/src/NzbDrone.Core/Notifications/Growl/GrowlSettings.cs b/src/NzbDrone.Core/Notifications/Growl/GrowlSettings.cs index a9a80f766..a6cab3db9 100644 --- a/src/NzbDrone.Core/Notifications/Growl/GrowlSettings.cs +++ b/src/NzbDrone.Core/Notifications/Growl/GrowlSettings.cs @@ -25,13 +25,13 @@ public GrowlSettings() } [FieldDefinition(0, Label = "Host")] - public String Host { get; set; } + public string Host { get; set; } [FieldDefinition(1, Label = "Port")] - public Int32 Port { get; set; } + public int Port { get; set; } [FieldDefinition(2, Label = "Password")] - public String Password { get; set; } + public string Password { get; set; } public bool IsValid { diff --git a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserProxy.cs b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserProxy.cs index 1b7553e7c..80bdf5e2a 100644 --- a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserProxy.cs +++ b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserProxy.cs @@ -34,15 +34,15 @@ public void Notify(MediaBrowserSettings settings, string title, string message) ProcessRequest(request, settings); } - public void Update(MediaBrowserSettings settings, Int32 tvdbId) + public void Update(MediaBrowserSettings settings, int tvdbId) { - var path = String.Format("/Library/Series/Updated?tvdbid={0}", tvdbId); + var path = string.Format("/Library/Series/Updated?tvdbid={0}", tvdbId); var request = BuildRequest(path, settings); ProcessRequest(request, settings); } - private String ProcessRequest(HttpRequest request, MediaBrowserSettings settings) + private string ProcessRequest(HttpRequest request, MediaBrowserSettings settings) { request.Headers.Add("X-MediaBrowser-Token", settings.ApiKey); @@ -56,7 +56,7 @@ private String ProcessRequest(HttpRequest request, MediaBrowserSettings settings private HttpRequest BuildRequest(string path, MediaBrowserSettings settings) { - var url = String.Format(@"http://{0}/mediabrowser", settings.Address); + var url = string.Format(@"http://{0}/mediabrowser", settings.Address); return new HttpRequestBuilder(url).Build(path); } diff --git a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserService.cs b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserService.cs index 905ba70ee..64867d926 100644 --- a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserService.cs +++ b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserService.cs @@ -9,7 +9,7 @@ namespace NzbDrone.Core.Notifications.MediaBrowser { public interface IMediaBrowserService { - void Notify(MediaBrowserSettings settings, String title, String message); + void Notify(MediaBrowserSettings settings, string title, string message); void Update(MediaBrowserSettings settings, Series series); ValidationFailure Test(MediaBrowserSettings settings); } @@ -25,7 +25,7 @@ public MediaBrowserService(MediaBrowserProxy proxy, Logger logger) _logger = logger; } - public void Notify(MediaBrowserSettings settings, String title, String message) + public void Notify(MediaBrowserSettings settings, string title, string message) { _proxy.Notify(settings, title, message); } diff --git a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserSettings.cs b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserSettings.cs index f89655aff..f80800b40 100644 --- a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserSettings.cs +++ b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserSettings.cs @@ -26,22 +26,22 @@ public MediaBrowserSettings() } [FieldDefinition(0, Label = "Host")] - public String Host { get; set; } + public string Host { get; set; } [FieldDefinition(1, Label = "Port")] - public Int32 Port { get; set; } + public int Port { get; set; } [FieldDefinition(2, Label = "API Key")] - public String ApiKey { get; set; } + public string ApiKey { get; set; } [FieldDefinition(3, Label = "Send Notifications", HelpText = "Have MediaBrowser send notfications to configured providers", Type = FieldType.Checkbox)] - public Boolean Notify { get; set; } + public bool Notify { get; set; } [FieldDefinition(4, Label = "Update Library", HelpText = "Update Library on Download & Rename?", Type = FieldType.Checkbox)] - public Boolean UpdateLibrary { get; set; } + public bool UpdateLibrary { get; set; } [JsonIgnore] - public String Address { get { return String.Format("{0}:{1}", Host, Port); } } + public string Address { get { return string.Format("{0}:{1}", Host, Port); } } public bool IsValid { diff --git a/src/NzbDrone.Core/Notifications/NotificationDefinition.cs b/src/NzbDrone.Core/Notifications/NotificationDefinition.cs index 1c0bbb9b3..df1b89e0e 100644 --- a/src/NzbDrone.Core/Notifications/NotificationDefinition.cs +++ b/src/NzbDrone.Core/Notifications/NotificationDefinition.cs @@ -8,7 +8,7 @@ public class NotificationDefinition : ProviderDefinition { public NotificationDefinition() { - Tags = new HashSet(); + Tags = new HashSet(); } public bool OnGrab { get; set; } diff --git a/src/NzbDrone.Core/Notifications/NotificationService.cs b/src/NzbDrone.Core/Notifications/NotificationService.cs index d3affaf4c..007b65ef3 100644 --- a/src/NzbDrone.Core/Notifications/NotificationService.cs +++ b/src/NzbDrone.Core/Notifications/NotificationService.cs @@ -47,19 +47,19 @@ private string GetMessage(Series series, List episodes, QualityModel qu { var episode = episodes.First(); - return String.Format("{0} - {1} - {2} [{3}]", + return string.Format("{0} - {1} - {2} [{3}]", series.Title, episode.AirDate, episode.Title, qualityString); } - var episodeNumbers = String.Concat(episodes.Select(e => e.EpisodeNumber) - .Select(i => String.Format("x{0:00}", i))); + var episodeNumbers = string.Concat(episodes.Select(e => e.EpisodeNumber) + .Select(i => string.Format("x{0:00}", i))); - var episodeTitles = String.Join(" + ", episodes.Select(e => e.Title)); + var episodeTitles = string.Join(" + ", episodes.Select(e => e.Title)); - return String.Format("{0} - {1}{2} - {3} [{4}]", + return string.Format("{0} - {1}{2} - {3} [{4}]", series.Title, episodes.First().SeasonNumber, episodeNumbers, diff --git a/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidSettings.cs b/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidSettings.cs index 445f366ef..f8b99cfa1 100644 --- a/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidSettings.cs +++ b/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidSettings.cs @@ -19,16 +19,16 @@ public class NotifyMyAndroidSettings : IProviderConfig private static readonly NotifyMyAndroidSettingsValidator Validator = new NotifyMyAndroidSettingsValidator(); [FieldDefinition(0, Label = "API Key", HelpLink = "http://www.notifymyandroid.com/")] - public String ApiKey { get; set; } + public string ApiKey { get; set; } [FieldDefinition(1, Label = "Priority", Type = FieldType.Select, SelectOptions = typeof(NotifyMyAndroidPriority))] - public Int32 Priority { get; set; } + public int Priority { get; set; } public bool IsValid { get { - return !String.IsNullOrWhiteSpace(ApiKey) && Priority >= -1 && Priority <= 2; + return !string.IsNullOrWhiteSpace(ApiKey) && Priority >= -1 && Priority <= 2; } } diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexClientService.cs b/src/NzbDrone.Core/Notifications/Plex/PlexClientService.cs index fd17f8fa2..e73b30568 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexClientService.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexClientService.cs @@ -30,7 +30,7 @@ public void Notify(PlexClientSettings settings, string header, string message) { try { - var command = String.Format("ExecBuiltIn(Notification({0}, {1}))", header, message); + var command = string.Format("ExecBuiltIn(Notification({0}, {1}))", header, message); SendCommand(settings.Host, settings.Port, command, settings.Username, settings.Password); } catch(Exception ex) @@ -41,9 +41,9 @@ public void Notify(PlexClientSettings settings, string header, string message) private string SendCommand(string host, int port, string command, string username, string password) { - var url = String.Format("http://{0}:{1}/xbmcCmds/xbmcHttp?command={2}", host, port, command); + var url = string.Format("http://{0}:{1}/xbmcCmds/xbmcHttp?command={2}", host, port, command); - if (!String.IsNullOrEmpty(username)) + if (!string.IsNullOrEmpty(username)) { return _httpProvider.DownloadString(url, username, password); } @@ -56,10 +56,10 @@ public ValidationFailure Test(PlexClientSettings settings) try { _logger.Debug("Sending Test Notifcation to Plex Client: {0}", settings.Host); - var command = String.Format("ExecBuiltIn(Notification({0}, {1}))", "Test Notification", "Success! Notifications are setup correctly"); + var command = string.Format("ExecBuiltIn(Notification({0}, {1}))", "Test Notification", "Success! Notifications are setup correctly"); var result = SendCommand(settings.Host, settings.Port, command, settings.Username, settings.Password); - if (String.IsNullOrWhiteSpace(result) || + if (string.IsNullOrWhiteSpace(result) || result.IndexOf("error", StringComparison.InvariantCultureIgnoreCase) > -1) { throw new Exception("Unable to connect to Plex Client"); diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexClientSettings.cs b/src/NzbDrone.Core/Notifications/Plex/PlexClientSettings.cs index a36f08152..e1b1e0499 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexClientSettings.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexClientSettings.cs @@ -25,16 +25,16 @@ public PlexClientSettings() } [FieldDefinition(0, Label = "Host")] - public String Host { get; set; } + public string Host { get; set; } [FieldDefinition(1, Label = "Port")] - public Int32 Port { get; set; } + public int Port { get; set; } [FieldDefinition(2, Label = "Username")] - public String Username { get; set; } + public string Username { get; set; } [FieldDefinition(3, Label = "Password")] - public String Password { get; set; } + public string Password { get; set; } public bool IsValid { diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexError.cs b/src/NzbDrone.Core/Notifications/Plex/PlexError.cs index 78e733050..2cec36a88 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexError.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexError.cs @@ -4,6 +4,6 @@ namespace NzbDrone.Core.Notifications.Plex { public class PlexError { - public String Error { get; set; } + public string Error { get; set; } } } diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexHomeTheater.cs b/src/NzbDrone.Core/Notifications/Plex/PlexHomeTheater.cs index e5df63a87..43819b5ed 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexHomeTheater.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexHomeTheater.cs @@ -80,7 +80,7 @@ private void Notify(XbmcSettings settings, string header, string message) } catch (SocketException ex) { - var logMessage = String.Format("Unable to connect to PHT Host: {0}:{1}", Settings.Host, Settings.Port); + var logMessage = string.Format("Unable to connect to PHT Host: {0}:{1}", Settings.Host, Settings.Port); _logger.DebugException(logMessage, ex); } } diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexHomeTheaterSettings.cs b/src/NzbDrone.Core/Notifications/Plex/PlexHomeTheaterSettings.cs index ec4f197ef..fe958b0f6 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexHomeTheaterSettings.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexHomeTheaterSettings.cs @@ -15,21 +15,21 @@ public PlexHomeTheaterSettings() //These need to be kept in the same order as XBMC Settings, but we don't want them displayed [FieldDefinition(2, Label = "Username", Type = FieldType.Hidden)] - public String Username { get; set; } + public string Username { get; set; } [FieldDefinition(3, Label = "Password", Type = FieldType.Hidden)] - public String Password { get; set; } + public string Password { get; set; } [FieldDefinition(5, Label = "GUI Notification", Type = FieldType.Hidden)] - public Boolean Notify { get; set; } + public bool Notify { get; set; } [FieldDefinition(6, Label = "Update Library", HelpText = "Update Library on Download & Rename?", Type = FieldType.Hidden)] - public Boolean UpdateLibrary { get; set; } + public bool UpdateLibrary { get; set; } [FieldDefinition(7, Label = "Clean Library", HelpText = "Clean Library after update?", Type = FieldType.Hidden)] - public Boolean CleanLibrary { get; set; } + public bool CleanLibrary { get; set; } [FieldDefinition(8, Label = "Always Update", HelpText = "Update Library even when a video is playing?", Type = FieldType.Hidden)] - public Boolean AlwaysUpdate { get; set; } + public bool AlwaysUpdate { get; set; } } } diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs b/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs index 6aa8124c1..ad9abb3a0 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexServerProxy.cs @@ -26,12 +26,12 @@ public interface IPlexServerProxy public class PlexServerProxy : IPlexServerProxy { - private readonly ICached _authCache; + private readonly ICached _authCache; private readonly Logger _logger; public PlexServerProxy(ICacheManager cacheManager, Logger logger) { - _authCache = cacheManager.GetCache(GetType(), "authCache"); + _authCache = cacheManager.GetCache(GetType(), "authCache"); _logger = logger; } @@ -52,7 +52,7 @@ public List GetTvSections(PlexServerSettings settings) public void Update(int sectionId, PlexServerSettings settings) { - var resource = String.Format("library/sections/{0}/refresh", sectionId); + var resource = string.Format("library/sections/{0}/refresh", sectionId); var request = GetPlexServerRequest(resource, Method.GET, settings); var client = GetPlexServerClient(settings); var response = client.Execute(request); @@ -63,7 +63,7 @@ public void Update(int sectionId, PlexServerSettings settings) public void UpdateSeries(int metadataId, PlexServerSettings settings) { - var resource = String.Format("library/metadata/{0}/refresh", metadataId); + var resource = string.Format("library/metadata/{0}/refresh", metadataId); var request = GetPlexServerRequest(resource, Method.PUT, settings); var client = GetPlexServerClient(settings); var response = client.Execute(request); @@ -98,8 +98,8 @@ public List Preferences(PlexServerSettings settings) public int? GetMetadataId(int sectionId, int tvdbId, string language, PlexServerSettings settings) { - var guid = String.Format("com.plexapp.agents.thetvdb://{0}?lang={1}", tvdbId, language); - var resource = String.Format("library/sections/{0}/all?guid={1}", sectionId, System.Web.HttpUtility.UrlEncode(guid)); + var guid = string.Format("com.plexapp.agents.thetvdb://{0}?lang={1}", tvdbId, language); + var resource = string.Format("library/sections/{0}/all?guid={1}", sectionId, System.Web.HttpUtility.UrlEncode(guid)); var request = GetPlexServerRequest(resource, Method.GET, settings); var client = GetPlexServerClient(settings); var response = client.Execute(request); @@ -119,7 +119,7 @@ public List Preferences(PlexServerSettings settings) return item.Id; } - private String Authenticate(PlexServerSettings settings) + private string Authenticate(PlexServerSettings settings) { var request = GetMyPlexRequest("users/sign_in.json", Method.POST); var client = GetMyPlexClient(settings.Username, settings.Password); @@ -160,7 +160,7 @@ private RestClient GetPlexServerClient(PlexServerSettings settings) { var protocol = settings.UseSsl ? "https" : "http"; - return RestClientFactory.BuildClient(String.Format("{0}://{1}:{2}", protocol, settings.Host, settings.Port)); + return RestClientFactory.BuildClient(string.Format("{0}://{1}:{2}", protocol, settings.Host, settings.Port)); } private RestRequest GetPlexServerRequest(string resource, Method method, PlexServerSettings settings) diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexServerSettings.cs b/src/NzbDrone.Core/Notifications/Plex/PlexServerSettings.cs index 7025d5148..a36e23aac 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexServerSettings.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexServerSettings.cs @@ -25,23 +25,23 @@ public PlexServerSettings() } [FieldDefinition(0, Label = "Host")] - public String Host { get; set; } + public string Host { get; set; } [FieldDefinition(1, Label = "Port")] - public Int32 Port { get; set; } + public int Port { get; set; } //TODO: Change username and password to token and get a plex.tv OAuth token properly [FieldDefinition(2, Label = "Username")] - public String Username { get; set; } + public string Username { get; set; } [FieldDefinition(3, Label = "Password", Type = FieldType.Password)] - public String Password { get; set; } + public string Password { get; set; } [FieldDefinition(4, Label = "Update Library", Type = FieldType.Checkbox)] - public Boolean UpdateLibrary { get; set; } + public bool UpdateLibrary { get; set; } [FieldDefinition(5, Label = "Use SSL", Type = FieldType.Checkbox, HelpText = "Connect to Plex over HTTPS instead of HTTP")] - public Boolean UseSsl { get; set; } + public bool UseSsl { get; set; } public bool IsValid { diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexUser.cs b/src/NzbDrone.Core/Notifications/Plex/PlexUser.cs index 4ca9a642a..4e6a8285a 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexUser.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexUser.cs @@ -6,6 +6,6 @@ namespace NzbDrone.Core.Notifications.Plex public class PlexUser { [JsonProperty("authentication_token")] - public String AuthenticationToken { get; set; } + public string AuthenticationToken { get; set; } } } diff --git a/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs b/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs index 798d7baf9..fbbbd9c84 100644 --- a/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs +++ b/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs @@ -41,7 +41,7 @@ public void SendNotification(string title, string message, string apiKey, Notifi var notificationResult = client.SendNotification(notification); - if (!String.IsNullOrWhiteSpace(notificationResult.ErrorMessage)) + if (!string.IsNullOrWhiteSpace(notificationResult.ErrorMessage)) { throw new InvalidApiKeyException("API Key: " + apiKey + " is invalid"); } @@ -66,7 +66,7 @@ public void Verify(string apiKey) _logger.Debug("Verifying API Key: {0}", apiKey); var verificationResult = client.SendVerification(verificationRequest); - if (!String.IsNullOrWhiteSpace(verificationResult.ErrorMessage) && + if (!string.IsNullOrWhiteSpace(verificationResult.ErrorMessage) && verificationResult.ResultCode != "200") { throw new InvalidApiKeyException("API Key: " + apiKey + " is invalid"); diff --git a/src/NzbDrone.Core/Notifications/Prowl/ProwlSettings.cs b/src/NzbDrone.Core/Notifications/Prowl/ProwlSettings.cs index b07fe27b8..b6cd2ae2e 100644 --- a/src/NzbDrone.Core/Notifications/Prowl/ProwlSettings.cs +++ b/src/NzbDrone.Core/Notifications/Prowl/ProwlSettings.cs @@ -19,10 +19,10 @@ public class ProwlSettings : IProviderConfig private static readonly ProwlSettingsValidator Validator = new ProwlSettingsValidator(); [FieldDefinition(0, Label = "API Key", HelpLink = "https://www.prowlapp.com/api_settings.php")] - public String ApiKey { get; set; } + public string ApiKey { get; set; } [FieldDefinition(1, Label = "Priority", Type = FieldType.Select, SelectOptions= typeof(ProwlPriority) )] - public Int32 Priority { get; set; } + public int Priority { get; set; } public bool IsValid { diff --git a/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs b/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs index 1bb07efd9..98f3b2d3d 100644 --- a/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs +++ b/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs @@ -120,7 +120,7 @@ private RestRequest BuildDeviceRequest(string deviceId) var request = new RestRequest(Method.POST); long integerId; - if (Int64.TryParse(deviceId, out integerId)) + if (long.TryParse(deviceId, out integerId)) { request.AddParameter("device_id", integerId); } @@ -151,7 +151,7 @@ private void SendNotification(string title, string message, RestRequest request, request.AddParameter("title", title); request.AddParameter("body", message); - client.Authenticator = new HttpBasicAuthenticator(settings.ApiKey, String.Empty); + client.Authenticator = new HttpBasicAuthenticator(settings.ApiKey, string.Empty); client.ExecuteAndValidate(request); } catch (RestException ex) diff --git a/src/NzbDrone.Core/Notifications/Pushalot/PushalotProxy.cs b/src/NzbDrone.Core/Notifications/Pushalot/PushalotProxy.cs index 6428de89f..7919cf1ac 100644 --- a/src/NzbDrone.Core/Notifications/Pushalot/PushalotProxy.cs +++ b/src/NzbDrone.Core/Notifications/Pushalot/PushalotProxy.cs @@ -10,7 +10,7 @@ namespace NzbDrone.Core.Notifications.Pushalot { public interface IPushalotProxy { - void SendNotification(String title, String message, PushalotSettings settings); + void SendNotification(string title, string message, PushalotSettings settings); ValidationFailure Test(PushalotSettings settings); } @@ -24,7 +24,7 @@ public PushalotProxy(Logger logger) _logger = logger; } - public void SendNotification(String title, String message, PushalotSettings settings) + public void SendNotification(string title, string message, PushalotSettings settings) { var client = RestClientFactory.BuildClient(URL); var request = BuildRequest(); diff --git a/src/NzbDrone.Core/Notifications/Pushalot/PushalotResponse.cs b/src/NzbDrone.Core/Notifications/Pushalot/PushalotResponse.cs index f98807a5a..dce22de25 100644 --- a/src/NzbDrone.Core/Notifications/Pushalot/PushalotResponse.cs +++ b/src/NzbDrone.Core/Notifications/Pushalot/PushalotResponse.cs @@ -4,8 +4,8 @@ namespace NzbDrone.Core.Notifications.Pushalot { public class PushalotResponse { - public Boolean Success { get; set; } - public Int32 Status { get; set; } - public String Description { get; set; } + public bool Success { get; set; } + public int Status { get; set; } + public string Description { get; set; } } } diff --git a/src/NzbDrone.Core/Notifications/Pushalot/PushalotSettings.cs b/src/NzbDrone.Core/Notifications/Pushalot/PushalotSettings.cs index ffa11acac..8112a224f 100644 --- a/src/NzbDrone.Core/Notifications/Pushalot/PushalotSettings.cs +++ b/src/NzbDrone.Core/Notifications/Pushalot/PushalotSettings.cs @@ -36,7 +36,7 @@ public bool IsValid { get { - return !String.IsNullOrWhiteSpace(AuthToken); + return !string.IsNullOrWhiteSpace(AuthToken); } } diff --git a/src/NzbDrone.Core/Notifications/Pushover/PushoverSettings.cs b/src/NzbDrone.Core/Notifications/Pushover/PushoverSettings.cs index b3533ed24..b4ec11d13 100644 --- a/src/NzbDrone.Core/Notifications/Pushover/PushoverSettings.cs +++ b/src/NzbDrone.Core/Notifications/Pushover/PushoverSettings.cs @@ -25,16 +25,16 @@ public PushoverSettings() //TODO: Get Pushover to change our app name (or create a new app) when we have a new logo [FieldDefinition(0, Label = "API Key", HelpLink = "https://pushover.net/apps/clone/nzbdrone")] - public String ApiKey { get; set; } + public string ApiKey { get; set; } [FieldDefinition(1, Label = "User Key", HelpLink = "https://pushover.net/")] - public String UserKey { get; set; } + public string UserKey { get; set; } [FieldDefinition(2, Label = "Priority", Type = FieldType.Select, SelectOptions = typeof(PushoverPriority) )] - public Int32 Priority { get; set; } + public int Priority { get; set; } [FieldDefinition(3, 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 string Sound { get; set; } public bool IsValid { diff --git a/src/NzbDrone.Core/Notifications/Synology/SynologyIndexerSettings.cs b/src/NzbDrone.Core/Notifications/Synology/SynologyIndexerSettings.cs index b1c14ba82..3b0c82143 100644 --- a/src/NzbDrone.Core/Notifications/Synology/SynologyIndexerSettings.cs +++ b/src/NzbDrone.Core/Notifications/Synology/SynologyIndexerSettings.cs @@ -25,7 +25,7 @@ public SynologyIndexerSettings() } [FieldDefinition(0, Label = "Update Library", Type = FieldType.Checkbox, HelpText = "Call synoindex on localhost to update a library file")] - public Boolean UpdateLibrary { get; set; } + public bool UpdateLibrary { get; set; } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Notifications/Twitter/TwitterService.cs b/src/NzbDrone.Core/Notifications/Twitter/TwitterService.cs index 3675b9da2..f08191eee 100644 --- a/src/NzbDrone.Core/Notifications/Twitter/TwitterService.cs +++ b/src/NzbDrone.Core/Notifications/Twitter/TwitterService.cs @@ -64,7 +64,7 @@ public string GetOAuthRedirect(string callbackUrl) oAuthRequest.RequestUrl = "https://api.twitter.com/oauth/request_token"; var qscoll = OAuthQuery(oAuthRequest); - return String.Format("https://api.twitter.com/oauth/authorize?oauth_token={0}", qscoll["oauth_token"]); + return string.Format("https://api.twitter.com/oauth/authorize?oauth_token={0}", qscoll["oauth_token"]); } public void SendNotification(string message, TwitterSettings settings) @@ -90,7 +90,7 @@ public void SendNotification(string message, TwitterSettings settings) { if (settings.Mention.IsNotNullOrWhiteSpace()) { - message += String.Format(" @{0}", settings.Mention); + message += string.Format(" @{0}", settings.Mention); } twitter.UpdateStatus(message); diff --git a/src/NzbDrone.Core/Notifications/Webhook/WebhookSettings.cs b/src/NzbDrone.Core/Notifications/Webhook/WebhookSettings.cs index f1584e16a..185c47d7d 100644 --- a/src/NzbDrone.Core/Notifications/Webhook/WebhookSettings.cs +++ b/src/NzbDrone.Core/Notifications/Webhook/WebhookSettings.cs @@ -28,7 +28,7 @@ public WebhookSettings() public string Url { get; set; } [FieldDefinition(1, Label = "Method", Type = FieldType.Select, SelectOptions = typeof(WebhookMethod), HelpText = "Which HTTP method to use submit to the Webservice")] - public Int32 Method { get; set; } + public int Method { get; set; } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs b/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs index dba2cbd0e..e84566635 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs @@ -28,7 +28,7 @@ public bool CanHandle(XbmcVersion version) public void Notify(XbmcSettings settings, string title, string message) { - var notification = String.Format("Notification({0},{1},{2},{3})", title, message, settings.DisplayTime * 1000, "https://raw.github.com/Sonarr/Sonarr/develop/Logo/64.png"); + var notification = string.Format("Notification({0},{1},{2},{3})", title, message, settings.DisplayTime * 1000, "https://raw.github.com/Sonarr/Sonarr/develop/Logo/64.png"); var command = BuildExecBuiltInCommand(notification); SendCommand(settings, command); @@ -83,10 +83,10 @@ internal List GetActivePlayers(XbmcSettings settings) internal string GetSeriesPath(XbmcSettings settings, Series series) { var query = - String.Format( + string.Format( "select path.strPath from path, tvshow, tvshowlinkpath where tvshow.c12 = {0} and tvshowlinkpath.idShow = tvshow.idShow and tvshowlinkpath.idPath = path.idPath", series.TvdbId); - var command = String.Format("QueryVideoDatabase({0})", query); + var command = string.Format("QueryVideoDatabase({0})", query); const string setResponseCommand = "SetResponseFormat(webheader;false;webfooter;false;header;;footer;;opentag;;closetag;;closefinaltag;false)"; @@ -96,8 +96,8 @@ internal string GetSeriesPath(XbmcSettings settings, Series series) var response = SendCommand(settings, command); SendCommand(settings, resetResponseCommand); - if (String.IsNullOrEmpty(response)) - return String.Empty; + if (string.IsNullOrEmpty(response)) + return string.Empty; var xDoc = XDocument.Load(new StringReader(response.Replace("&", "&"))); var xml = xDoc.Descendants("xml").Select(x => x).FirstOrDefault(); @@ -117,7 +117,7 @@ internal bool CheckForError(string response) { _logger.Debug("Looking for error in response: {0}", response); - if (String.IsNullOrWhiteSpace(response)) + if (string.IsNullOrWhiteSpace(response)) { _logger.Debug("Invalid response from XBMC, the response is not valid JSON"); return true; @@ -145,10 +145,10 @@ private void UpdateLibrary(XbmcSettings settings, Series series) var xbmcSeriesPath = GetSeriesPath(settings, series); //If the path is found update it, else update the whole library - if (!String.IsNullOrEmpty(xbmcSeriesPath)) + if (!string.IsNullOrEmpty(xbmcSeriesPath)) { _logger.Debug("Updating series [{0}] on XBMC host: {1}", series, settings.Address); - var command = BuildExecBuiltInCommand(String.Format("UpdateLibrary(video,{0})", xbmcSeriesPath)); + var command = BuildExecBuiltInCommand(string.Format("UpdateLibrary(video,{0})", xbmcSeriesPath)); SendCommand(settings, command); } @@ -169,9 +169,9 @@ private void UpdateLibrary(XbmcSettings settings, Series series) private string SendCommand(XbmcSettings settings, string command) { - var url = String.Format("http://{0}/xbmcCmds/xbmcHttp?command={1}", settings.Address, command); + var url = string.Format("http://{0}/xbmcCmds/xbmcHttp?command={1}", settings.Address, command); - if (!String.IsNullOrEmpty(settings.Username)) + if (!string.IsNullOrEmpty(settings.Username)) { return _httpProvider.DownloadString(url, settings.Username, settings.Password); } @@ -181,7 +181,7 @@ private string SendCommand(XbmcSettings settings, string command) private string BuildExecBuiltInCommand(string command) { - return String.Format("ExecBuiltIn({0})", command); + return string.Format("ExecBuiltIn({0})", command); } } } diff --git a/src/NzbDrone.Core/Notifications/Xbmc/JsonApiProvider.cs b/src/NzbDrone.Core/Notifications/Xbmc/JsonApiProvider.cs index 077eed962..3651b927a 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/JsonApiProvider.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/JsonApiProvider.cs @@ -55,7 +55,7 @@ public List GetActivePlayers(XbmcSettings settings) return _proxy.GetActivePlayers(settings); } - public String GetSeriesPath(XbmcSettings settings, Series series) + public string GetSeriesPath(XbmcSettings settings, Series series) { var allSeries = _proxy.GetSeries(settings); @@ -68,7 +68,7 @@ public String GetSeriesPath(XbmcSettings settings, Series series) var matchingSeries = allSeries.FirstOrDefault(s => { var tvdbId = 0; - Int32.TryParse(s.ImdbNumber, out tvdbId); + int.TryParse(s.ImdbNumber, out tvdbId); return tvdbId == series.TvdbId || s.Label == series.Title; }); diff --git a/src/NzbDrone.Core/Notifications/Xbmc/Model/XbmcVersion.cs b/src/NzbDrone.Core/Notifications/Xbmc/Model/XbmcVersion.cs index 14c7c892d..c4fc4358e 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/Model/XbmcVersion.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/Model/XbmcVersion.cs @@ -54,7 +54,7 @@ public int CompareTo(XbmcVersion other) public static bool operator ==(XbmcVersion x, XbmcVersion y) { - var xObj = (Object)x; + var xObj = (object)x; var yObj = (object)y; if (xObj == null || yObj == null) @@ -87,7 +87,7 @@ public int CompareTo(XbmcVersion other) public override string ToString() { - return String.Format("{0}.{1}.{2}", Major, Minor, Patch); + return string.Format("{0}.{1}.{2}", Major, Minor, Patch); } public override int GetHashCode() diff --git a/src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs b/src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs index 08602b8d4..9d1b0157d 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs @@ -73,7 +73,7 @@ private void Notify(XbmcSettings settings, string header, string message) } catch (SocketException ex) { - var logMessage = String.Format("Unable to connect to XBMC Host: {0}:{1}", Settings.Host, Settings.Port); + var logMessage = string.Format("Unable to connect to XBMC Host: {0}:{1}", Settings.Host, Settings.Port); _logger.DebugException(logMessage, ex); } } @@ -94,7 +94,7 @@ private void UpdateAndClean(Series series, bool clean = true) } catch (SocketException ex) { - var logMessage = String.Format("Unable to connect to XBMC Host: {0}:{1}", Settings.Host, Settings.Port); + var logMessage = string.Format("Unable to connect to XBMC Host: {0}:{1}", Settings.Host, Settings.Port); _logger.DebugException(logMessage, ex); } } diff --git a/src/NzbDrone.Core/Notifications/Xbmc/XbmcJsonApiProxy.cs b/src/NzbDrone.Core/Notifications/Xbmc/XbmcJsonApiProxy.cs index c45875c35..bb4445f0b 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/XbmcJsonApiProxy.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/XbmcJsonApiProxy.cs @@ -11,9 +11,9 @@ namespace NzbDrone.Core.Notifications.Xbmc { public interface IXbmcJsonApiProxy { - String GetJsonVersion(XbmcSettings settings); - void Notify(XbmcSettings settings, String title, String message); - String UpdateLibrary(XbmcSettings settings, String path); + string GetJsonVersion(XbmcSettings settings); + void Notify(XbmcSettings settings, string title, string message); + string UpdateLibrary(XbmcSettings settings, string path); void CleanLibrary(XbmcSettings settings); List GetActivePlayers(XbmcSettings settings); List GetSeries(XbmcSettings settings); @@ -28,17 +28,17 @@ public XbmcJsonApiProxy(Logger logger) _logger = logger; } - public String GetJsonVersion(XbmcSettings settings) + public string GetJsonVersion(XbmcSettings settings) { var request = new RestRequest(); return ProcessRequest(request, settings, "JSONRPC.Version"); } - public void Notify(XbmcSettings settings, String title, String message) + public void Notify(XbmcSettings settings, string title, string message) { var request = new RestRequest(); - var parameters = new Dictionary(); + var parameters = new Dictionary(); parameters.Add("title", title); parameters.Add("message", message); parameters.Add("image", "https://raw.github.com/Sonarr/Sonarr/develop/Logo/64.png"); @@ -47,10 +47,10 @@ public void Notify(XbmcSettings settings, String title, String message) ProcessRequest(request, settings, "GUI.ShowNotification", parameters); } - public String UpdateLibrary(XbmcSettings settings, String path) + public string UpdateLibrary(XbmcSettings settings, string path) { var request = new RestRequest(); - var parameters = new Dictionary(); + var parameters = new Dictionary(); parameters.Add("directory", path); if (path.IsNullOrWhiteSpace()) @@ -60,7 +60,7 @@ public String UpdateLibrary(XbmcSettings settings, String path) var response = ProcessRequest(request, settings, "VideoLibrary.Scan", parameters); - return Json.Deserialize>(response).Result; + return Json.Deserialize>(response).Result; } public void CleanLibrary(XbmcSettings settings) @@ -82,7 +82,7 @@ public List GetActivePlayers(XbmcSettings settings) public List GetSeries(XbmcSettings settings) { var request = new RestRequest(); - var parameters = new Dictionary(); + var parameters = new Dictionary(); parameters.Add("properties", new[] { "file", "imdbnumber" }); var response = ProcessRequest(request, settings, "VideoLibrary.GetTvShows", parameters); @@ -90,7 +90,7 @@ public List GetSeries(XbmcSettings settings) return Json.Deserialize(response).Result.TvShows; } - private String ProcessRequest(IRestRequest request, XbmcSettings settings, String method, Dictionary parameters = null) + private string ProcessRequest(IRestRequest request, XbmcSettings settings, string method, Dictionary parameters = null) { var client = BuildClient(settings); @@ -109,7 +109,7 @@ private String ProcessRequest(IRestRequest request, XbmcSettings settings, Strin private IRestClient BuildClient(XbmcSettings settings) { - var url = String.Format(@"http://{0}/jsonrpc", settings.Address); + var url = string.Format(@"http://{0}/jsonrpc", settings.Address); var client = RestClientFactory.BuildClient(url); if (!settings.Username.IsNullOrWhiteSpace()) @@ -124,7 +124,7 @@ private void CheckForError(IRestResponse response) { _logger.Debug("Looking for error in response: {0}", response); - if (String.IsNullOrWhiteSpace(response.Content)) + if (string.IsNullOrWhiteSpace(response.Content)) { throw new XbmcJsonException("Invalid response from XBMC, the response is not valid JSON"); } @@ -135,7 +135,7 @@ private void CheckForError(IRestResponse response) var code = error.Error["code"]; var message = error.Error["message"]; - var errorMessage = String.Format("XBMC Json Error. Code = {0}, Message: {1}", code, message); + var errorMessage = string.Format("XBMC Json Error. Code = {0}, Message: {1}", code, message); throw new XbmcJsonException(errorMessage); } } diff --git a/src/NzbDrone.Core/Notifications/Xbmc/XbmcService.cs b/src/NzbDrone.Core/Notifications/Xbmc/XbmcService.cs index 783cd16a8..9dc913929 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/XbmcService.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/XbmcService.cs @@ -94,7 +94,7 @@ private IApiProvider GetApiProvider(XbmcSettings settings) if (apiProvider == null) { - var message = String.Format("Invalid API Version: {0} for {1}", version, settings.Address); + var message = string.Format("Invalid API Version: {0} for {1}", version, settings.Address); throw new InvalidXbmcVersionException(message); } diff --git a/src/NzbDrone.Core/Notifications/Xbmc/XbmcSettings.cs b/src/NzbDrone.Core/Notifications/Xbmc/XbmcSettings.cs index b84cc6179..45ca5a244 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/XbmcSettings.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/XbmcSettings.cs @@ -27,35 +27,35 @@ public XbmcSettings() } [FieldDefinition(0, Label = "Host")] - public String Host { get; set; } + public string Host { get; set; } [FieldDefinition(1, Label = "Port")] - public Int32 Port { get; set; } + public int Port { get; set; } [FieldDefinition(2, Label = "Username")] - public String Username { get; set; } + public string Username { get; set; } [FieldDefinition(3, Label = "Password", Type = FieldType.Password)] - public String Password { get; set; } + public string Password { get; set; } [DefaultValue(5)] [FieldDefinition(4, Label = "Display Time", HelpText = "How long the notification will be displayed for (In seconds)")] - public Int32 DisplayTime { get; set; } + public int DisplayTime { get; set; } [FieldDefinition(5, Label = "GUI Notification", Type = FieldType.Checkbox)] - public Boolean Notify { get; set; } + public bool Notify { get; set; } [FieldDefinition(6, Label = "Update Library", HelpText = "Update Library on Download & Rename?", Type = FieldType.Checkbox)] - public Boolean UpdateLibrary { get; set; } + public bool UpdateLibrary { get; set; } [FieldDefinition(7, Label = "Clean Library", HelpText = "Clean Library after update?", Type = FieldType.Checkbox)] - public Boolean CleanLibrary { get; set; } + public bool CleanLibrary { get; set; } [FieldDefinition(8, Label = "Always Update", HelpText = "Update Library even when a video is playing?", Type = FieldType.Checkbox)] - public Boolean AlwaysUpdate { get; set; } + public bool AlwaysUpdate { get; set; } [JsonIgnore] - public String Address { get { return String.Format("{0}:{1}", Host, Port); } } + public string Address { get { return string.Format("{0}:{1}", Host, Port); } } public NzbDroneValidationResult Validate() { diff --git a/src/NzbDrone.Core/Organizer/AbsoluteEpisodeFormat.cs b/src/NzbDrone.Core/Organizer/AbsoluteEpisodeFormat.cs index c5d8fe5db..d9db8d842 100644 --- a/src/NzbDrone.Core/Organizer/AbsoluteEpisodeFormat.cs +++ b/src/NzbDrone.Core/Organizer/AbsoluteEpisodeFormat.cs @@ -4,9 +4,9 @@ namespace NzbDrone.Core.Organizer { public class EpisodeFormat { - public String Separator { get; set; } - public String EpisodePattern { get; set; } - public String EpisodeSeparator { get; set; } - public String SeasonEpisodePattern { get; set; } + public string Separator { get; set; } + public string EpisodePattern { get; set; } + public string EpisodeSeparator { get; set; } + public string SeasonEpisodePattern { get; set; } } } diff --git a/src/NzbDrone.Core/Organizer/EpisodeFormat.cs b/src/NzbDrone.Core/Organizer/EpisodeFormat.cs index 44f820fac..47de7853e 100644 --- a/src/NzbDrone.Core/Organizer/EpisodeFormat.cs +++ b/src/NzbDrone.Core/Organizer/EpisodeFormat.cs @@ -4,7 +4,7 @@ namespace NzbDrone.Core.Organizer { public class AbsoluteEpisodeFormat { - public String Separator { get; set; } - public String AbsoluteEpisodePattern { get; set; } + public string Separator { get; set; } + public string AbsoluteEpisodePattern { get; set; } } } diff --git a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs index 5c8dbc8e1..80c65dcbc 100644 --- a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs +++ b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs @@ -16,11 +16,11 @@ namespace NzbDrone.Core.Organizer public interface IBuildFileNames { string BuildFileName(List episodes, Series series, EpisodeFile episodeFile, NamingConfig namingConfig = null); - string BuildFilePath(Series series, Int32 seasonNumber, String fileName, String extension); - string BuildSeasonPath(Series series, Int32 seasonNumber); + string BuildFilePath(Series series, int seasonNumber, string fileName, string extension); + string BuildSeasonPath(Series series, int seasonNumber); BasicNamingConfig GetBasicNamingConfig(NamingConfig nameSpec); string GetSeriesFolder(Series series, NamingConfig namingConfig = null); - string GetSeasonFolder(Series series, Int32 seasonNumber, NamingConfig namingConfig = null); + string GetSeasonFolder(Series series, int seasonNumber, NamingConfig namingConfig = null); } public class FileNameBuilder : IBuildFileNames @@ -105,7 +105,7 @@ public string BuildFileName(List episodes, Series series, EpisodeFile e } var pattern = namingConfig.StandardEpisodeFormat; - var tokenHandlers = new Dictionary>(FileNameBuilderTokenEqualityComparer.Instance); + var tokenHandlers = new Dictionary>(FileNameBuilderTokenEqualityComparer.Instance); episodes = episodes.OrderBy(e => e.SeasonNumber).ThenBy(e => e.EpisodeNumber).ToList(); @@ -130,7 +130,7 @@ public string BuildFileName(List episodes, Series series, EpisodeFile e var fileName = ReplaceTokens(pattern, tokenHandlers).Trim(); fileName = FileNameCleanupRegex.Replace(fileName, match => match.Captures[0].Value[0].ToString()); - fileName = TrimSeparatorsRegex.Replace(fileName, String.Empty); + fileName = TrimSeparatorsRegex.Replace(fileName, string.Empty); return fileName; } @@ -220,21 +220,21 @@ public string GetSeriesFolder(Series series, NamingConfig namingConfig = null) namingConfig = _namingConfigService.GetConfig(); } - var tokenHandlers = new Dictionary>(FileNameBuilderTokenEqualityComparer.Instance); + var tokenHandlers = new Dictionary>(FileNameBuilderTokenEqualityComparer.Instance); AddSeriesTokens(tokenHandlers, series); return CleanFolderName(ReplaceTokens(namingConfig.SeriesFolderFormat, tokenHandlers)); } - public string GetSeasonFolder(Series series, Int32 seasonNumber, NamingConfig namingConfig = null) + public string GetSeasonFolder(Series series, int seasonNumber, NamingConfig namingConfig = null) { if (namingConfig == null) { namingConfig = _namingConfigService.GetConfig(); } - var tokenHandlers = new Dictionary>(FileNameBuilderTokenEqualityComparer.Instance); + var tokenHandlers = new Dictionary>(FileNameBuilderTokenEqualityComparer.Instance); AddSeriesTokens(tokenHandlers, series); AddSeasonTokens(tokenHandlers, seasonNumber); @@ -246,7 +246,7 @@ public static string CleanTitle(string title) { title = title.Replace("&", "and"); title = ScenifyReplaceChars.Replace(title, " "); - title = ScenifyRemoveChars.Replace(title, String.Empty); + title = ScenifyRemoveChars.Replace(title, string.Empty); return title; } @@ -271,13 +271,13 @@ public static string CleanFolderName(string name) return name.Trim(' ', '.'); } - private void AddSeriesTokens(Dictionary> tokenHandlers, Series series) + private void AddSeriesTokens(Dictionary> tokenHandlers, Series series) { tokenHandlers["{Series Title}"] = m => series.Title; tokenHandlers["{Series CleanTitle}"] = m => CleanTitle(series.Title); } - private String AddSeasonEpisodeNumberingTokens(String pattern, Dictionary> tokenHandlers, List episodes, NamingConfig namingConfig) + private string AddSeasonEpisodeNumberingTokens(string pattern, Dictionary> tokenHandlers, List episodes, NamingConfig namingConfig) { var episodeFormats = GetEpisodeFormat(pattern).DistinctBy(v => v.SeasonEpisodePattern).ToList(); @@ -321,7 +321,7 @@ private String AddSeasonEpisodeNumberingTokens(String pattern, Dictionary seasonEpisodePattern; } @@ -340,7 +340,7 @@ private String AddSeasonEpisodeNumberingTokens(String pattern, Dictionary> tokenHandlers, Series series, List episodes, NamingConfig namingConfig) + private string AddAbsoluteNumberingTokens(string pattern, Dictionary> tokenHandlers, Series series, List episodes, NamingConfig namingConfig) { var absoluteEpisodeFormats = GetAbsoluteFormat(pattern).DistinctBy(v => v.AbsoluteEpisodePattern).ToList(); @@ -393,7 +393,7 @@ private String AddAbsoluteNumberingTokens(String pattern, Dictionary absoluteEpisodePattern; } @@ -401,12 +401,12 @@ private String AddAbsoluteNumberingTokens(String pattern, Dictionary> tokenHandlers, Int32 seasonNumber) + private void AddSeasonTokens(Dictionary> tokenHandlers, int seasonNumber) { tokenHandlers["{Season}"] = m => seasonNumber.ToString(m.CustomFormat); } - private void AddEpisodeTokens(Dictionary> tokenHandlers, List episodes) + private void AddEpisodeTokens(Dictionary> tokenHandlers, List episodes) { if (!episodes.First().AirDate.IsNullOrWhiteSpace()) { @@ -421,28 +421,28 @@ private void AddEpisodeTokens(Dictionary> token tokenHandlers["{Episode CleanTitle}"] = m => CleanTitle(GetEpisodeTitle(episodes, "and")); } - private void AddEpisodeFileTokens(Dictionary> tokenHandlers, EpisodeFile episodeFile) + private void AddEpisodeFileTokens(Dictionary> tokenHandlers, EpisodeFile episodeFile) { tokenHandlers["{Original Title}"] = m => GetOriginalTitle(episodeFile); tokenHandlers["{Original Filename}"] = m => GetOriginalFileName(episodeFile); tokenHandlers["{Release Group}"] = m => episodeFile.ReleaseGroup ?? "Sonarr"; } - private void AddQualityTokens(Dictionary> tokenHandlers, Series series, EpisodeFile episodeFile) + private void AddQualityTokens(Dictionary> tokenHandlers, Series series, EpisodeFile episodeFile) { var qualityTitle = _qualityDefinitionService.Get(episodeFile.Quality.Quality).Title; var qualityProper = GetQualityProper(series, episodeFile.Quality); - tokenHandlers["{Quality Full}"] = m => String.Format("{0} {1}", qualityTitle, qualityProper); + tokenHandlers["{Quality Full}"] = m => string.Format("{0} {1}", qualityTitle, qualityProper); tokenHandlers["{Quality Title}"] = m => qualityTitle; tokenHandlers["{Quality Proper}"] = m => qualityProper; } - private void AddMediaInfoTokens(Dictionary> tokenHandlers, EpisodeFile episodeFile) + private void AddMediaInfoTokens(Dictionary> tokenHandlers, EpisodeFile episodeFile) { if (episodeFile.MediaInfo == null) return; - String mediaInfoVideo; + string mediaInfoVideo; switch (episodeFile.MediaInfo.VideoCodec) { case "AVC": @@ -472,7 +472,7 @@ private void AddMediaInfoTokens(Dictionary> tok break; } - String mediaInfoAudio; + string mediaInfoAudio; switch (episodeFile.MediaInfo.AudioFormat) { case "AC-3": @@ -502,29 +502,29 @@ private void AddMediaInfoTokens(Dictionary> tok var mediaInfoAudioLanguages = GetLanguagesToken(episodeFile.MediaInfo.AudioLanguages); if (!mediaInfoAudioLanguages.IsNullOrWhiteSpace()) { - mediaInfoAudioLanguages = String.Format("[{0}]", mediaInfoAudioLanguages); + mediaInfoAudioLanguages = string.Format("[{0}]", mediaInfoAudioLanguages); } if (mediaInfoAudioLanguages == "[EN]") { - mediaInfoAudioLanguages = String.Empty; + mediaInfoAudioLanguages = string.Empty; } var mediaInfoSubtitleLanguages = GetLanguagesToken(episodeFile.MediaInfo.Subtitles); if (!mediaInfoSubtitleLanguages.IsNullOrWhiteSpace()) { - mediaInfoSubtitleLanguages = String.Format("[{0}]", mediaInfoSubtitleLanguages); + mediaInfoSubtitleLanguages = string.Format("[{0}]", mediaInfoSubtitleLanguages); } tokenHandlers["{MediaInfo Video}"] = m => mediaInfoVideo; tokenHandlers["{MediaInfo Audio}"] = m => mediaInfoAudio; - tokenHandlers["{MediaInfo Simple}"] = m => String.Format("{0} {1}", mediaInfoVideo, mediaInfoAudio); + tokenHandlers["{MediaInfo Simple}"] = m => string.Format("{0} {1}", mediaInfoVideo, mediaInfoAudio); - tokenHandlers["{MediaInfo Full}"] = m => String.Format("{0} {1}{2} {3}", mediaInfoVideo, mediaInfoAudio, mediaInfoAudioLanguages, mediaInfoSubtitleLanguages); + tokenHandlers["{MediaInfo Full}"] = m => string.Format("{0} {1}{2} {3}", mediaInfoVideo, mediaInfoAudio, mediaInfoAudioLanguages, mediaInfoSubtitleLanguages); } - private string GetLanguagesToken(String mediaInfoLanguages) + private string GetLanguagesToken(string mediaInfoLanguages) { List tokens = new List(); foreach (var item in mediaInfoLanguages.Split('/')) @@ -551,12 +551,12 @@ private string GetLanguagesToken(String mediaInfoLanguages) return string.Join("+", tokens.Distinct()); } - private string ReplaceTokens(String pattern, Dictionary> tokenHandlers) + private string ReplaceTokens(string pattern, Dictionary> tokenHandlers) { return TitleRegex.Replace(pattern, match => ReplaceToken(match, tokenHandlers)); } - private string ReplaceToken(Match match, Dictionary> tokenHandlers) + private string ReplaceToken(Match match, Dictionary> tokenHandlers) { var tokenMatch = new TokenMatch { @@ -573,15 +573,15 @@ private string ReplaceToken(Match match, Dictionary String.Empty); + var tokenHandler = tokenHandlers.GetValueOrDefault(tokenMatch.Token, m => string.Empty); var replacementText = tokenHandler(tokenMatch).Trim(); - if (tokenMatch.Token.All(t => !Char.IsLetter(t) || Char.IsLower(t))) + if (tokenMatch.Token.All(t => !char.IsLetter(t) || char.IsLower(t))) { replacementText = replacementText.ToLower(); } - else if (tokenMatch.Token.All(t => !Char.IsLetter(t) || Char.IsUpper(t))) + else if (tokenMatch.Token.All(t => !char.IsLetter(t) || char.IsUpper(t))) { replacementText = replacementText.ToUpper(); } @@ -603,7 +603,7 @@ private string ReplaceToken(Match match, Dictionary episodes) { - var pattern = String.Empty; + var pattern = string.Empty; for (int i = 0; i < episodes.Count; i++) { @@ -617,7 +617,7 @@ private string FormatNumberTokens(string basePattern, string formatPattern, List private string FormatAbsoluteNumberTokens(string basePattern, string formatPattern, List episodes) { - var pattern = String.Empty; + var pattern = string.Empty; for (int i = 0; i < episodes.Count; i++) { @@ -675,7 +675,7 @@ private AbsoluteEpisodeFormat[] GetAbsoluteFormat(string pattern) private string GetEpisodeTitle(List episodes, string separator) { - separator = String.Format(" {0} ", separator.Trim()); + separator = string.Format(" {0} ", separator.Trim()); if (episodes.Count == 1) { @@ -687,7 +687,7 @@ private string GetEpisodeTitle(List episodes, string separator) .Select(CleanupEpisodeTitle) .Distinct(); - return String.Join(separator, titles); + return string.Join(separator, titles); } private string CleanupEpisodeTitle(string title) @@ -708,7 +708,7 @@ private string GetQualityProper(Series series, QualityModel quality) return "Proper"; } - return String.Empty; + return string.Empty; } private string GetOriginalTitle(EpisodeFile episodeFile) @@ -735,11 +735,11 @@ private string GetOriginalFileName(EpisodeFile episodeFile) internal sealed class TokenMatch { public Match RegexMatch { get; set; } - public String Prefix { get; set; } - public String Separator { get; set; } - public String Suffix { get; set; } - public String Token { get; set; } - public String CustomFormat { get; set; } + public string Prefix { get; set; } + public string Separator { get; set; } + public string Suffix { get; set; } + public string Token { get; set; } + public string CustomFormat { get; set; } } public enum MultiEpisodeStyle diff --git a/src/NzbDrone.Core/Organizer/FileNameBuilderTokenEqualityComparer.cs b/src/NzbDrone.Core/Organizer/FileNameBuilderTokenEqualityComparer.cs index 055083d81..18600cb19 100644 --- a/src/NzbDrone.Core/Organizer/FileNameBuilderTokenEqualityComparer.cs +++ b/src/NzbDrone.Core/Organizer/FileNameBuilderTokenEqualityComparer.cs @@ -4,7 +4,7 @@ namespace NzbDrone.Core.Organizer { - public class FileNameBuilderTokenEqualityComparer : IEqualityComparer + public class FileNameBuilderTokenEqualityComparer : IEqualityComparer { public static readonly FileNameBuilderTokenEqualityComparer Instance = new FileNameBuilderTokenEqualityComparer(); @@ -15,19 +15,19 @@ private FileNameBuilderTokenEqualityComparer() } - public bool Equals(String s1, String s2) + public bool Equals(string s1, string s2) { return SimplifyToken(s1).Equals(SimplifyToken(s2)); } - public int GetHashCode(String str) + public int GetHashCode(string str) { return SimplifyToken(str).GetHashCode(); } private static string SimplifyToken(string token) { - return SimpleTokenRegex.Replace(token, String.Empty).ToLower(); + return SimpleTokenRegex.Replace(token, string.Empty).ToLower(); } } } diff --git a/src/NzbDrone.Core/Organizer/FileNameSampleService.cs b/src/NzbDrone.Core/Organizer/FileNameSampleService.cs index bdf79898e..c89c7b6db 100644 --- a/src/NzbDrone.Core/Organizer/FileNameSampleService.cs +++ b/src/NzbDrone.Core/Organizer/FileNameSampleService.cs @@ -14,8 +14,8 @@ public interface IFilenameSampleService SampleResult GetDailySample(NamingConfig nameSpec); SampleResult GetAnimeSample(NamingConfig nameSpec); SampleResult GetAnimeMultiEpisodeSample(NamingConfig nameSpec); - String GetSeriesFolderSample(NamingConfig nameSpec); - String GetSeasonFolderSample(NamingConfig nameSpec); + string GetSeriesFolderSample(NamingConfig nameSpec); + string GetSeasonFolderSample(NamingConfig nameSpec); } public class FileNameSampleService : IFilenameSampleService @@ -230,7 +230,7 @@ private string BuildSample(List episodes, Series series, EpisodeFile ep } catch (NamingFormatException) { - return String.Empty; + return string.Empty; } } } diff --git a/src/NzbDrone.Core/Organizer/FileNameValidation.cs b/src/NzbDrone.Core/Organizer/FileNameValidation.cs index c59151ae6..5370b1b55 100644 --- a/src/NzbDrone.Core/Organizer/FileNameValidation.cs +++ b/src/NzbDrone.Core/Organizer/FileNameValidation.cs @@ -54,7 +54,7 @@ public ValidStandardEpisodeFormatValidator() protected override bool IsValid(PropertyValidatorContext context) { - var value = context.PropertyValue as String; + var value = context.PropertyValue as string; if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) && !FileNameValidation.OriginalTokenRegex.IsMatch(value)) @@ -76,7 +76,7 @@ public ValidDailyEpisodeFormatValidator() protected override bool IsValid(PropertyValidatorContext context) { - var value = context.PropertyValue as String; + var value = context.PropertyValue as string; if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) && !FileNameBuilder.AirDateRegex.IsMatch(value) && @@ -99,7 +99,7 @@ public ValidAnimeEpisodeFormatValidator() protected override bool IsValid(PropertyValidatorContext context) { - var value = context.PropertyValue as String; + var value = context.PropertyValue as string; if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) && !FileNameBuilder.AbsoluteEpisodePatternRegex.IsMatch(value) && diff --git a/src/NzbDrone.Core/Organizer/SampleResult.cs b/src/NzbDrone.Core/Organizer/SampleResult.cs index 6b5d9fdb9..fa0271e4d 100644 --- a/src/NzbDrone.Core/Organizer/SampleResult.cs +++ b/src/NzbDrone.Core/Organizer/SampleResult.cs @@ -7,7 +7,7 @@ namespace NzbDrone.Core.Organizer { public class SampleResult { - public String FileName { get; set; } + public string FileName { get; set; } public Series Series { get; set; } public List Episodes { get; set; } public EpisodeFile EpisodeFile { get; set; } diff --git a/src/NzbDrone.Core/Parser/Model/LocalEpisode.cs b/src/NzbDrone.Core/Parser/Model/LocalEpisode.cs index 648200bf4..080981600 100644 --- a/src/NzbDrone.Core/Parser/Model/LocalEpisode.cs +++ b/src/NzbDrone.Core/Parser/Model/LocalEpisode.cs @@ -14,14 +14,14 @@ public LocalEpisode() Episodes = new List(); } - public String Path { get; set; } - public Int64 Size { get; set; } + public string Path { get; set; } + public long Size { get; set; } public ParsedEpisodeInfo ParsedEpisodeInfo { get; set; } public Series Series { get; set; } public List Episodes { get; set; } public QualityModel Quality { get; set; } public MediaInfoModel MediaInfo { get; set; } - public Boolean ExistingFile { get; set; } + public bool ExistingFile { get; set; } public int SeasonNumber { diff --git a/src/NzbDrone.Core/Parser/Model/ParsedEpisodeInfo.cs b/src/NzbDrone.Core/Parser/Model/ParsedEpisodeInfo.cs index 53365de56..75e0f08b6 100644 --- a/src/NzbDrone.Core/Parser/Model/ParsedEpisodeInfo.cs +++ b/src/NzbDrone.Core/Parser/Model/ParsedEpisodeInfo.cs @@ -7,18 +7,18 @@ namespace NzbDrone.Core.Parser.Model { public class ParsedEpisodeInfo { - public String SeriesTitle { get; set; } + public string SeriesTitle { get; set; } public SeriesTitleInfo SeriesTitleInfo { get; set; } public QualityModel Quality { get; set; } - public Int32 SeasonNumber { get; set; } - public Int32[] EpisodeNumbers { get; set; } - public Int32[] AbsoluteEpisodeNumbers { get; set; } - public String AirDate { get; set; } + public int SeasonNumber { get; set; } + public int[] EpisodeNumbers { get; set; } + public int[] AbsoluteEpisodeNumbers { get; set; } + public string AirDate { get; set; } public Language Language { get; set; } - public Boolean FullSeason { get; set; } - public Boolean Special { get; set; } - public String ReleaseGroup { get; set; } - public String ReleaseHash { get; set; } + public bool FullSeason { get; set; } + public bool Special { get; set; } + public string ReleaseGroup { get; set; } + public string ReleaseHash { get; set; } public ParsedEpisodeInfo() { @@ -30,7 +30,7 @@ public bool IsDaily { get { - return !String.IsNullOrWhiteSpace(AirDate); + return !string.IsNullOrWhiteSpace(AirDate); } //This prevents manually downloading a release from blowing up in mono @@ -72,22 +72,22 @@ public override string ToString() if (IsDaily && EpisodeNumbers.Empty()) { - episodeString = String.Format("{0}", AirDate); + episodeString = string.Format("{0}", AirDate); } else if (FullSeason) { - episodeString = String.Format("Season {0:00}", SeasonNumber); + episodeString = string.Format("Season {0:00}", SeasonNumber); } else if (EpisodeNumbers != null && EpisodeNumbers.Any()) { - episodeString = String.Format("S{0:00}E{1}", SeasonNumber, String.Join("-", EpisodeNumbers.Select(c => c.ToString("00")))); + episodeString = string.Format("S{0:00}E{1}", SeasonNumber, string.Join("-", EpisodeNumbers.Select(c => c.ToString("00")))); } else if (AbsoluteEpisodeNumbers != null && AbsoluteEpisodeNumbers.Any()) { - episodeString = String.Format("{0}", String.Join("-", AbsoluteEpisodeNumbers.Select(c => c.ToString("000")))); + episodeString = string.Format("{0}", string.Join("-", AbsoluteEpisodeNumbers.Select(c => c.ToString("000")))); } - return String.Format("{0} - {1} {2}", SeriesTitle, episodeString, Quality); + return string.Format("{0} - {1} {2}", SeriesTitle, episodeString, Quality); } } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Parser/Model/RemoteEpisode.cs b/src/NzbDrone.Core/Parser/Model/RemoteEpisode.cs index f87f71c8e..319606781 100644 --- a/src/NzbDrone.Core/Parser/Model/RemoteEpisode.cs +++ b/src/NzbDrone.Core/Parser/Model/RemoteEpisode.cs @@ -11,7 +11,7 @@ public class RemoteEpisode public ParsedEpisodeInfo ParsedEpisodeInfo { get; set; } public Series Series { get; set; } public List Episodes { get; set; } - public Boolean DownloadAllowed { get; set; } + public bool DownloadAllowed { get; set; } public bool IsRecentEpisode() { diff --git a/src/NzbDrone.Core/Parser/Model/TorrentInfo.cs b/src/NzbDrone.Core/Parser/Model/TorrentInfo.cs index d84889aae..5987102cc 100644 --- a/src/NzbDrone.Core/Parser/Model/TorrentInfo.cs +++ b/src/NzbDrone.Core/Parser/Model/TorrentInfo.cs @@ -7,10 +7,10 @@ public class TorrentInfo : ReleaseInfo { public string MagnetUrl { get; set; } public string InfoHash { get; set; } - public Int32? Seeders { get; set; } - public Int32? Peers { get; set; } + public int? Seeders { get; set; } + public int? Peers { get; set; } - public static Int32? GetSeeders(ReleaseInfo release) + public static int? GetSeeders(ReleaseInfo release) { var torrentInfo = release as TorrentInfo; diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index 477b3d6c9..e84a1afb0 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -263,15 +263,15 @@ public static ParsedEpisodeInfo ParseTitle(string title) var titleWithoutExtension = RemoveFileExtension(title).ToCharArray(); Array.Reverse(titleWithoutExtension); - title = new String(titleWithoutExtension) + title.Substring(titleWithoutExtension.Length); + title = new string(titleWithoutExtension) + title.Substring(titleWithoutExtension.Length); Logger.Debug("Reversed name detected. Converted to '{0}'", title); } - var simpleTitle = SimpleTitleRegex.Replace(title, String.Empty); + var simpleTitle = SimpleTitleRegex.Replace(title, string.Empty); // TODO: Quick fix stripping [url] - prefixes. - simpleTitle = WebsitePrefixRegex.Replace(simpleTitle, String.Empty); + simpleTitle = WebsitePrefixRegex.Replace(simpleTitle, string.Empty); var airDateMatch = AirDateRegex.Match(simpleTitle); if (airDateMatch.Success) @@ -282,7 +282,7 @@ public static ParsedEpisodeInfo ParseTitle(string title) var sixDigitAirDateMatch = SixDigitAirDateRegex.Match(simpleTitle); if (sixDigitAirDateMatch.Success) { - var fixedDate = String.Format("20{0}.{1}.{2}", sixDigitAirDateMatch.Groups["airyear"].Value, + var fixedDate = string.Format("20{0}.{1}.{2}", sixDigitAirDateMatch.Groups["airyear"].Value, sixDigitAirDateMatch.Groups["airmonth"].Value, sixDigitAirDateMatch.Groups["airday"].Value); @@ -370,15 +370,15 @@ public static string CleanSeriesTitle(this string title) long number = 0; //If Title only contains numbers return it as is. - if (Int64.TryParse(title, out number)) + if (long.TryParse(title, out number)) return title; - return NormalizeRegex.Replace(title, String.Empty).ToLower().RemoveAccent(); + return NormalizeRegex.Replace(title, string.Empty).ToLower().RemoveAccent(); } public static string NormalizeEpisodeTitle(string title) { - title = SpecialEpisodeWordRegex.Replace(title, String.Empty); + title = SpecialEpisodeWordRegex.Replace(title, string.Empty); title = PunctuationRegex.Replace(title, " "); title = DuplicateSpacesRegex.Replace(title, " "); @@ -389,8 +389,8 @@ public static string NormalizeEpisodeTitle(string title) public static string NormalizeTitle(string title) { title = WordDelimiterRegex.Replace(title, " "); - title = PunctuationRegex.Replace(title, String.Empty); - title = CommonWordRegex.Replace(title, String.Empty); + title = PunctuationRegex.Replace(title, string.Empty); + title = CommonWordRegex.Replace(title, string.Empty); title = DuplicateSpacesRegex.Replace(title, " "); return title.Trim().ToLower(); @@ -418,7 +418,7 @@ public static string ParseReleaseGroup(string title) var group = matches.OfType().Last().Groups["releasegroup"].Value; int groupIsNumeric; - if (Int32.TryParse(group, out groupIsNumeric)) + if (int.TryParse(group, out groupIsNumeric)) { return null; } @@ -436,7 +436,7 @@ public static string RemoveFileExtension(string title) var extension = m.Value.ToLower(); if (MediaFiles.MediaFileExtensions.Extensions.Contains(extension) || new[] { ".par2", ".nzb" }.Contains(extension)) { - return String.Empty; + return string.Empty; } return m.Value; }); @@ -561,7 +561,7 @@ private static ParsedEpisodeInfo ParseMatchCollection(MatchCollection matchColle seriesName = RequestInfoRegex.Replace(seriesName, "").Trim(' '); int airYear; - Int32.TryParse(matchCollection[0].Groups["airyear"].Value, out airYear); + int.TryParse(matchCollection[0].Groups["airyear"].Value, out airYear); ParsedEpisodeInfo result; @@ -572,7 +572,7 @@ private static ParsedEpisodeInfo ParseMatchCollection(MatchCollection matchColle foreach (Capture seasonCapture in matchCollection[0].Groups["season"].Captures) { int parsedSeason; - if (Int32.TryParse(seasonCapture.Value, out parsedSeason)) + if (int.TryParse(seasonCapture.Value, out parsedSeason)) seasons.Add(parsedSeason); } @@ -697,7 +697,7 @@ private static bool ValidateBeforeParsing(string title) return false; } - if (!title.Any(Char.IsLetterOrDigit)) + if (!title.Any(char.IsLetterOrDigit)) { return false; } @@ -722,7 +722,7 @@ private static string GetSubGroup(MatchCollection matchCollection) return subGroup.Value; } - return String.Empty; + return string.Empty; } private static string GetReleaseHash(MatchCollection matchCollection) @@ -735,13 +735,13 @@ private static string GetReleaseHash(MatchCollection matchCollection) if (hashValue.Equals("1280x720")) { - return String.Empty; + return string.Empty; } return hashValue; } - return String.Empty; + return string.Empty; } } } diff --git a/src/NzbDrone.Core/Parser/ParsingService.cs b/src/NzbDrone.Core/Parser/ParsingService.cs index c549733b3..de5e5f63f 100644 --- a/src/NzbDrone.Core/Parser/ParsingService.cs +++ b/src/NzbDrone.Core/Parser/ParsingService.cs @@ -252,7 +252,7 @@ public List GetEpisodes(ParsedEpisodeInfo parsedEpisodeInfo, Series ser series.Title, episodes.First().SceneSeasonNumber, episodes.First().SceneEpisodeNumber, - String.Join(", ", episodes.Select(e => String.Format("{0}x{1:00}", e.SeasonNumber, e.EpisodeNumber)))); + string.Join(", ", episodes.Select(e => string.Format("{0}x{1:00}", e.SeasonNumber, e.EpisodeNumber)))); result.AddRange(episodes); continue; @@ -406,7 +406,7 @@ private Series GetSeries(ParsedEpisodeInfo parsedEpisodeInfo, int tvRageId, Sear return series; } - private Episode GetDailyEpisode(Series series, String airDate, SearchCriteriaBase searchCriteria) + private Episode GetDailyEpisode(Series series, string airDate, SearchCriteriaBase searchCriteria) { Episode episodeInfo = null; diff --git a/src/NzbDrone.Core/Parser/QualityParser.cs b/src/NzbDrone.Core/Parser/QualityParser.cs index 4a97da7d3..0be547684 100644 --- a/src/NzbDrone.Core/Parser/QualityParser.cs +++ b/src/NzbDrone.Core/Parser/QualityParser.cs @@ -287,7 +287,7 @@ public static QualityModel ParseQuality(string name) return result; } - private static Resolution ParseResolution(String name) + private static Resolution ParseResolution(string name) { var match = ResolutionRegex.Match(name); @@ -300,7 +300,7 @@ private static Resolution ParseResolution(String name) return Resolution.Unknown; } - private static Quality OtherSourceMatch(String name) + private static Quality OtherSourceMatch(string name) { var match = OtherSourceRegex.Match(name); @@ -311,7 +311,7 @@ private static Quality OtherSourceMatch(String name) return Quality.Unknown; } - private static QualityModel ParseQualityModifiers(String normalizedName) + private static QualityModel ParseQualityModifiers(string normalizedName) { var result = new QualityModel { Quality = Quality.Unknown }; diff --git a/src/NzbDrone.Core/Parser/SceneChecker.cs b/src/NzbDrone.Core/Parser/SceneChecker.cs index 339f6b17c..e37f9014d 100644 --- a/src/NzbDrone.Core/Parser/SceneChecker.cs +++ b/src/NzbDrone.Core/Parser/SceneChecker.cs @@ -16,7 +16,7 @@ public static bool IsSceneTitle(string title) if (parsedTitle == null || parsedTitle.ReleaseGroup == null || parsedTitle.Quality.Quality == Qualities.Quality.Unknown || - String.IsNullOrWhiteSpace(parsedTitle.SeriesTitle)) + string.IsNullOrWhiteSpace(parsedTitle.SeriesTitle)) { return false; } diff --git a/src/NzbDrone.Core/Profiles/Profile.cs b/src/NzbDrone.Core/Profiles/Profile.cs index 55a3a302b..b501b0cee 100644 --- a/src/NzbDrone.Core/Profiles/Profile.cs +++ b/src/NzbDrone.Core/Profiles/Profile.cs @@ -9,7 +9,7 @@ namespace NzbDrone.Core.Profiles { public class Profile : ModelBase { - public String Name { get; set; } + public string Name { get; set; } public Quality Cutoff { get; set; } public List Items { get; set; } public Language Language { get; set; } diff --git a/src/NzbDrone.Core/Qualities/QualitiesBelowCutoff.cs b/src/NzbDrone.Core/Qualities/QualitiesBelowCutoff.cs index 7d1d2c498..0dbe23ff6 100644 --- a/src/NzbDrone.Core/Qualities/QualitiesBelowCutoff.cs +++ b/src/NzbDrone.Core/Qualities/QualitiesBelowCutoff.cs @@ -5,8 +5,8 @@ namespace NzbDrone.Core.Qualities { public class QualitiesBelowCutoff { - public Int32 ProfileId { get; set; } - public IEnumerable QualityIds { get; set; } + public int ProfileId { get; set; } + public IEnumerable QualityIds { get; set; } public QualitiesBelowCutoff(int profileId, IEnumerable qualityIds) { diff --git a/src/NzbDrone.Core/Qualities/QualityDefinitionService.cs b/src/NzbDrone.Core/Qualities/QualityDefinitionService.cs index 115f87da8..d2fc46e3c 100644 --- a/src/NzbDrone.Core/Qualities/QualityDefinitionService.cs +++ b/src/NzbDrone.Core/Qualities/QualityDefinitionService.cs @@ -12,7 +12,7 @@ public interface IQualityDefinitionService { void Update(QualityDefinition qualityDefinition); List All(); - QualityDefinition GetById(Int32 id); + QualityDefinition GetById(int id); QualityDefinition Get(Quality quality); } @@ -46,7 +46,7 @@ public List All() return GetAll().Values.OrderBy(d => d.Weight).ToList(); } - public QualityDefinition GetById(Int32 id) + public QualityDefinition GetById(int id) { return GetAll().Values.Single(v => v.Id == id); } diff --git a/src/NzbDrone.Core/Qualities/QualityModel.cs b/src/NzbDrone.Core/Qualities/QualityModel.cs index ad1b16b43..c941b131c 100644 --- a/src/NzbDrone.Core/Qualities/QualityModel.cs +++ b/src/NzbDrone.Core/Qualities/QualityModel.cs @@ -22,7 +22,7 @@ public QualityModel(Quality quality, Revision revision = null) public override string ToString() { - return String.Format("{0} {1}", Quality, Revision); + return string.Format("{0} {1}", Quality, Revision); } public override int GetHashCode() diff --git a/src/NzbDrone.Core/Qualities/Revision.cs b/src/NzbDrone.Core/Qualities/Revision.cs index bdf524152..7ec095cda 100644 --- a/src/NzbDrone.Core/Qualities/Revision.cs +++ b/src/NzbDrone.Core/Qualities/Revision.cs @@ -9,14 +9,14 @@ private Revision() { } - public Revision(Int32 version = 1, Int32 real = 0) + public Revision(int version = 1, int real = 0) { Version = version; Real = real; } - public Int32 Version { get; set; } - public Int32 Real { get; set; } + public int Version { get; set; } + public int Real { get; set; } public bool Equals(Revision other) { diff --git a/src/NzbDrone.Core/Queue/Queue.cs b/src/NzbDrone.Core/Queue/Queue.cs index d39b22fb3..7164a17ae 100644 --- a/src/NzbDrone.Core/Queue/Queue.cs +++ b/src/NzbDrone.Core/Queue/Queue.cs @@ -14,15 +14,15 @@ public class Queue : ModelBase public Series Series { get; set; } public Episode Episode { get; set; } public QualityModel Quality { get; set; } - public Decimal Size { get; set; } - public String Title { get; set; } - public Decimal Sizeleft { get; set; } + public decimal Size { get; set; } + public string Title { get; set; } + public decimal Sizeleft { get; set; } public TimeSpan? Timeleft { get; set; } public DateTime? EstimatedCompletionTime { get; set; } - public String Status { get; set; } - public String TrackedDownloadStatus { get; set; } + public string Status { get; set; } + public string TrackedDownloadStatus { get; set; } public List StatusMessages { get; set; } - public String DownloadId { get; set; } + public string DownloadId { get; set; } public RemoteEpisode RemoteEpisode { get; set; } public DownloadProtocol Protocol { get; set; } } diff --git a/src/NzbDrone.Core/RemotePathMappings/RemotePathMapping.cs b/src/NzbDrone.Core/RemotePathMappings/RemotePathMapping.cs index 6ff10fae9..c06660eaf 100644 --- a/src/NzbDrone.Core/RemotePathMappings/RemotePathMapping.cs +++ b/src/NzbDrone.Core/RemotePathMappings/RemotePathMapping.cs @@ -6,8 +6,8 @@ namespace NzbDrone.Core.RemotePathMappings { public class RemotePathMapping : ModelBase { - public String Host { get; set; } - public String RemotePath { get; set; } - public String LocalPath { get; set; } + public string Host { get; set; } + public string RemotePath { get; set; } + public string LocalPath { get; set; } } } \ No newline at end of file diff --git a/src/NzbDrone.Core/RemotePathMappings/RemotePathMappingService.cs b/src/NzbDrone.Core/RemotePathMappings/RemotePathMappingService.cs index 3a45fe29d..7d131319f 100644 --- a/src/NzbDrone.Core/RemotePathMappings/RemotePathMappingService.cs +++ b/src/NzbDrone.Core/RemotePathMappings/RemotePathMappingService.cs @@ -19,8 +19,8 @@ public interface IRemotePathMappingService RemotePathMapping Get(int id); RemotePathMapping Update(RemotePathMapping mapping); - OsPath RemapRemoteToLocal(String host, OsPath remotePath); - OsPath RemapLocalToRemote(String host, OsPath localPath); + OsPath RemapRemoteToLocal(string host, OsPath remotePath); + OsPath RemapLocalToRemote(string host, OsPath localPath); } public class RemotePathMappingService : IRemotePathMappingService @@ -121,7 +121,7 @@ private void ValidateMapping(List existing, RemotePathMapping } } - public OsPath RemapRemoteToLocal(String host, OsPath remotePath) + public OsPath RemapRemoteToLocal(string host, OsPath remotePath) { if (remotePath.IsEmpty) { @@ -141,7 +141,7 @@ public OsPath RemapRemoteToLocal(String host, OsPath remotePath) return remotePath; } - public OsPath RemapLocalToRemote(String host, OsPath localPath) + public OsPath RemapLocalToRemote(string host, OsPath localPath) { if (localPath.IsEmpty) { diff --git a/src/NzbDrone.Core/Rest/RestClientFactory.cs b/src/NzbDrone.Core/Rest/RestClientFactory.cs index 568dbd2e0..3b00364a3 100644 --- a/src/NzbDrone.Core/Rest/RestClientFactory.cs +++ b/src/NzbDrone.Core/Rest/RestClientFactory.cs @@ -6,11 +6,11 @@ namespace NzbDrone.Core.Rest { public static class RestClientFactory { - public static RestClient BuildClient(String baseUrl) + public static RestClient BuildClient(string baseUrl) { var restClient = new RestClient(baseUrl); - restClient.UserAgent = String.Format("Sonarr/{0} (RestSharp/{1}; {2}/{3})", + restClient.UserAgent = string.Format("Sonarr/{0} (RestSharp/{1}; {2}/{3})", BuildInfo.Version, restClient.GetType().Assembly.GetName().Version, OsInfo.Os, OsInfo.Version.ToString(2)); diff --git a/src/NzbDrone.Core/Rest/RestSharpExtensions.cs b/src/NzbDrone.Core/Rest/RestSharpExtensions.cs index b09314d49..3a0bb2a4e 100644 --- a/src/NzbDrone.Core/Rest/RestSharpExtensions.cs +++ b/src/NzbDrone.Core/Rest/RestSharpExtensions.cs @@ -82,7 +82,7 @@ public static void AddQueryString(this IRestRequest request, string name, object request.AddParameter(name, value.ToString(), ParameterType.GetOrPost); } - public static object GetHeaderValue(this IRestResponse response, String key) + public static object GetHeaderValue(this IRestResponse response, string key) { var header = response.Headers.FirstOrDefault(v => v.Name == key); diff --git a/src/NzbDrone.Core/Restrictions/Restriction.cs b/src/NzbDrone.Core/Restrictions/Restriction.cs index c3944f444..a5ab1b647 100644 --- a/src/NzbDrone.Core/Restrictions/Restriction.cs +++ b/src/NzbDrone.Core/Restrictions/Restriction.cs @@ -6,14 +6,14 @@ namespace NzbDrone.Core.Restrictions { public class Restriction : ModelBase { - public String Required { get; set; } - public String Preferred { get; set; } - public String Ignored { get; set; } - public HashSet Tags { get; set; } + public string Required { get; set; } + public string Preferred { get; set; } + public string Ignored { get; set; } + public HashSet Tags { get; set; } public Restriction() { - Tags = new HashSet(); + Tags = new HashSet(); } } } diff --git a/src/NzbDrone.Core/Restrictions/RestrictionService.cs b/src/NzbDrone.Core/Restrictions/RestrictionService.cs index d05b5874b..1f0726109 100644 --- a/src/NzbDrone.Core/Restrictions/RestrictionService.cs +++ b/src/NzbDrone.Core/Restrictions/RestrictionService.cs @@ -9,10 +9,10 @@ namespace NzbDrone.Core.Restrictions public interface IRestrictionService { List All(); - List AllForTag(Int32 tagId); - List AllForTags(HashSet tagIds); - Restriction Get(Int32 id); - void Delete(Int32 id); + List AllForTag(int tagId); + List AllForTags(HashSet tagIds); + Restriction Get(int id); + void Delete(int id); Restriction Add(Restriction restriction); Restriction Update(Restriction restriction); } @@ -33,22 +33,22 @@ public List All() return _repo.All().ToList(); } - public List AllForTag(Int32 tagId) + public List AllForTag(int tagId) { return _repo.All().Where(r => r.Tags.Contains(tagId) || r.Tags.Empty()).ToList(); } - public List AllForTags(HashSet tagIds) + public List AllForTags(HashSet tagIds) { return _repo.All().Where(r => r.Tags.Intersect(tagIds).Any() || r.Tags.Empty()).ToList(); } - public Restriction Get(Int32 id) + public Restriction Get(int id) { return _repo.Get(id); } - public void Delete(Int32 id) + public void Delete(int id) { _repo.Delete(id); } diff --git a/src/NzbDrone.Core/RootFolders/RootFolderService.cs b/src/NzbDrone.Core/RootFolders/RootFolderService.cs index 9577c7981..da1bb1f3b 100644 --- a/src/NzbDrone.Core/RootFolders/RootFolderService.cs +++ b/src/NzbDrone.Core/RootFolders/RootFolderService.cs @@ -91,7 +91,7 @@ public RootFolder Add(RootFolder rootFolder) { var all = All(); - if (String.IsNullOrWhiteSpace(rootFolder.Path) || !Path.IsPathRooted(rootFolder.Path)) + if (string.IsNullOrWhiteSpace(rootFolder.Path) || !Path.IsPathRooted(rootFolder.Path)) { throw new ArgumentException("Invalid path"); } @@ -113,7 +113,7 @@ public RootFolder Add(RootFolder rootFolder) if (!_diskProvider.FolderWritable(rootFolder.Path)) { - throw new UnauthorizedAccessException(String.Format("Root folder path '{0}' is not writable by user '{1}'", rootFolder.Path, Environment.UserName)); + throw new UnauthorizedAccessException(string.Format("Root folder path '{0}' is not writable by user '{1}'", rootFolder.Path, Environment.UserName)); } _rootFolderRepository.Insert(rootFolder); @@ -131,7 +131,7 @@ public void Remove(int id) private List GetUnmappedFolders(string path) { _logger.Debug("Generating list of unmapped folders"); - if (String.IsNullOrEmpty(path)) + if (string.IsNullOrEmpty(path)) throw new ArgumentException("Invalid path provided", "path"); var results = new List(); diff --git a/src/NzbDrone.Core/SeriesStats/SeriesStatisticsRepository.cs b/src/NzbDrone.Core/SeriesStats/SeriesStatisticsRepository.cs index a8b886ca9..73e4e8b4b 100644 --- a/src/NzbDrone.Core/SeriesStats/SeriesStatisticsRepository.cs +++ b/src/NzbDrone.Core/SeriesStats/SeriesStatisticsRepository.cs @@ -8,7 +8,7 @@ namespace NzbDrone.Core.SeriesStats public interface ISeriesStatisticsRepository { List SeriesStatistics(); - List SeriesStatistics(Int32 seriesId); + List SeriesStatistics(int seriesId); } public class SeriesStatisticsRepository : ISeriesStatisticsRepository @@ -35,7 +35,7 @@ public List SeriesStatistics() return mapper.Query(queryText); } - public List SeriesStatistics(Int32 seriesId) + public List SeriesStatistics(int seriesId) { var mapper = _database.GetDataMapper(); @@ -52,7 +52,7 @@ public List SeriesStatistics(Int32 seriesId) return mapper.Query(queryText); } - private String GetSelectClause() + private string GetSelectClause() { return @"SELECT Episodes.*, SUM(EpisodeFiles.Size) as SizeOnDisk FROM (SELECT @@ -67,12 +67,12 @@ FROM Episodes GROUP BY Episodes.SeriesId, Episodes.SeasonNumber) as Episodes"; } - private String GetGroupByClause() + private string GetGroupByClause() { return "GROUP BY Episodes.SeriesId, Episodes.SeasonNumber"; } - private String GetEpisodeFilesJoin() + private string GetEpisodeFilesJoin() { return @"LEFT OUTER JOIN EpisodeFiles ON EpisodeFiles.SeriesId = Episodes.SeriesId diff --git a/src/NzbDrone.Core/Tags/Tag.cs b/src/NzbDrone.Core/Tags/Tag.cs index 824afa573..38cfdb432 100644 --- a/src/NzbDrone.Core/Tags/Tag.cs +++ b/src/NzbDrone.Core/Tags/Tag.cs @@ -5,6 +5,6 @@ namespace NzbDrone.Core.Tags { public class Tag : ModelBase { - public String Label { get; set; } + public string Label { get; set; } } } diff --git a/src/NzbDrone.Core/Tags/TagService.cs b/src/NzbDrone.Core/Tags/TagService.cs index 599aa51d4..76b6f79d7 100644 --- a/src/NzbDrone.Core/Tags/TagService.cs +++ b/src/NzbDrone.Core/Tags/TagService.cs @@ -7,11 +7,11 @@ namespace NzbDrone.Core.Tags { public interface ITagService { - Tag GetTag(Int32 tagId); + Tag GetTag(int tagId); List All(); Tag Add(Tag tag); Tag Update(Tag tag); - void Delete(Int32 tagId); + void Delete(int tagId); } public class TagService : ITagService @@ -25,7 +25,7 @@ public TagService(ITagRepository repo, IEventAggregator eventAggregator) _eventAggregator = eventAggregator; } - public Tag GetTag(Int32 tagId) + public Tag GetTag(int tagId) { return _repo.Get(tagId); } @@ -57,7 +57,7 @@ public Tag Update(Tag tag) return tag; } - public void Delete(Int32 tagId) + public void Delete(int tagId) { _repo.Delete(tagId); _eventAggregator.PublishEvent(new TagsUpdatedEvent()); diff --git a/src/NzbDrone.Core/Tv/Actor.cs b/src/NzbDrone.Core/Tv/Actor.cs index 3612e2f78..6de8ff62d 100644 --- a/src/NzbDrone.Core/Tv/Actor.cs +++ b/src/NzbDrone.Core/Tv/Actor.cs @@ -11,8 +11,8 @@ public Actor() Images = new List(); } - public String Name { get; set; } - public String Character { get; set; } + public string Name { get; set; } + public string Character { get; set; } public List Images { get; set; } } } diff --git a/src/NzbDrone.Core/Tv/Commands/MoveSeriesCommand.cs b/src/NzbDrone.Core/Tv/Commands/MoveSeriesCommand.cs index 59f0729bd..1c7ea3131 100644 --- a/src/NzbDrone.Core/Tv/Commands/MoveSeriesCommand.cs +++ b/src/NzbDrone.Core/Tv/Commands/MoveSeriesCommand.cs @@ -5,9 +5,9 @@ namespace NzbDrone.Core.Tv.Commands { public class MoveSeriesCommand : Command { - public Int32 SeriesId { get; set; } - public String SourcePath { get; set; } - public String DestinationPath { get; set; } - public String DestinationRootFolder { get; set; } + public int SeriesId { get; set; } + public string SourcePath { get; set; } + public string DestinationPath { get; set; } + public string DestinationRootFolder { get; set; } } } diff --git a/src/NzbDrone.Core/Tv/Episode.cs b/src/NzbDrone.Core/Tv/Episode.cs index ea4658249..3f0c18b32 100644 --- a/src/NzbDrone.Core/Tv/Episode.cs +++ b/src/NzbDrone.Core/Tv/Episode.cs @@ -24,7 +24,7 @@ public Episode() public string AirDate { get; set; } public DateTime? AirDateUtc { get; set; } public string Overview { get; set; } - public Boolean Monitored { get; set; } + public bool Monitored { get; set; } public Nullable AbsoluteEpisodeNumber { get; set; } public Nullable SceneAbsoluteEpisodeNumber { get; set; } public Nullable SceneSeasonNumber { get; set; } @@ -33,13 +33,13 @@ public Episode() public Ratings Ratings { get; set; } public List Images { get; set; } - public String SeriesTitle { get; private set; } + public string SeriesTitle { get; private set; } public LazyLoaded EpisodeFile { get; set; } public Series Series { get; set; } - public Boolean HasFile + public bool HasFile { get { return EpisodeFileId > 0; } } diff --git a/src/NzbDrone.Core/Tv/EpisodeRepository.cs b/src/NzbDrone.Core/Tv/EpisodeRepository.cs index b40eab013..5a1f413ad 100644 --- a/src/NzbDrone.Core/Tv/EpisodeRepository.cs +++ b/src/NzbDrone.Core/Tv/EpisodeRepository.cs @@ -221,23 +221,23 @@ private SortBuilder EpisodesWhereCutoffUnmetQuery(PagingSpec p private string BuildAirDateUtcCutoffWhereClause(DateTime currentTime) { - return String.Format("WHERE datetime(strftime('%s', [t0].[AirDateUtc]) + [t1].[RunTime] * 60, 'unixepoch') <= '{0}'", + return string.Format("WHERE datetime(strftime('%s', [t0].[AirDateUtc]) + [t1].[RunTime] * 60, 'unixepoch') <= '{0}'", currentTime.ToString("yyyy-MM-dd HH:mm:ss")); } private string BuildQualityCutoffWhereClause(List qualitiesBelowCutoff) { - var clauses = new List(); + var clauses = new List(); foreach (var profile in qualitiesBelowCutoff) { foreach (var belowCutoff in profile.QualityIds) { - clauses.Add(String.Format("([t1].[ProfileId] = {0} AND [t2].[Quality] LIKE '%_quality_: {1},%')", profile.ProfileId, belowCutoff)); + clauses.Add(string.Format("([t1].[ProfileId] = {0} AND [t2].[Quality] LIKE '%_quality_: {1},%')", profile.ProfileId, belowCutoff)); } } - return String.Format("({0})", String.Join(" OR ", clauses)); + return string.Format("({0})", string.Join(" OR ", clauses)); } private Episode FindOneByAirDate(int seriesId, string date) diff --git a/src/NzbDrone.Core/Tv/EpisodeService.cs b/src/NzbDrone.Core/Tv/EpisodeService.cs index e2d7cd39d..107ac669c 100644 --- a/src/NzbDrone.Core/Tv/EpisodeService.cs +++ b/src/NzbDrone.Core/Tv/EpisodeService.cs @@ -14,14 +14,14 @@ namespace NzbDrone.Core.Tv public interface IEpisodeService { Episode GetEpisode(int id); - List GetEpisodes(IEnumerable ids); + List GetEpisodes(IEnumerable ids); Episode FindEpisode(int seriesId, int seasonNumber, int episodeNumber); Episode FindEpisode(int seriesId, int absoluteEpisodeNumber); Episode FindEpisodeByTitle(int seriesId, int seasonNumber, string releaseTitle); List FindEpisodesBySceneNumbering(int seriesId, int seasonNumber, int episodeNumber); Episode FindEpisodeBySceneNumbering(int seriesId, int sceneAbsoluteEpisodeNumber); - Episode GetEpisode(int seriesId, String date); - Episode FindEpisode(int seriesId, String date); + Episode GetEpisode(int seriesId, string date); + Episode FindEpisode(int seriesId, string date); List GetEpisodeBySeries(int seriesId); List GetEpisodesBySeason(int seriesId, int seasonNumber); List EpisodesWithFiles(int seriesId); @@ -83,12 +83,12 @@ public Episode FindEpisodeBySceneNumbering(int seriesId, int sceneAbsoluteEpisod return _episodeRepository.FindEpisodeBySceneNumbering(seriesId, sceneAbsoluteEpisodeNumber); } - public Episode GetEpisode(int seriesId, String date) + public Episode GetEpisode(int seriesId, string date) { return _episodeRepository.Get(seriesId, date); } - public Episode FindEpisode(int seriesId, String date) + public Episode FindEpisode(int seriesId, string date) { return _episodeRepository.Find(seriesId, date); } diff --git a/src/NzbDrone.Core/Tv/Events/SeriesDeletedEvent.cs b/src/NzbDrone.Core/Tv/Events/SeriesDeletedEvent.cs index 865edd442..59416c10c 100644 --- a/src/NzbDrone.Core/Tv/Events/SeriesDeletedEvent.cs +++ b/src/NzbDrone.Core/Tv/Events/SeriesDeletedEvent.cs @@ -6,9 +6,9 @@ namespace NzbDrone.Core.Tv.Events public class SeriesDeletedEvent : IEvent { public Series Series { get; private set; } - public Boolean DeleteFiles { get; private set; } + public bool DeleteFiles { get; private set; } - public SeriesDeletedEvent(Series series, Boolean deleteFiles) + public SeriesDeletedEvent(Series series, bool deleteFiles) { Series = series; DeleteFiles = deleteFiles; diff --git a/src/NzbDrone.Core/Tv/Events/SeriesMovedEvent.cs b/src/NzbDrone.Core/Tv/Events/SeriesMovedEvent.cs index 7d4b42654..aa69dc2f4 100644 --- a/src/NzbDrone.Core/Tv/Events/SeriesMovedEvent.cs +++ b/src/NzbDrone.Core/Tv/Events/SeriesMovedEvent.cs @@ -6,8 +6,8 @@ namespace NzbDrone.Core.Tv.Events public class SeriesMovedEvent : IEvent { public Series Series { get; set; } - public String SourcePath { get; set; } - public String DestinationPath { get; set; } + public string SourcePath { get; set; } + public string DestinationPath { get; set; } public SeriesMovedEvent(Series series, string sourcePath, string destinationPath) { diff --git a/src/NzbDrone.Core/Tv/MoveSeriesService.cs b/src/NzbDrone.Core/Tv/MoveSeriesService.cs index 57726157b..be5b66403 100644 --- a/src/NzbDrone.Core/Tv/MoveSeriesService.cs +++ b/src/NzbDrone.Core/Tv/MoveSeriesService.cs @@ -54,7 +54,7 @@ public void Execute(MoveSeriesCommand message) } catch (IOException ex) { - var errorMessage = String.Format("Unable to move series from '{0}' to '{1}'", source, destination); + var errorMessage = string.Format("Unable to move series from '{0}' to '{1}'", source, destination); _logger.ErrorException(errorMessage, ex); throw; diff --git a/src/NzbDrone.Core/Tv/RefreshEpisodeService.cs b/src/NzbDrone.Core/Tv/RefreshEpisodeService.cs index 50bc36aef..8f64fed24 100644 --- a/src/NzbDrone.Core/Tv/RefreshEpisodeService.cs +++ b/src/NzbDrone.Core/Tv/RefreshEpisodeService.cs @@ -77,7 +77,7 @@ public void RefreshEpisodeInfo(Series series, IEnumerable remoteEpisode } catch (Exception e) { - _logger.FatalException(String.Format("An error has occurred while updating episode info for series {0}. {1}", series, episode), e); + _logger.FatalException(string.Format("An error has occurred while updating episode info for series {0}. {1}", series, episode), e); failCount++; } } diff --git a/src/NzbDrone.Core/Tv/Season.cs b/src/NzbDrone.Core/Tv/Season.cs index 9b3863f83..6d4d38688 100644 --- a/src/NzbDrone.Core/Tv/Season.cs +++ b/src/NzbDrone.Core/Tv/Season.cs @@ -12,7 +12,7 @@ public Season() } public int SeasonNumber { get; set; } - public Boolean Monitored { get; set; } + public bool Monitored { get; set; } public List Images { get; set; } } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Tv/Series.cs b/src/NzbDrone.Core/Tv/Series.cs index 47e0e9d67..61046df5c 100644 --- a/src/NzbDrone.Core/Tv/Series.cs +++ b/src/NzbDrone.Core/Tv/Series.cs @@ -12,10 +12,10 @@ public class Series : ModelBase public Series() { Images = new List(); - Genres = new List(); + Genres = new List(); Actors = new List(); Seasons = new List(); - Tags = new HashSet(); + Tags = new HashSet(); } public int TvdbId { get; set; } @@ -40,7 +40,7 @@ public Series() public string Path { get; set; } public int Year { get; set; } public Ratings Ratings { get; set; } - public List Genres { get; set; } + public List Genres { get; set; } public List Actors { get; set; } public string Certification { get; set; } public string RootFolderPath { get; set; } @@ -49,12 +49,12 @@ public Series() public LazyLoaded Profile { get; set; } public List Seasons { get; set; } - public HashSet Tags { get; set; } + public HashSet Tags { get; set; } public AddSeriesOptions AddOptions { get; set; } public override string ToString() { - return String.Format("[{0}][{1}]", TvdbId, Title.NullSafe()); + return string.Format("[{0}][{1}]", TvdbId, Title.NullSafe()); } } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Tv/SeriesService.cs b/src/NzbDrone.Core/Tv/SeriesService.cs index 6603eef77..8a8966d93 100644 --- a/src/NzbDrone.Core/Tv/SeriesService.cs +++ b/src/NzbDrone.Core/Tv/SeriesService.cs @@ -69,7 +69,7 @@ public Series AddSeries(Series newSeries) { Ensure.That(newSeries, () => newSeries).IsNotNull(); - if (String.IsNullOrWhiteSpace(newSeries.Path)) + if (string.IsNullOrWhiteSpace(newSeries.Path)) { var folderName = _fileNameBuilder.GetSeriesFolder(newSeries); newSeries.Path = Path.Combine(newSeries.RootFolderPath, folderName); diff --git a/src/NzbDrone.Core/Tv/SeriesTitleNormalizer.cs b/src/NzbDrone.Core/Tv/SeriesTitleNormalizer.cs index 23b995ebf..7e2bb1a2e 100644 --- a/src/NzbDrone.Core/Tv/SeriesTitleNormalizer.cs +++ b/src/NzbDrone.Core/Tv/SeriesTitleNormalizer.cs @@ -5,14 +5,14 @@ namespace NzbDrone.Core.Tv { public static class SeriesTitleNormalizer { - private readonly static Dictionary PreComputedTitles = new Dictionary + private readonly static Dictionary PreComputedTitles = new Dictionary { { 281588, "a to z" }, { 266757, "ad trials triumph early church" }, { 289260, "ad bible continues"} }; - public static String Normalize(String title, Int32 tvdbId) + public static string Normalize(string title, int tvdbId) { if (PreComputedTitles.ContainsKey(tvdbId)) { diff --git a/src/NzbDrone.Core/Update/InstallUpdateService.cs b/src/NzbDrone.Core/Update/InstallUpdateService.cs index acf34fb41..3303457b8 100644 --- a/src/NzbDrone.Core/Update/InstallUpdateService.cs +++ b/src/NzbDrone.Core/Update/InstallUpdateService.cs @@ -145,7 +145,7 @@ private void EnsureValidBranch(UpdatePackage package) } } - private void InstallUpdateWithScript(String updateSandboxFolder) + private void InstallUpdateWithScript(string updateSandboxFolder) { var scriptPath = _configFileProvider.UpdateScriptPath; @@ -171,7 +171,7 @@ private string GetUpdaterArgs(string updateSandboxFolder) var processId = _processProvider.GetCurrentProcess().Id.ToString(); var executingApplication = _runtimeInfo.ExecutingApplication; - return String.Join(" ", processId, updateSandboxFolder.TrimEnd(Path.DirectorySeparatorChar).WrapInQuotes(), executingApplication.WrapInQuotes(), _startupContext.PreservedArguments); + return string.Join(" ", processId, updateSandboxFolder.TrimEnd(Path.DirectorySeparatorChar).WrapInQuotes(), executingApplication.WrapInQuotes(), _startupContext.PreservedArguments); } private void EnsureAppDataSafety() diff --git a/src/NzbDrone.Core/Update/UpdateChanges.cs b/src/NzbDrone.Core/Update/UpdateChanges.cs index a26bba93b..4b56299c9 100644 --- a/src/NzbDrone.Core/Update/UpdateChanges.cs +++ b/src/NzbDrone.Core/Update/UpdateChanges.cs @@ -5,13 +5,13 @@ namespace NzbDrone.Core.Update { public class UpdateChanges { - public List New { get; set; } - public List Fixed { get; set; } + public List New { get; set; } + public List Fixed { get; set; } public UpdateChanges() { - New = new List(); - Fixed = new List(); + New = new List(); + Fixed = new List(); } } } diff --git a/src/NzbDrone.Core/Update/UpdatePackage.cs b/src/NzbDrone.Core/Update/UpdatePackage.cs index e2408d601..1583280cb 100644 --- a/src/NzbDrone.Core/Update/UpdatePackage.cs +++ b/src/NzbDrone.Core/Update/UpdatePackage.cs @@ -7,10 +7,10 @@ public class UpdatePackage { public Version Version { get; set; } public DateTime ReleaseDate { get; set; } - public String FileName { get; set; } - public String Url { get; set; } + public string FileName { get; set; } + public string Url { get; set; } public UpdateChanges Changes { get; set; } - public String Hash { get; set; } - public String Branch { get; set; } + public string Hash { get; set; } + public string Branch { get; set; } } } diff --git a/src/NzbDrone.Core/Update/UpdatePackageAvailable.cs b/src/NzbDrone.Core/Update/UpdatePackageAvailable.cs index c6b99b446..0c96ea584 100644 --- a/src/NzbDrone.Core/Update/UpdatePackageAvailable.cs +++ b/src/NzbDrone.Core/Update/UpdatePackageAvailable.cs @@ -4,7 +4,7 @@ namespace NzbDrone.Core.Update { public class UpdatePackageAvailable { - public Boolean Available { get; set; } + public bool Available { get; set; } public UpdatePackage UpdatePackage { get; set; } } } diff --git a/src/NzbDrone.Core/Update/UpdateVerification.cs b/src/NzbDrone.Core/Update/UpdateVerification.cs index 0f2131928..eca5afb0c 100644 --- a/src/NzbDrone.Core/Update/UpdateVerification.cs +++ b/src/NzbDrone.Core/Update/UpdateVerification.cs @@ -5,7 +5,7 @@ namespace NzbDrone.Core.Update { public interface IVerifyUpdates { - Boolean Verify(UpdatePackage updatePackage, String packagePath); + bool Verify(UpdatePackage updatePackage, string packagePath); } public class UpdateVerification : IVerifyUpdates @@ -17,7 +17,7 @@ public UpdateVerification(IDiskProvider diskProvider) _diskProvider = diskProvider; } - public Boolean Verify(UpdatePackage updatePackage, String packagePath) + public bool Verify(UpdatePackage updatePackage, string packagePath) { using (var fileStream = _diskProvider.OpenReadStream(packagePath)) { diff --git a/src/NzbDrone.Core/Validation/Paths/DroneFactoryValidator.cs b/src/NzbDrone.Core/Validation/Paths/DroneFactoryValidator.cs index 897299674..178b565e5 100644 --- a/src/NzbDrone.Core/Validation/Paths/DroneFactoryValidator.cs +++ b/src/NzbDrone.Core/Validation/Paths/DroneFactoryValidator.cs @@ -21,7 +21,7 @@ protected override bool IsValid(PropertyValidatorContext context) var droneFactory = _configService.DownloadedEpisodesFolder; - if (String.IsNullOrWhiteSpace(droneFactory)) return true; + if (string.IsNullOrWhiteSpace(droneFactory)) return true; return !droneFactory.PathEquals(context.PropertyValue.ToString()); } diff --git a/src/NzbDrone.Host/AccessControl/SslAdapter.cs b/src/NzbDrone.Host/AccessControl/SslAdapter.cs index 7b4853833..1ea8ac38f 100644 --- a/src/NzbDrone.Host/AccessControl/SslAdapter.cs +++ b/src/NzbDrone.Host/AccessControl/SslAdapter.cs @@ -32,13 +32,13 @@ public void Register() if (!_configFileProvider.EnableSsl) return; if (IsRegistered()) return; - if (String.IsNullOrWhiteSpace(_configFileProvider.SslCertHash)) + if (string.IsNullOrWhiteSpace(_configFileProvider.SslCertHash)) { _logger.Warn("Unable to enable SSL, SSL Cert Hash is required"); return; } - var arguments = String.Format("http add sslcert ipport=0.0.0.0:{0} certhash={1} appid={{{2}}}", + var arguments = string.Format("http add sslcert ipport=0.0.0.0:{0} certhash={1} appid={{{2}}}", _configFileProvider.SslPort, _configFileProvider.SslCertHash, APP_ID); @@ -50,7 +50,7 @@ public void Register() private bool IsRegistered() { var ipPort = "0.0.0.0:" + _configFileProvider.SslPort; - var arguments = String.Format("http show sslcert ipport={0}", ipPort); + var arguments = string.Format("http show sslcert ipport={0}", ipPort); var output = _netshProvider.Run(arguments); @@ -79,7 +79,7 @@ private bool IsRegistered() private void Unregister() { var ipPort = "0.0.0.0:" + _configFileProvider.SslPort; - var arguments = String.Format("http delete sslcert ipport={0}", ipPort); + var arguments = string.Format("http delete sslcert ipport={0}", ipPort); _netshProvider.Run(arguments); } diff --git a/src/NzbDrone.Host/AccessControl/UrlAcl.cs b/src/NzbDrone.Host/AccessControl/UrlAcl.cs index c53ba857b..cfcbd855a 100644 --- a/src/NzbDrone.Host/AccessControl/UrlAcl.cs +++ b/src/NzbDrone.Host/AccessControl/UrlAcl.cs @@ -13,7 +13,7 @@ public string Url { get { - return String.Format("{0}://{1}:{2}/{3}", Scheme, Address, Port, UrlBase); + return string.Format("{0}://{1}:{2}/{3}", Scheme, Address, Port, UrlBase); } } } diff --git a/src/NzbDrone.Host/AccessControl/UrlAclAdapter.cs b/src/NzbDrone.Host/AccessControl/UrlAclAdapter.cs index 85f4a1d9b..63d03b3d2 100644 --- a/src/NzbDrone.Host/AccessControl/UrlAclAdapter.cs +++ b/src/NzbDrone.Host/AccessControl/UrlAclAdapter.cs @@ -13,7 +13,7 @@ namespace NzbDrone.Host.AccessControl public interface IUrlAclAdapter { void ConfigureUrls(); - List Urls { get; } + List Urls { get; } } public class UrlAclAdapter : IUrlAclAdapter @@ -23,7 +23,7 @@ public class UrlAclAdapter : IUrlAclAdapter private readonly IRuntimeInfo _runtimeInfo; private readonly Logger _logger; - public List Urls + public List Urls { get { @@ -132,7 +132,7 @@ private List GetRegisteredUrls() return new List(); } - var arguments = String.Format("http show urlacl"); + var arguments = string.Format("http show urlacl"); var output = _netshProvider.Run(arguments); if (output == null || !output.Standard.Any()) return new List(); @@ -159,7 +159,7 @@ private List GetRegisteredUrls() private void RegisterUrl(UrlAcl urlAcl) { - var arguments = String.Format("http add urlacl {0} sddl=D:(A;;GX;;;S-1-1-0)", urlAcl.Url); + var arguments = string.Format("http add urlacl {0} sddl=D:(A;;GX;;;S-1-1-0)", urlAcl.Url); _netshProvider.Run(arguments); } @@ -180,7 +180,7 @@ private void UnregisterUrl(UrlAcl urlAcl) { _logger.Trace("Removing URL ACL {0}", urlAcl.Url); - var arguments = String.Format("http delete urlacl {0}", urlAcl.Url); + var arguments = string.Format("http delete urlacl {0}", urlAcl.Url); _netshProvider.Run(arguments); } @@ -205,7 +205,7 @@ private List BuildUrlAcls(string scheme, string address, int port) Scheme = scheme, Address = address, Port = port, - UrlBase = String.Empty + UrlBase = string.Empty }); return urlAcls; diff --git a/src/NzbDrone.Host/MainAppContainerBuilder.cs b/src/NzbDrone.Host/MainAppContainerBuilder.cs index 73ee473b8..7c2cdc800 100644 --- a/src/NzbDrone.Host/MainAppContainerBuilder.cs +++ b/src/NzbDrone.Host/MainAppContainerBuilder.cs @@ -14,7 +14,7 @@ public class MainAppContainerBuilder : ContainerBuilderBase { public static IContainer BuildContainer(StartupContext args) { - var assemblies = new List + var assemblies = new List { "NzbDrone.Host", "NzbDrone.Common", diff --git a/src/NzbDrone.Integration.Test/SeriesEditorIntegrationTest.cs b/src/NzbDrone.Integration.Test/SeriesEditorIntegrationTest.cs index 6330a2151..de638452e 100644 --- a/src/NzbDrone.Integration.Test/SeriesEditorIntegrationTest.cs +++ b/src/NzbDrone.Integration.Test/SeriesEditorIntegrationTest.cs @@ -16,7 +16,7 @@ private void GivenExistingSeries() var newSeries = Series.Lookup(title).First(); newSeries.ProfileId = 1; - newSeries.Path = String.Format(@"C:\Test\{0}", title).AsOsAgnostic(); + newSeries.Path = string.Format(@"C:\Test\{0}", title).AsOsAgnostic(); Series.Post(newSeries); } diff --git a/src/NzbDrone.Libraries.Test/JsonTests/JsonFixture.cs b/src/NzbDrone.Libraries.Test/JsonTests/JsonFixture.cs index 6b9fe814b..9edcad0b3 100644 --- a/src/NzbDrone.Libraries.Test/JsonTests/JsonFixture.cs +++ b/src/NzbDrone.Libraries.Test/JsonTests/JsonFixture.cs @@ -12,7 +12,7 @@ public class JsonFixture : TestBase public class TypeWithNumbers { public int Int32 { get; set; } - public Int64 Int64 { get; set; } + public long Int64 { get; set; } public int? nullableIntIsNull { get; set; } public int? nullableWithValue { get; set; } } @@ -20,7 +20,7 @@ public class TypeWithNumbers [Test] public void should_be_able_to_deserialize_numbers() { - var quality = new TypeWithNumbers { Int32 = Int32.MaxValue, Int64 = Int64.MaxValue, nullableWithValue = 12 }; + var quality = new TypeWithNumbers { Int32 = int.MaxValue, Int64 = long.MaxValue, nullableWithValue = 12 }; var result = Json.Deserialize(quality.ToJson()); result.ShouldBeEquivalentTo(quality, o => o.IncludingAllRuntimeProperties()); diff --git a/src/NzbDrone.Mono/DiskProvider.cs b/src/NzbDrone.Mono/DiskProvider.cs index fc0bfa993..bd0eed33b 100644 --- a/src/NzbDrone.Mono/DiskProvider.cs +++ b/src/NzbDrone.Mono/DiskProvider.cs @@ -75,7 +75,7 @@ public override void SetPermissions(string path, string mask, string user, strin throw new LinuxPermissionsException("Error setting file permissions: " + error); } - if (String.IsNullOrWhiteSpace(user) || String.IsNullOrWhiteSpace(group)) + if (string.IsNullOrWhiteSpace(user) || string.IsNullOrWhiteSpace(group)) { Logger.Debug("User or Group for chown not configured, skipping chown."); return; @@ -162,7 +162,7 @@ public override bool TryCreateHardLink(string source, string destination) } catch (Exception ex) { - Logger.DebugException(String.Format("Hardlink '{0}' to '{1}' failed.", source, destination), ex); + Logger.DebugException(string.Format("Hardlink '{0}' to '{1}' failed.", source, destination), ex); return false; } } diff --git a/src/NzbDrone.Mono/MonoRuntimeProvider.cs b/src/NzbDrone.Mono/MonoRuntimeProvider.cs index b7a97d288..f985b681c 100644 --- a/src/NzbDrone.Mono/MonoRuntimeProvider.cs +++ b/src/NzbDrone.Mono/MonoRuntimeProvider.cs @@ -15,7 +15,7 @@ public MonoRuntimeProvider(Common.IServiceProvider serviceProvider, Logger logge _logger = logger; } - public override String RuntimeVersion + public override string RuntimeVersion { get { @@ -38,7 +38,7 @@ public override String RuntimeVersion _logger.ErrorException("Unable to get mono version: " + ex.Message, ex); } - return String.Empty; + return string.Empty; } } } diff --git a/src/NzbDrone.Test.Common/ExceptionVerification.cs b/src/NzbDrone.Test.Common/ExceptionVerification.cs index 82fe76927..b86220f7c 100644 --- a/src/NzbDrone.Test.Common/ExceptionVerification.cs +++ b/src/NzbDrone.Test.Common/ExceptionVerification.cs @@ -39,10 +39,10 @@ private static string GetLogsString(IEnumerable logs) string exception = ""; if (log.Exception != null) { - exception = String.Format("[{0}: {1}]", log.Exception.GetType(), log.Exception.Message); + exception = string.Format("[{0}: {1}]", log.Exception.GetType(), log.Exception.Message); } - errors += Environment.NewLine + String.Format("[{0}] {1}: {2} {3}", log.Level, log.LoggerName, log.FormattedMessage, exception); + errors += Environment.NewLine + string.Format("[{0}] {1}: {2} {3}", log.Level, log.LoggerName, log.FormattedMessage, exception); } return errors; } @@ -101,7 +101,7 @@ private static void Expected(LogLevel level, int count) if (levelLogs.Count != count) { - var message = String.Format("{0} {1}(s) were expected but {2} were logged.\n\r{3}", + var message = string.Format("{0} {1}(s) were expected but {2} were logged.\n\r{3}", count, level, levelLogs.Count, GetLogsString(levelLogs)); message = "\n\r****************************************************************************************\n\r" diff --git a/src/NzbDrone.Update/UpdateApp.cs b/src/NzbDrone.Update/UpdateApp.cs index 36a20563d..12e157344 100644 --- a/src/NzbDrone.Update/UpdateApp.cs +++ b/src/NzbDrone.Update/UpdateApp.cs @@ -100,7 +100,7 @@ private UpdateStartupContext ParseArgs(string[] args) private int ParseProcessId(string arg) { int id; - if (!Int32.TryParse(arg, out id) || id <= 0) + if (!int.TryParse(arg, out id) || id <= 0) { throw new ArgumentOutOfRangeException("arg", "Invalid process ID"); } diff --git a/src/NzbDrone.Update/UpdateContainerBuilder.cs b/src/NzbDrone.Update/UpdateContainerBuilder.cs index f9d59d69f..4dc5e9662 100644 --- a/src/NzbDrone.Update/UpdateContainerBuilder.cs +++ b/src/NzbDrone.Update/UpdateContainerBuilder.cs @@ -15,7 +15,7 @@ private UpdateContainerBuilder(IStartupContext startupContext, string[] assembli public static IContainer Build(IStartupContext startupContext) { - var assemblies = new List + var assemblies = new List { "NzbDrone.Update", "NzbDrone.Common" diff --git a/src/NzbDrone.Update/UpdateEngine/InstallUpdateService.cs b/src/NzbDrone.Update/UpdateEngine/InstallUpdateService.cs index f12f54dae..09ddeee7e 100644 --- a/src/NzbDrone.Update/UpdateEngine/InstallUpdateService.cs +++ b/src/NzbDrone.Update/UpdateEngine/InstallUpdateService.cs @@ -53,7 +53,7 @@ private void Verify(string targetFolder, int processId) { _logger.Info("Verifying requirements before update..."); - if (String.IsNullOrWhiteSpace(targetFolder)) + if (string.IsNullOrWhiteSpace(targetFolder)) throw new ArgumentException("Target folder can not be null or empty"); if (!_diskProvider.FolderExists(targetFolder)) diff --git a/src/NzbDrone.Update/UpdateStartupContext.cs b/src/NzbDrone.Update/UpdateStartupContext.cs index 51b6bf103..b518acdd9 100644 --- a/src/NzbDrone.Update/UpdateStartupContext.cs +++ b/src/NzbDrone.Update/UpdateStartupContext.cs @@ -4,8 +4,8 @@ namespace NzbDrone.Update { public class UpdateStartupContext { - public Int32 ProcessId { get; set; } - public String ExecutingApplication { get; set; } - public String UpdateLocation { get; set; } + public int ProcessId { get; set; } + public string ExecutingApplication { get; set; } + public string UpdateLocation { get; set; } } } diff --git a/src/NzbDrone.Windows/DiskProvider.cs b/src/NzbDrone.Windows/DiskProvider.cs index 26f76115e..7759fa062 100644 --- a/src/NzbDrone.Windows/DiskProvider.cs +++ b/src/NzbDrone.Windows/DiskProvider.cs @@ -112,7 +112,7 @@ public override bool TryCreateHardLink(string source, string destination) } catch (Exception ex) { - Logger.DebugException(String.Format("Hardlink '{0}' to '{1}' failed.", source, destination), ex); + Logger.DebugException(string.Format("Hardlink '{0}' to '{1}' failed.", source, destination), ex); return false; } } diff --git a/src/NzbDrone/SysTray/SysTrayApp.cs b/src/NzbDrone/SysTray/SysTrayApp.cs index 4f88819f8..6325593e1 100644 --- a/src/NzbDrone/SysTray/SysTrayApp.cs +++ b/src/NzbDrone/SysTray/SysTrayApp.cs @@ -38,7 +38,7 @@ public void Start() _trayMenu.MenuItems.Add("-"); _trayMenu.MenuItems.Add("Exit", OnExit); - _trayIcon.Text = String.Format("Sonarr - {0}", BuildInfo.Version); + _trayIcon.Text = string.Format("Sonarr - {0}", BuildInfo.Version); _trayIcon.Icon = Properties.Resources.NzbDroneIcon; _trayIcon.ContextMenu = _trayMenu;