Fixed: All compiler warnings

pull/3823/head
ta264 5 years ago committed by Qstick
parent abde842bf0
commit d0f13e16d5

@ -1,6 +1,8 @@
<Project> <Project>
<!-- Common to all Radarr Projects --> <!-- Common to all Radarr Projects -->
<PropertyGroup> <PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch> <TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers> <RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>

@ -41,8 +41,6 @@ namespace NzbDrone.Api.Movies
{ {
if (model == null) return null; if (model == null) return null;
AlternativeTitleResource resource = null;
return new AlternativeTitleResource return new AlternativeTitleResource
{ {
Id = model.Id, Id = model.Id,

@ -19,8 +19,6 @@ namespace NzbDrone.Core.Test.MediaFiles.MovieImport.Aggregation.Aggregators
private Mock<IAugmentQuality> _fileExtensionAugmenter; private Mock<IAugmentQuality> _fileExtensionAugmenter;
private Mock<IAugmentQuality> _nameAugmenter; private Mock<IAugmentQuality> _nameAugmenter;
private IEnumerable<IAugmentQuality> _qualityAugmenters;
[SetUp] [SetUp]
public void Setup() public void Setup()
{ {

@ -10,8 +10,9 @@ namespace NzbDrone.Core.Test.ParserTests.ParsingServiceTests.AugmentersTests
public abstract class AugmentMovieInfoFixture<TAugmenter> : CoreTest<TAugmenter> where TAugmenter : class, IAugmentParsedMovieInfo public abstract class AugmentMovieInfoFixture<TAugmenter> : CoreTest<TAugmenter> where TAugmenter : class, IAugmentParsedMovieInfo
{ {
protected ParsedMovieInfo MovieInfo; protected ParsedMovieInfo MovieInfo;
[SetUp] [SetUp]
public void Setup() public virtual void Setup()
{ {
MovieInfo = new ParsedMovieInfo MovieInfo = new ParsedMovieInfo
{ {

@ -1,14 +1,12 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using FluentAssertions; using FluentAssertions;
using FluentAssertions.Equivalency;
using Moq; using Moq;
using NUnit.Framework; using NUnit.Framework;
using NzbDrone.Core.History; using NzbDrone.Core.History;
using NzbDrone.Core.Indexers; using NzbDrone.Core.Indexers;
using NzbDrone.Core.Indexers.Rarbg; using NzbDrone.Core.Indexers.Rarbg;
using NzbDrone.Core.Languages; using NzbDrone.Core.Languages;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Augmenters; using NzbDrone.Core.Parser.Augmenters;
using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Parser.Model;
@ -20,8 +18,9 @@ namespace NzbDrone.Core.Test.ParserTests.ParsingServiceTests.AugmentersTests
private AugmentWithHistory _customSubject { get; set; } private AugmentWithHistory _customSubject { get; set; }
[SetUp] [SetUp]
public void Setup() public override void Setup()
{ {
base.Setup();
//Add multi indexer //Add multi indexer
GivenIndexerSettings(new RarbgSettings GivenIndexerSettings(new RarbgSettings
{ {

@ -1,13 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using FluentAssertions; using FluentAssertions;
using NUnit.Framework; using NUnit.Framework;
using NzbDrone.Core.Indexers; using NzbDrone.Core.Indexers;
using NzbDrone.Core.Indexers.Rarbg; using NzbDrone.Core.Indexers.Rarbg;
using NzbDrone.Core.Indexers.TorrentRss;
using NzbDrone.Core.Languages; using NzbDrone.Core.Languages;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Augmenters; using NzbDrone.Core.Parser.Augmenters;
using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Parser.Model;
@ -18,12 +14,6 @@ namespace NzbDrone.Core.Test.ParserTests.ParsingServiceTests.AugmentersTests
{ {
private IndexerDefinition _indexerDefinition; private IndexerDefinition _indexerDefinition;
[SetUp]
public void Setup()
{
}
private ReleaseInfo ReleaseInfoWithLanguages(params Language[] languages) private ReleaseInfo ReleaseInfoWithLanguages(params Language[] languages)
{ {
_indexerDefinition = new IndexerDefinition _indexerDefinition = new IndexerDefinition

@ -46,7 +46,7 @@ namespace NzbDrone.Core.CustomFormats
public override int GetHashCode() public override int GetHashCode()
{ {
return (Id != null ? Id.GetHashCode() : 0); return Id.GetHashCode();
} }
} }

@ -6,7 +6,6 @@ using NzbDrone.Common.Cache;
using NzbDrone.Common.Composition; using NzbDrone.Common.Composition;
using NzbDrone.Core.Blacklisting; using NzbDrone.Core.Blacklisting;
using NzbDrone.Core.Datastore; using NzbDrone.Core.Datastore;
using NzbDrone.Core.Download.Pending;
using NzbDrone.Core.History; using NzbDrone.Core.History;
using NzbDrone.Core.Lifecycle; using NzbDrone.Core.Lifecycle;
using NzbDrone.Core.MediaFiles; using NzbDrone.Core.MediaFiles;
@ -29,10 +28,7 @@ namespace NzbDrone.Core.CustomFormats
{ {
private readonly ICustomFormatRepository _formatRepository; private readonly ICustomFormatRepository _formatRepository;
private IProfileService _profileService; private IProfileService _profileService;
private readonly IMediaFileService _mediaFileService;
private readonly IBlacklistService _blacklistService;
private readonly IHistoryService _historyService; private readonly IHistoryService _historyService;
private readonly IPendingReleaseService _pendingReleaseService;
public IProfileService ProfileService public IProfileService ProfileService
{ {
@ -54,17 +50,12 @@ namespace NzbDrone.Core.CustomFormats
public static Dictionary<int, CustomFormat> AllCustomFormats; public static Dictionary<int, CustomFormat> AllCustomFormats;
public CustomFormatService(ICustomFormatRepository formatRepository, ICacheManager cacheManager, public CustomFormatService(ICustomFormatRepository formatRepository, ICacheManager cacheManager,
IContainer container, IHistoryService historyService,/*IMediaFileService mediaFileService, IBlacklistService blacklistService, IContainer container, IHistoryService historyService,
IHistoryService historyService, IPendingReleaseService pendingReleaseService,*/
Logger logger) Logger logger)
{ {
_formatRepository = formatRepository; _formatRepository = formatRepository;
_container = container; _container = container;
_cache = cacheManager.GetCache<Dictionary<int, CustomFormat>>(typeof(CustomFormat), "formats"); _cache = cacheManager.GetCache<Dictionary<int, CustomFormat>>(typeof(CustomFormat), "formats");
/*_mediaFileService = mediaFileService;
_blacklistService = blacklistService;
_historyService = historyService;
_pendingReleaseService = pendingReleaseService;*/
_historyService = historyService; _historyService = historyService;
_logger = logger; _logger = logger;
} }

@ -21,7 +21,6 @@ namespace NzbDrone.Core.Download.Clients.Hadouken
public class HadoukenProxy : IHadoukenProxy public class HadoukenProxy : IHadoukenProxy
{ {
private static int _callId;
private readonly IHttpClient _httpClient; private readonly IHttpClient _httpClient;
private readonly Logger _logger; private readonly Logger _logger;
@ -175,4 +174,4 @@ namespace NzbDrone.Core.Download.Clients.Hadouken
return HadoukenTorrentState.Unknown; return HadoukenTorrentState.Unknown;
} }
} }
} }

@ -13,8 +13,6 @@ namespace NzbDrone.Core.Instrumentation
{ {
public class DatabaseTarget : TargetWithLayout, IHandle<ApplicationShutdownRequested> public class DatabaseTarget : TargetWithLayout, IHandle<ApplicationShutdownRequested>
{ {
private readonly SQLiteConnection _connection;
private readonly IConnectionStringFactory _connectionStringFactory; private readonly IConnectionStringFactory _connectionStringFactory;
const string INSERT_COMMAND = "INSERT INTO [Logs]([Message],[Time],[Logger],[Exception],[ExceptionType],[Level]) " + const string INSERT_COMMAND = "INSERT INTO [Logs]([Message],[Time],[Logger],[Exception],[ExceptionType],[Level]) " +
@ -120,4 +118,4 @@ namespace NzbDrone.Core.Instrumentation
} }
} }
} }
} }

@ -156,13 +156,13 @@ namespace NzbDrone.Core.MediaFiles
_diskProvider.MoveFolder(oldFolder, movie.Path); _diskProvider.MoveFolder(oldFolder, movie.Path);
if (false) // if (false)
{ // {
var movieFiles = _mediaFileService.GetFilesByMovie(movie.Id); // var movieFiles = _mediaFileService.GetFilesByMovie(movie.Id);
_logger.ProgressInfo("Renaming movie files for {0}", movie.Title); // _logger.ProgressInfo("Renaming movie files for {0}", movie.Title);
RenameFiles(movieFiles, movie, oldFolder); // RenameFiles(movieFiles, movie, oldFolder);
_logger.ProgressInfo("All movie files renamed for {0}", movie.Title); // _logger.ProgressInfo("All movie files renamed for {0}", movie.Title);
} // }
_movieService.UpdateMovie(movie); _movieService.UpdateMovie(movie);

@ -63,6 +63,8 @@ namespace NzbDrone.Core.MetadataSource.PreDB
private List<PreDBResult> GetResults(string category = "", string search = "") private List<PreDBResult> GetResults(string category = "", string search = "")
{ {
return new List<PreDBResult>(); return new List<PreDBResult>();
/* PreDB is blocked
var builder = new HttpRequestBuilder("http://predb.me").AddQueryParam("rss", "1"); var builder = new HttpRequestBuilder("http://predb.me").AddQueryParam("rss", "1");
if (category.IsNotNullOrWhiteSpace()) if (category.IsNotNullOrWhiteSpace())
{ {
@ -110,7 +112,7 @@ namespace NzbDrone.Core.MetadataSource.PreDB
_logger.Error(ex, "Error while searching PreDB."); _logger.Error(ex, "Error while searching PreDB.");
} }
return new List<PreDBResult>(); return new List<PreDBResult>(); */
} }
private List<Movie> FindMatchesToResults(List<PreDBResult> results) private List<Movie> FindMatchesToResults(List<PreDBResult> results)

@ -56,6 +56,11 @@ namespace NzbDrone.Core.Movies.AlternativeTitles
return item.CleanTitle == this.CleanTitle; return item.CleanTitle == this.CleanTitle;
} }
public override int GetHashCode()
{
return CleanTitle.GetHashCode();
}
public override String ToString() public override String ToString()
{ {
return Title; return Title;

@ -3,8 +3,6 @@ using NzbDrone.Core.NetImport.Exceptions;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Text.RegularExpressions;
using NLog;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
namespace NzbDrone.Core.NetImport.CouchPotato namespace NzbDrone.Core.NetImport.CouchPotato
@ -13,7 +11,6 @@ namespace NzbDrone.Core.NetImport.CouchPotato
{ {
private readonly CouchPotatoSettings _settings; private readonly CouchPotatoSettings _settings;
private NetImportResponse _importResponse; private NetImportResponse _importResponse;
private readonly Logger _logger;
public CouchPotatoParser(CouchPotatoSettings settings) public CouchPotatoParser(CouchPotatoSettings settings)
{ {

@ -21,6 +21,5 @@ namespace NzbDrone.Core.NetImport
public LazyLoaded<Profile> Profile { get; set; } public LazyLoaded<Profile> Profile { get; set; }
public string RootFolderPath { get; set; } public string RootFolderPath { get; set; }
public override bool Enable => Enabled; public override bool Enable => Enabled;
public HashSet<int> Tags { get; set; }
} }
} }

@ -53,7 +53,7 @@ namespace NzbDrone.Core.NetImport.RSSImport
public override IParseNetImportResponse GetParser() public override IParseNetImportResponse GetParser()
{ {
return new RSSImportParser(Settings); return new RSSImportParser(Settings, _logger);
} }
} }
} }

@ -19,14 +19,16 @@ namespace NzbDrone.Core.NetImport.RSSImport
public class RSSImportParser : IParseNetImportResponse public class RSSImportParser : IParseNetImportResponse
{ {
private readonly RSSImportSettings _settings; private readonly RSSImportSettings _settings;
private NetImportResponse _importResponse;
private readonly Logger _logger; private readonly Logger _logger;
private NetImportResponse _importResponse;
private static readonly Regex ReplaceEntities = new Regex("&[a-z]+;", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex ReplaceEntities = new Regex("&[a-z]+;", RegexOptions.Compiled | RegexOptions.IgnoreCase);
public RSSImportParser(RSSImportSettings settings) public RSSImportParser(RSSImportSettings settings,
Logger logger)
{ {
_settings = settings; _settings = settings;
_logger = logger;
} }
public virtual IList<Movie> ParseResponse(NetImportResponse importResponse) public virtual IList<Movie> ParseResponse(NetImportResponse importResponse)

@ -15,8 +15,6 @@ namespace NzbDrone.Core.NetImport.Radarr
public override bool Enabled => true; public override bool Enabled => true;
public override bool EnableAuto => false; public override bool EnableAuto => false;
private readonly IHttpClient _httpClient;
private readonly Logger _logger;
private readonly ISearchForNewMovie _skyhookProxy; private readonly ISearchForNewMovie _skyhookProxy;
public RadarrLists(IHttpClient httpClient, IConfigService configService, IParsingService parsingService, ISearchForNewMovie skyhookProxy, public RadarrLists(IHttpClient httpClient, IConfigService configService, IParsingService parsingService, ISearchForNewMovie skyhookProxy,
@ -24,8 +22,6 @@ namespace NzbDrone.Core.NetImport.Radarr
: base(httpClient, configService, parsingService, logger) : base(httpClient, configService, parsingService, logger)
{ {
_skyhookProxy = skyhookProxy; _skyhookProxy = skyhookProxy;
_logger = logger;
_httpClient = httpClient;
} }
public override IEnumerable<ProviderDefinition> DefaultDefinitions public override IEnumerable<ProviderDefinition> DefaultDefinitions

@ -1,9 +1,5 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using NzbDrone.Core.NetImport.Exceptions;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net;
using NLog;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Core.MetadataSource.SkyHook.Resource; using NzbDrone.Core.MetadataSource.SkyHook.Resource;
using NzbDrone.Core.MetadataSource; using NzbDrone.Core.MetadataSource;
@ -17,7 +13,6 @@ namespace NzbDrone.Core.NetImport.Radarr
private readonly RadarrSettings _settings; private readonly RadarrSettings _settings;
private NetImportResponse _importResponse; private NetImportResponse _importResponse;
private readonly ISearchForNewMovie _skyhookProxy; private readonly ISearchForNewMovie _skyhookProxy;
private readonly Logger _logger;
public RadarrParser(RadarrSettings settings, ISearchForNewMovie skyhookProxy) public RadarrParser(RadarrSettings settings, ISearchForNewMovie skyhookProxy)
{ {
@ -75,4 +70,4 @@ namespace NzbDrone.Core.NetImport.Radarr
} }
} }
} }

@ -11,7 +11,6 @@ namespace NzbDrone.Core.NetImport.StevenLu
{ {
private readonly StevenLuSettings _settings; private readonly StevenLuSettings _settings;
private NetImportResponse _importResponse; private NetImportResponse _importResponse;
private readonly Logger _logger;
public StevenLuParser(StevenLuSettings settings) public StevenLuParser(StevenLuSettings settings)
{ {

@ -13,16 +13,12 @@ namespace NzbDrone.Core.NetImport.TMDb
public override bool Enabled => true; public override bool Enabled => true;
public override bool EnableAuto => false; public override bool EnableAuto => false;
private readonly IHttpClient _httpClient;
private readonly Logger _logger;
private readonly ISearchForNewMovie _skyhookProxy; private readonly ISearchForNewMovie _skyhookProxy;
public TMDbImport(IHttpClient httpClient, IConfigService configService, IParsingService parsingService, ISearchForNewMovie skyhookProxy, public TMDbImport(IHttpClient httpClient, IConfigService configService, IParsingService parsingService, ISearchForNewMovie skyhookProxy,
Logger logger) Logger logger)
: base(httpClient, configService, parsingService, logger) : base(httpClient, configService, parsingService, logger)
{ {
_logger = logger;
_httpClient = httpClient;
_skyhookProxy = skyhookProxy; _skyhookProxy = skyhookProxy;
} }
@ -41,4 +37,4 @@ namespace NzbDrone.Core.NetImport.TMDb
return new TMDbParser(Settings, _skyhookProxy); return new TMDbParser(Settings, _skyhookProxy);
} }
} }
} }

@ -1,13 +1,10 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using NzbDrone.Core.NetImport.Exceptions; using NzbDrone.Core.NetImport.Exceptions;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net; using System.Net;
using NLog;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Core.MetadataSource.SkyHook.Resource; using NzbDrone.Core.MetadataSource.SkyHook.Resource;
using NzbDrone.Core.MetadataSource; using NzbDrone.Core.MetadataSource;
using TinyIoC;
namespace NzbDrone.Core.NetImport.TMDb namespace NzbDrone.Core.NetImport.TMDb
{ {
@ -16,7 +13,6 @@ namespace NzbDrone.Core.NetImport.TMDb
private readonly TMDbSettings _settings; private readonly TMDbSettings _settings;
private NetImportResponse _importResponse; private NetImportResponse _importResponse;
private readonly ISearchForNewMovie _skyhookProxy; private readonly ISearchForNewMovie _skyhookProxy;
private readonly Logger _logger;
public TMDbParser(TMDbSettings settings, ISearchForNewMovie skyhookProxy) public TMDbParser(TMDbSettings settings, ISearchForNewMovie skyhookProxy)
{ {
@ -96,4 +92,4 @@ namespace NzbDrone.Core.NetImport.TMDb
} }
} }
} }

@ -11,14 +11,9 @@ namespace NzbDrone.Core.NetImport.Trakt
public override bool Enabled => true; public override bool Enabled => true;
public override bool EnableAuto => false; public override bool EnableAuto => false;
private readonly IHttpClient _httpClient;
public IConfigService _configService;
public TraktImport(IHttpClient httpClient, IConfigService configService, IParsingService parsingService, Logger logger) public TraktImport(IHttpClient httpClient, IConfigService configService, IParsingService parsingService, Logger logger)
: base(httpClient, configService, parsingService, logger) : base(httpClient, configService, parsingService, logger)
{ {
_configService = configService;
_httpClient = httpClient;
} }
public override INetImportRequestGenerator GetRequestGenerator() public override INetImportRequestGenerator GetRequestGenerator()

@ -11,7 +11,6 @@ namespace NzbDrone.Core.NetImport.Trakt
{ {
private readonly TraktSettings _settings; private readonly TraktSettings _settings;
private NetImportResponse _importResponse; private NetImportResponse _importResponse;
private readonly Logger _logger;
public TraktParser(TraktSettings settings) public TraktParser(TraktSettings settings)
{ {

@ -62,7 +62,7 @@ namespace Radarr.Host
private readonly IBrowserService _browserService; private readonly IBrowserService _browserService;
private readonly IContainer _container; private readonly IContainer _container;
private readonly Logger _logger; private readonly Logger _logger;
private CancelHandler _cancelHandler; // private CancelHandler _cancelHandler;
public NzbDroneConsoleFactory(IConfigFileProvider configFileProvider, public NzbDroneConsoleFactory(IConfigFileProvider configFileProvider,
IHostController hostController, IHostController hostController,

@ -40,7 +40,7 @@ namespace NzbDrone.Integration.Test.Client
public SimpleCommandResource PostAndWait<T>(T command) where T : Command, new() public SimpleCommandResource PostAndWait<T>(T command) where T : Command, new()
{ {
var request = BuildRequest(); var request = BuildRequest();
request.AddBody(command); request.AddJsonBody(command);
var result = Post<SimpleCommandResource>(request); var result = Post<SimpleCommandResource>(request);
result.Id.Should().NotBe(0); result.Id.Should().NotBe(0);

@ -215,7 +215,7 @@ namespace NzbDrone.Integration.Test
connected = true; connected = true;
break; break;
} }
catch (Exception e) catch (Exception)
{ {
if (retryCount > 25) if (retryCount > 25)
{ {

@ -29,13 +29,15 @@ namespace Radarr.Api.V2.MovieFiles
private readonly Logger _logger; private readonly Logger _logger;
public MovieFileModule(IBroadcastSignalRMessage signalRBroadcaster, public MovieFileModule(IBroadcastSignalRMessage signalRBroadcaster,
IMediaFileService mediaFileService, IMediaFileService mediaFileService,
IMovieService movieService, IRecycleBinProvider recycleBinProvider,
IUpgradableSpecification qualityUpgradableSpecification, IMovieService movieService,
Logger logger) IUpgradableSpecification qualityUpgradableSpecification,
Logger logger)
: base(signalRBroadcaster) : base(signalRBroadcaster)
{ {
_mediaFileService = mediaFileService; _mediaFileService = mediaFileService;
_recycleBinProvider = recycleBinProvider;
_movieService = movieService; _movieService = movieService;
_qualityUpgradableSpecification = qualityUpgradableSpecification; _qualityUpgradableSpecification = qualityUpgradableSpecification;
_logger = logger; _logger = logger;

@ -36,8 +36,6 @@ namespace Radarr.Api.V2.Movies
{ {
if (model == null) return null; if (model == null) return null;
AlternativeTitleResource resource = null;
return new AlternativeTitleResource return new AlternativeTitleResource
{ {
Id = model.Id, Id = model.Id,

@ -1,7 +1,6 @@
using System.IO; using System.IO;
using NLog; using NLog;
using NzbDrone.Common.Disk; using NzbDrone.Common.Disk;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Core.Backup; using NzbDrone.Core.Backup;
namespace Radarr.Http.Frontend.Mappers namespace Radarr.Http.Frontend.Mappers
@ -9,7 +8,6 @@ namespace Radarr.Http.Frontend.Mappers
public class BackupFileMapper : StaticResourceMapperBase public class BackupFileMapper : StaticResourceMapperBase
{ {
private readonly IBackupService _backupService; private readonly IBackupService _backupService;
private readonly IAppFolderInfo _appFolderInfo;
public BackupFileMapper(IBackupService backupService, IDiskProvider diskProvider, Logger logger) public BackupFileMapper(IBackupService backupService, IDiskProvider diskProvider, Logger logger)
: base(diskProvider, logger) : base(diskProvider, logger)

Loading…
Cancel
Save