Fixed :Compile warning cleanup (#314)

Fixed :Compile warning cleanup
pull/315/head
Qstick 7 years ago committed by GitHub
parent 8d113864aa
commit 25c0423ef6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using FluentValidation.Results;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Restrictions;
@ -15,11 +15,11 @@ namespace Lidarr.Api.V1.Restrictions
{
_restrictionService = restrictionService;
GetResourceById = Get;
GetResourceById = GetRestriction;
GetResourceAll = GetAll;
CreateResource = Create;
UpdateResource = Update;
DeleteResource = Delete;
DeleteResource = DeleteRestriction;
SharedValidator.Custom(restriction =>
{
@ -32,7 +32,7 @@ namespace Lidarr.Api.V1.Restrictions
});
}
private RestrictionResource Get(int id)
private RestrictionResource GetRestriction(int id)
{
return _restrictionService.Get(id).ToResource();
}
@ -52,7 +52,7 @@ namespace Lidarr.Api.V1.Restrictions
_restrictionService.Update(resource.ToModel());
}
private void Delete(int id)
private void DeleteRestriction(int id)
{
_restrictionService.Delete(id);
}

@ -1,4 +1,4 @@
using NzbDrone.Core.Tags;
using NzbDrone.Core.Tags;
using Lidarr.Http;
namespace Lidarr.Api.V1.Tags
@ -12,10 +12,10 @@ namespace Lidarr.Api.V1.Tags
{
_tagService = tagService;
GetResourceById = Get;
GetResourceById = GetTagDetails;
}
private TagDetailsResource Get(int id)
private TagDetailsResource GetTagDetails(int id)
{
return _tagService.Details(id).ToResource();
}

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Tags;
@ -17,14 +17,14 @@ namespace Lidarr.Api.V1.Tags
{
_tagService = tagService;
GetResourceById = Get;
GetResourceById = GetTag;
GetResourceAll = GetAll;
CreateResource = Create;
UpdateResource = Update;
DeleteResource = Delete;
DeleteResource = DeleteTag;
}
private TagResource Get(int id)
private TagResource GetTag(int id)
{
return _tagService.GetTag(id).ToResource();
}
@ -44,7 +44,7 @@ namespace Lidarr.Api.V1.Tags
_tagService.Update(resource.ToModel());
}
private void Delete(int id)
private void DeleteTag(int id)
{
_tagService.Delete(id);
}

@ -1,4 +1,4 @@
using TinyIoC;
using TinyIoC;
using System;
using System.Collections.Generic;
using System.Linq;
@ -91,7 +91,6 @@ namespace Lidarr.Http
break;
case Lifetime.PerRequest:
throw new InvalidOperationException("Unable to directly register a per request lifetime.");
break;
default:
throw new ArgumentOutOfRangeException();
}
@ -118,7 +117,6 @@ namespace Lidarr.Http
break;
case Lifetime.PerRequest:
throw new InvalidOperationException("Unable to directly register a per request lifetime.");
break;
default:
throw new ArgumentOutOfRangeException();
}

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using NLog;
@ -31,7 +31,7 @@ namespace NzbDrone.Automation.Test
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", NLog.LogLevel.Trace, consoleTarget));
}
[TestFixtureSetUp]
[OneTimeSetUp]
public void SmokeTestSetup()
{
driver = new FirefoxDriver();
@ -56,7 +56,7 @@ namespace NzbDrone.Automation.Test
.Select(e => e.Text);
}
[TestFixtureTearDown]
[OneTimeTearDown]
public void SmokeTestTearDown()
{
_runner.KillAll();

@ -13,8 +13,6 @@ namespace NzbDrone.Core.Test.Datastore.Converters
[Test]
public void should_return_int_when_saving_int_to_db()
{
var i = 5;
Subject.ToDB(5).Should().Be(5);
}

@ -160,7 +160,7 @@ namespace NzbDrone.Core.DecisionEngine
return new Rejection(result.Reason, spec.Type);
}
}
catch (NotImplementedException e)
catch (NotImplementedException)
{
_logger.Trace("Spec " + spec.GetType().Name + " not implemented.");
}

@ -158,7 +158,7 @@ namespace NzbDrone.Core.Download.Clients.Hadouken
}
catch (DownloadClientAuthenticationException ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex.Message, ex);
return new NzbDroneValidationFailure("Password", "Authentication failed");
}
@ -174,7 +174,7 @@ namespace NzbDrone.Core.Download.Clients.Hadouken
}
catch (Exception ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure(String.Empty, "Failed to get the list of torrents: " + ex.Message);
}

@ -71,9 +71,11 @@ namespace NzbDrone.Core.Download.Clients.Hadouken
private T ProcessRequest<T>(HadoukenSettings settings, string method, params object[] parameters)
{
var baseUrl = HttpRequestBuilder.BuildBaseUrl(settings.UseSsl, settings.Host, settings.Port, "api");
var requestBuilder = new JsonRpcRequestBuilder(baseUrl, method, parameters);
requestBuilder.LogResponseContent = true;
requestBuilder.NetworkCredential = new NetworkCredential(settings.Username, settings.Password);
var requestBuilder = new JsonRpcRequestBuilder(baseUrl, method, parameters)
{
LogResponseContent = true,
NetworkCredential = new NetworkCredential(settings.Username, settings.Password)
};
requestBuilder.Headers.Add("Accept-Encoding", "gzip,deflate");
var httpRequest = requestBuilder.Build();
@ -146,7 +148,7 @@ namespace NzbDrone.Core.Download.Clients.Hadouken
}
catch(Exception ex)
{
_logger.ErrorException("Failed to map Hadouken torrent data.", ex);
_logger.Error(ex, "Failed to map Hadouken torrent data.");
}
return torrent;

@ -197,9 +197,12 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
private HttpRequestBuilder BuildRequest(QBittorrentSettings settings)
{
var requestBuilder = new HttpRequestBuilder(settings.UseSsl, settings.Host, settings.Port);
requestBuilder.LogResponseContent = true;
requestBuilder.NetworkCredential = new NetworkCredential(settings.Username, settings.Password);
var requestBuilder =
new HttpRequestBuilder(settings.UseSsl, settings.Host, settings.Port)
{
LogResponseContent = true,
NetworkCredential = new NetworkCredential(settings.Username, settings.Password)
};
return requestBuilder;
}

@ -11,7 +11,6 @@ namespace NzbDrone.Core.ImportLists.HeadphonesImport
public class HeadphonesImportParser : IParseImportListResponse
{
private ImportListResponse _importListResponse;
private readonly Logger _logger;
public IList<ImportListItemInfo> ParseResponse(ImportListResponse importListResponse)
{

@ -12,7 +12,6 @@ namespace NzbDrone.Core.ImportLists.LidarrLists
{
private readonly LidarrListsSettings _settings;
private ImportListResponse _importListResponse;
private readonly Logger _logger;
public LidarrListsParser(LidarrListsSettings settings)
{

@ -17,15 +17,11 @@ namespace NzbDrone.Core.Indexers.Gazelle
public override int PageSize => 50;
private readonly ICached<Dictionary<string, string>> _authCookieCache;
private readonly IHttpClient _httpClient;
private readonly Logger _logger;
public Gazelle(IHttpClient httpClient, ICacheManager cacheManager, IIndexerStatusService indexerStatusService,
IConfigService configService, IParsingService parsingService, Logger logger)
: base(httpClient, indexerStatusService, configService, parsingService, logger)
{
_httpClient = httpClient;
_logger = logger;
_authCookieCache = cacheManager.GetCache<Dictionary<string, string>>(GetType(), "authCookies");
}

@ -6,7 +6,6 @@ namespace NzbDrone.Core.Indexers.Headphones
{
public class HeadphonesRssParser : NewznabRssParser
{
public const string ns = "{http://www.newznab.com/DTD/2010/feeds/attributes/}";
public HeadphonesSettings Settings { get; set; }
public HeadphonesRssParser()

@ -51,7 +51,7 @@ namespace NzbDrone.Core.Messaging.Commands
_logger.Error(ex, "Thread aborted");
Thread.ResetAbort();
}
catch (OperationCanceledException ex)
catch (OperationCanceledException)
{
_logger.Trace("Stopped one command execution pipeline");
}

@ -22,7 +22,7 @@ namespace NzbDrone.Host.Owin.MiddleWare
public void Attach(IAppBuilder appBuilder)
{
appBuilder.MapConnection("/signalr", typeof(NzbDronePersistentConnection), new ConnectionConfiguration ());
appBuilder.MapSignalR("/signalr", typeof(NzbDronePersistentConnection), new ConnectionConfiguration ());
}
}
}

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
@ -60,7 +60,7 @@ namespace NzbDrone.Host.Owin
if (ex.InnerException is HttpListenerException)
{
throw new PortInUseException("Port {0} is already in use, please ensure NzbDrone is not already running.", ex, _configFileProvider.Port);
throw new PortInUseException("Port {0} is already in use, please ensure Lidarr is not already running.", ex, _configFileProvider.Port);
}
throw ex.InnerException;
@ -70,7 +70,7 @@ namespace NzbDrone.Host.Owin
private void BuildApp(IAppBuilder appBuilder)
{
appBuilder.Properties["host.AppName"] = "NzbDrone";
appBuilder.Properties["host.AppName"] = "Lidarr";
foreach (var middleWare in _owinMiddleWares.OrderBy(c => c.Order))
{

Loading…
Cancel
Save