mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-18 08:19:38 +02:00
Fixed: All compiler warnings
This commit is contained in:
parent
abde842bf0
commit
d0f13e16d5
@ -1,6 +1,8 @@
|
||||
<Project>
|
||||
<!-- Common to all Radarr Projects -->
|
||||
<PropertyGroup>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
|
||||
|
@ -41,8 +41,6 @@ public static AlternativeTitleResource ToResource(this AlternativeTitle model)
|
||||
{
|
||||
if (model == null) return null;
|
||||
|
||||
AlternativeTitleResource resource = null;
|
||||
|
||||
return new AlternativeTitleResource
|
||||
{
|
||||
Id = model.Id,
|
||||
|
@ -19,8 +19,6 @@ public class AugmentQualityFixture : CoreTest<AggregateQuality>
|
||||
private Mock<IAugmentQuality> _fileExtensionAugmenter;
|
||||
private Mock<IAugmentQuality> _nameAugmenter;
|
||||
|
||||
private IEnumerable<IAugmentQuality> _qualityAugmenters;
|
||||
|
||||
[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
|
||||
{
|
||||
protected ParsedMovieInfo MovieInfo;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
public virtual void Setup()
|
||||
{
|
||||
MovieInfo = new ParsedMovieInfo
|
||||
{
|
||||
|
@ -1,14 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using FluentAssertions;
|
||||
using FluentAssertions.Equivalency;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.History;
|
||||
using NzbDrone.Core.Indexers;
|
||||
using NzbDrone.Core.Indexers.Rarbg;
|
||||
using NzbDrone.Core.Languages;
|
||||
using NzbDrone.Core.Parser;
|
||||
using NzbDrone.Core.Parser.Augmenters;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
|
||||
@ -20,8 +18,9 @@ public class AugmentWithHistoryFixture : AugmentMovieInfoFixture<AugmentWithHist
|
||||
private AugmentWithHistory _customSubject { get; set; }
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
public override void Setup()
|
||||
{
|
||||
base.Setup();
|
||||
//Add multi indexer
|
||||
GivenIndexerSettings(new RarbgSettings
|
||||
{
|
||||
|
@ -1,13 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Indexers;
|
||||
using NzbDrone.Core.Indexers.Rarbg;
|
||||
using NzbDrone.Core.Indexers.TorrentRss;
|
||||
using NzbDrone.Core.Languages;
|
||||
using NzbDrone.Core.Parser;
|
||||
using NzbDrone.Core.Parser.Augmenters;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
|
||||
@ -18,12 +14,6 @@ public class AugmentWithReleaseInfoFixture : AugmentMovieInfoFixture<AugmentWith
|
||||
{
|
||||
private IndexerDefinition _indexerDefinition;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private ReleaseInfo ReleaseInfoWithLanguages(params Language[] languages)
|
||||
{
|
||||
_indexerDefinition = new IndexerDefinition
|
||||
|
@ -46,7 +46,7 @@ public override bool Equals(object obj)
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return (Id != null ? Id.GetHashCode() : 0);
|
||||
return Id.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
using NzbDrone.Common.Composition;
|
||||
using NzbDrone.Core.Blacklisting;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.Download.Pending;
|
||||
using NzbDrone.Core.History;
|
||||
using NzbDrone.Core.Lifecycle;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
@ -29,10 +28,7 @@ public class CustomFormatService : ICustomFormatService, IHandle<ApplicationStar
|
||||
{
|
||||
private readonly ICustomFormatRepository _formatRepository;
|
||||
private IProfileService _profileService;
|
||||
private readonly IMediaFileService _mediaFileService;
|
||||
private readonly IBlacklistService _blacklistService;
|
||||
private readonly IHistoryService _historyService;
|
||||
private readonly IPendingReleaseService _pendingReleaseService;
|
||||
|
||||
public IProfileService ProfileService
|
||||
{
|
||||
@ -54,17 +50,12 @@ public IProfileService ProfileService
|
||||
public static Dictionary<int, CustomFormat> AllCustomFormats;
|
||||
|
||||
public CustomFormatService(ICustomFormatRepository formatRepository, ICacheManager cacheManager,
|
||||
IContainer container, IHistoryService historyService,/*IMediaFileService mediaFileService, IBlacklistService blacklistService,
|
||||
IHistoryService historyService, IPendingReleaseService pendingReleaseService,*/
|
||||
IContainer container, IHistoryService historyService,
|
||||
Logger logger)
|
||||
{
|
||||
_formatRepository = formatRepository;
|
||||
_container = container;
|
||||
_cache = cacheManager.GetCache<Dictionary<int, CustomFormat>>(typeof(CustomFormat), "formats");
|
||||
/*_mediaFileService = mediaFileService;
|
||||
_blacklistService = blacklistService;
|
||||
_historyService = historyService;
|
||||
_pendingReleaseService = pendingReleaseService;*/
|
||||
_historyService = historyService;
|
||||
_logger = logger;
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ public interface IHadoukenProxy
|
||||
|
||||
public class HadoukenProxy : IHadoukenProxy
|
||||
{
|
||||
private static int _callId;
|
||||
private readonly IHttpClient _httpClient;
|
||||
private readonly Logger _logger;
|
||||
|
||||
@ -175,4 +174,4 @@ private HadoukenTorrentState ParseState(int state)
|
||||
return HadoukenTorrentState.Unknown;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,8 +13,6 @@ namespace NzbDrone.Core.Instrumentation
|
||||
{
|
||||
public class DatabaseTarget : TargetWithLayout, IHandle<ApplicationShutdownRequested>
|
||||
{
|
||||
private readonly SQLiteConnection _connection;
|
||||
|
||||
private readonly IConnectionStringFactory _connectionStringFactory;
|
||||
|
||||
const string INSERT_COMMAND = "INSERT INTO [Logs]([Message],[Time],[Logger],[Exception],[ExceptionType],[Level]) " +
|
||||
@ -120,4 +118,4 @@ public void Handle(ApplicationShutdownRequested message)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -156,13 +156,13 @@ public void RenameMoviePath(Movie movie, bool shouldRenameFiles = true)
|
||||
|
||||
_diskProvider.MoveFolder(oldFolder, movie.Path);
|
||||
|
||||
if (false)
|
||||
{
|
||||
var movieFiles = _mediaFileService.GetFilesByMovie(movie.Id);
|
||||
_logger.ProgressInfo("Renaming movie files for {0}", movie.Title);
|
||||
RenameFiles(movieFiles, movie, oldFolder);
|
||||
_logger.ProgressInfo("All movie files renamed for {0}", movie.Title);
|
||||
}
|
||||
// if (false)
|
||||
// {
|
||||
// var movieFiles = _mediaFileService.GetFilesByMovie(movie.Id);
|
||||
// _logger.ProgressInfo("Renaming movie files for {0}", movie.Title);
|
||||
// RenameFiles(movieFiles, movie, oldFolder);
|
||||
// _logger.ProgressInfo("All movie files renamed for {0}", movie.Title);
|
||||
// }
|
||||
|
||||
_movieService.UpdateMovie(movie);
|
||||
|
||||
|
@ -63,6 +63,8 @@ public PreDBService(
|
||||
private List<PreDBResult> GetResults(string category = "", string search = "")
|
||||
{
|
||||
return new List<PreDBResult>();
|
||||
|
||||
/* PreDB is blocked
|
||||
var builder = new HttpRequestBuilder("http://predb.me").AddQueryParam("rss", "1");
|
||||
if (category.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
@ -110,7 +112,7 @@ private List<PreDBResult> GetResults(string category = "", string search = "")
|
||||
_logger.Error(ex, "Error while searching PreDB.");
|
||||
}
|
||||
|
||||
return new List<PreDBResult>();
|
||||
return new List<PreDBResult>(); */
|
||||
}
|
||||
|
||||
private List<Movie> FindMatchesToResults(List<PreDBResult> results)
|
||||
|
@ -56,6 +56,11 @@ public override bool Equals(object obj)
|
||||
return item.CleanTitle == this.CleanTitle;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return CleanTitle.GetHashCode();
|
||||
}
|
||||
|
||||
public override String ToString()
|
||||
{
|
||||
return Title;
|
||||
|
@ -3,8 +3,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text.RegularExpressions;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Extensions;
|
||||
|
||||
namespace NzbDrone.Core.NetImport.CouchPotato
|
||||
@ -13,7 +11,6 @@ public class CouchPotatoParser : IParseNetImportResponse
|
||||
{
|
||||
private readonly CouchPotatoSettings _settings;
|
||||
private NetImportResponse _importResponse;
|
||||
private readonly Logger _logger;
|
||||
|
||||
public CouchPotatoParser(CouchPotatoSettings settings)
|
||||
{
|
||||
|
@ -21,6 +21,5 @@ public NetImportDefinition()
|
||||
public LazyLoaded<Profile> Profile { get; set; }
|
||||
public string RootFolderPath { get; set; }
|
||||
public override bool Enable => Enabled;
|
||||
public HashSet<int> Tags { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public override INetImportRequestGenerator GetRequestGenerator()
|
||||
|
||||
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
|
||||
{
|
||||
private readonly RSSImportSettings _settings;
|
||||
private NetImportResponse _importResponse;
|
||||
private readonly Logger _logger;
|
||||
private NetImportResponse _importResponse;
|
||||
|
||||
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;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public virtual IList<Movie> ParseResponse(NetImportResponse importResponse)
|
||||
|
@ -15,8 +15,6 @@ public class RadarrLists : HttpNetImportBase<RadarrSettings>
|
||||
public override bool Enabled => true;
|
||||
public override bool EnableAuto => false;
|
||||
|
||||
private readonly IHttpClient _httpClient;
|
||||
private readonly Logger _logger;
|
||||
private readonly ISearchForNewMovie _skyhookProxy;
|
||||
|
||||
public RadarrLists(IHttpClient httpClient, IConfigService configService, IParsingService parsingService, ISearchForNewMovie skyhookProxy,
|
||||
@ -24,8 +22,6 @@ public RadarrLists(IHttpClient httpClient, IConfigService configService, IParsin
|
||||
: base(httpClient, configService, parsingService, logger)
|
||||
{
|
||||
_skyhookProxy = skyhookProxy;
|
||||
_logger = logger;
|
||||
_httpClient = httpClient;
|
||||
}
|
||||
|
||||
public override IEnumerable<ProviderDefinition> DefaultDefinitions
|
||||
|
@ -1,9 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using NzbDrone.Core.NetImport.Exceptions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.MetadataSource.SkyHook.Resource;
|
||||
using NzbDrone.Core.MetadataSource;
|
||||
@ -17,7 +13,6 @@ public class RadarrParser : IParseNetImportResponse
|
||||
private readonly RadarrSettings _settings;
|
||||
private NetImportResponse _importResponse;
|
||||
private readonly ISearchForNewMovie _skyhookProxy;
|
||||
private readonly Logger _logger;
|
||||
|
||||
public RadarrParser(RadarrSettings settings, ISearchForNewMovie skyhookProxy)
|
||||
{
|
||||
@ -75,4 +70,4 @@ protected virtual bool PreProcess(NetImportResponse indexerResponse)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ public class StevenLuParser : IParseNetImportResponse
|
||||
{
|
||||
private readonly StevenLuSettings _settings;
|
||||
private NetImportResponse _importResponse;
|
||||
private readonly Logger _logger;
|
||||
|
||||
public StevenLuParser(StevenLuSettings settings)
|
||||
{
|
||||
|
@ -13,16 +13,12 @@ public class TMDbImport : HttpNetImportBase<TMDbSettings>
|
||||
public override bool Enabled => true;
|
||||
public override bool EnableAuto => false;
|
||||
|
||||
private readonly IHttpClient _httpClient;
|
||||
private readonly Logger _logger;
|
||||
private readonly ISearchForNewMovie _skyhookProxy;
|
||||
|
||||
public TMDbImport(IHttpClient httpClient, IConfigService configService, IParsingService parsingService, ISearchForNewMovie skyhookProxy,
|
||||
Logger logger)
|
||||
: base(httpClient, configService, parsingService, logger)
|
||||
{
|
||||
_logger = logger;
|
||||
_httpClient = httpClient;
|
||||
_skyhookProxy = skyhookProxy;
|
||||
}
|
||||
|
||||
@ -41,4 +37,4 @@ public override IParseNetImportResponse GetParser()
|
||||
return new TMDbParser(Settings, _skyhookProxy);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,10 @@
|
||||
using Newtonsoft.Json;
|
||||
using NzbDrone.Core.NetImport.Exceptions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.MetadataSource.SkyHook.Resource;
|
||||
using NzbDrone.Core.MetadataSource;
|
||||
using TinyIoC;
|
||||
|
||||
namespace NzbDrone.Core.NetImport.TMDb
|
||||
{
|
||||
@ -16,7 +13,6 @@ public class TMDbParser : IParseNetImportResponse
|
||||
private readonly TMDbSettings _settings;
|
||||
private NetImportResponse _importResponse;
|
||||
private readonly ISearchForNewMovie _skyhookProxy;
|
||||
private readonly Logger _logger;
|
||||
|
||||
public TMDbParser(TMDbSettings settings, ISearchForNewMovie skyhookProxy)
|
||||
{
|
||||
@ -96,4 +92,4 @@ protected virtual bool PreProcess(NetImportResponse indexerResponse)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,14 +11,9 @@ public class TraktImport : HttpNetImportBase<TraktSettings>
|
||||
public override bool Enabled => true;
|
||||
public override bool EnableAuto => false;
|
||||
|
||||
private readonly IHttpClient _httpClient;
|
||||
public IConfigService _configService;
|
||||
|
||||
public TraktImport(IHttpClient httpClient, IConfigService configService, IParsingService parsingService, Logger logger)
|
||||
: base(httpClient, configService, parsingService, logger)
|
||||
{
|
||||
_configService = configService;
|
||||
_httpClient = httpClient;
|
||||
}
|
||||
|
||||
public override INetImportRequestGenerator GetRequestGenerator()
|
||||
|
@ -11,7 +11,6 @@ public class TraktParser : IParseNetImportResponse
|
||||
{
|
||||
private readonly TraktSettings _settings;
|
||||
private NetImportResponse _importResponse;
|
||||
private readonly Logger _logger;
|
||||
|
||||
public TraktParser(TraktSettings settings)
|
||||
{
|
||||
|
@ -62,7 +62,7 @@ public class NzbDroneConsoleFactory : INzbDroneConsoleFactory, IHandle<Applicati
|
||||
private readonly IBrowserService _browserService;
|
||||
private readonly IContainer _container;
|
||||
private readonly Logger _logger;
|
||||
private CancelHandler _cancelHandler;
|
||||
// private CancelHandler _cancelHandler;
|
||||
|
||||
public NzbDroneConsoleFactory(IConfigFileProvider configFileProvider,
|
||||
IHostController hostController,
|
||||
|
@ -40,7 +40,7 @@ public CommandClient(IRestClient restClient, string apiKey)
|
||||
public SimpleCommandResource PostAndWait<T>(T command) where T : Command, new()
|
||||
{
|
||||
var request = BuildRequest();
|
||||
request.AddBody(command);
|
||||
request.AddJsonBody(command);
|
||||
var result = Post<SimpleCommandResource>(request);
|
||||
result.Id.Should().NotBe(0);
|
||||
|
||||
|
@ -215,7 +215,7 @@ protected async Task ConnectSignalR()
|
||||
connected = true;
|
||||
break;
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception)
|
||||
{
|
||||
if (retryCount > 25)
|
||||
{
|
||||
|
@ -29,13 +29,15 @@ public class MovieFileModule : RadarrRestModuleWithSignalR<MovieFileResource, Mo
|
||||
private readonly Logger _logger;
|
||||
|
||||
public MovieFileModule(IBroadcastSignalRMessage signalRBroadcaster,
|
||||
IMediaFileService mediaFileService,
|
||||
IMovieService movieService,
|
||||
IUpgradableSpecification qualityUpgradableSpecification,
|
||||
Logger logger)
|
||||
IMediaFileService mediaFileService,
|
||||
IRecycleBinProvider recycleBinProvider,
|
||||
IMovieService movieService,
|
||||
IUpgradableSpecification qualityUpgradableSpecification,
|
||||
Logger logger)
|
||||
: base(signalRBroadcaster)
|
||||
{
|
||||
_mediaFileService = mediaFileService;
|
||||
_recycleBinProvider = recycleBinProvider;
|
||||
_movieService = movieService;
|
||||
_qualityUpgradableSpecification = qualityUpgradableSpecification;
|
||||
_logger = logger;
|
||||
|
@ -36,8 +36,6 @@ public static AlternativeTitleResource ToResource(this AlternativeTitle model)
|
||||
{
|
||||
if (model == null) return null;
|
||||
|
||||
AlternativeTitleResource resource = null;
|
||||
|
||||
return new AlternativeTitleResource
|
||||
{
|
||||
Id = model.Id,
|
||||
|
@ -1,7 +1,6 @@
|
||||
using System.IO;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Disk;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Core.Backup;
|
||||
|
||||
namespace Radarr.Http.Frontend.Mappers
|
||||
@ -9,7 +8,6 @@ namespace Radarr.Http.Frontend.Mappers
|
||||
public class BackupFileMapper : StaticResourceMapperBase
|
||||
{
|
||||
private readonly IBackupService _backupService;
|
||||
private readonly IAppFolderInfo _appFolderInfo;
|
||||
|
||||
public BackupFileMapper(IBackupService backupService, IDiskProvider diskProvider, Logger logger)
|
||||
: base(diskProvider, logger)
|
||||
|
Loading…
Reference in New Issue
Block a user