1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Fixed some compile warnings.

This commit is contained in:
Taloth Saldono 2016-02-11 21:49:22 +01:00
parent 91d91bc673
commit e01b2ef25c
14 changed files with 21 additions and 28 deletions

View File

@ -296,7 +296,7 @@ protected virtual void Run()
WriteDebugMessages("HostName parameter is not defined - trying to get it from System.Environment.MachineName");
m_HostName = "HostName=" + System.Environment.MachineName + " ";
}
catch (InvalidOperationException ex)
catch (InvalidOperationException)
{
// Cannot get host name automatically, so assume that HostName is not used
// and log message is sent without it.

View File

@ -93,7 +93,6 @@ protected override sealed void RegisterTypes(TinyIoCContainer container, IEnumer
break;
case Lifetime.PerRequest:
throw new InvalidOperationException("Unable to directly register a per request lifetime.");
break;
default:
throw new ArgumentOutOfRangeException();
}
@ -120,7 +119,6 @@ protected override sealed void RegisterCollectionTypes(TinyIoCContainer containe
break;
case Lifetime.PerRequest:
throw new InvalidOperationException("Unable to directly register a per request lifetime.");
break;
default:
throw new ArgumentOutOfRangeException();
}

View File

@ -100,7 +100,6 @@ protected virtual void AddRequestHeaders(HttpWebRequest webRequest, HttpHeader h
break;
case "Range":
throw new NotImplementedException();
break;
case "Referer":
webRequest.Referer = header.Value.ToString();
break;
@ -111,7 +110,6 @@ protected virtual void AddRequestHeaders(HttpWebRequest webRequest, HttpHeader h
throw new NotSupportedException("User-Agent other than Sonarr not allowed.");
case "Proxy-Connection":
throw new NotImplementedException();
break;
default:
webRequest.Headers.Add(header.Key, header.Value.ToString());
break;

View File

@ -14,8 +14,6 @@ public class pushbullet_devices_channels : MigrationTest<Core.Datastore.Migratio
[Test]
public void should_convert_comma_separted_string_to_list()
{
var deviceId = "device_id";
WithTestDb(c =>
{
c.Insert.IntoTable("Notifications").Row(new

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using Moq;
using NUnit.Framework;
using NzbDrone.Core.HealthCheck.Checks;
using NzbDrone.Core.Indexers;
@ -10,17 +11,17 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
[TestFixture]
public class IndexerCheckFixture : CoreTest<IndexerCheck>
{
private IIndexer _indexer;
private Mock<IIndexer> _indexerMock;
private void GivenIndexer(bool supportsRss, bool supportsSearch)
{
var _indexer = Mocker.GetMock<IIndexer>();
_indexer.SetupGet(s => s.SupportsRss).Returns(supportsRss);
_indexer.SetupGet(s => s.SupportsSearch).Returns(supportsSearch);
_indexerMock = Mocker.GetMock<IIndexer>();
_indexerMock.SetupGet(s => s.SupportsRss).Returns(supportsRss);
_indexerMock.SetupGet(s => s.SupportsSearch).Returns(supportsSearch);
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.GetAvailableProviders())
.Returns(new List<IIndexer> { _indexer.Object });
.Returns(new List<IIndexer> { _indexerMock.Object });
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.RssEnabled())
@ -35,14 +36,14 @@ private void GivenRssEnabled()
{
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.RssEnabled())
.Returns(new List<IIndexer> { _indexer });
.Returns(new List<IIndexer> { _indexerMock.Object });
}
private void GivenSearchEnabled()
{
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.SearchEnabled())
.Returns(new List<IIndexer> { _indexer });
.Returns(new List<IIndexer> { _indexerMock.Object });
}
[Test]

View File

@ -16,7 +16,6 @@ public class GetSeriesPathFixture : CoreTest<JsonApiProvider>
private const int TVDB_ID = 5;
private XbmcSettings _settings;
private Series _series;
private string _response;
private List<TvShow> _xbmcSeries;
[SetUp]

View File

@ -16,7 +16,6 @@ public class UpdateFixture : CoreTest<JsonApiProvider>
{
private const int TVDB_ID = 5;
private XbmcSettings _settings;
private Series _series;
private List<TvShow> _xbmcSeries;
[SetUp]

View File

@ -206,7 +206,7 @@ private ValidationFailure TestAuthentication()
{
_proxy.GetQueue(1, Settings);
}
catch (NzbVortexAuthenticationException ex)
catch (NzbVortexAuthenticationException)
{
return new ValidationFailure("ApiKey", "API Key Incorrect");
}

View File

@ -189,7 +189,7 @@ private string ProcessRequest(IRestRequest request, NzbVortexSettings settings)
{
return ProcessRequest(client, request).Content;
}
catch (NzbVortexNotLoggedInException ex)
catch (NzbVortexNotLoggedInException)
{
_logger.Warn("Not logged in response received, reauthenticating and retrying");
request.AddQueryParameter("sessionid", GetSessionId(true, settings));

View File

@ -9,11 +9,13 @@ public class IndexerException : NzbDroneException
public IndexerException(IndexerResponse response, string message, params object[] args)
: base(message, args)
{
_indexerResponse = response;
}
public IndexerException(IndexerResponse response, string message)
: base(message)
{
_indexerResponse = response;
}
public IndexerResponse Response

View File

@ -124,8 +124,6 @@ protected virtual ValidationFailure TestCapabilities()
return new ValidationFailure(string.Empty, "Unable to connect to indexer, check the log for more details");
}
return null;
}
}
}

View File

@ -80,7 +80,7 @@ public NewznabSettings()
[FieldDefinition(4, Label = "Additional Parameters", HelpText = "Additional Newznab parameters", Advanced = true)]
public string AdditionalParameters { get; set; }
public NzbDroneValidationResult Validate()
public virtual NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));
}

View File

@ -54,7 +54,7 @@ public class TorznabSettings : NewznabSettings
{
private static readonly TorznabSettingsValidator Validator = new TorznabSettingsValidator();
public NzbDroneValidationResult Validate()
public override NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));
}

View File

@ -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 new string Username { get; set; }
[FieldDefinition(3, Label = "Password", Type = FieldType.Hidden)]
public string Password { get; set; }
public new string Password { get; set; }
[FieldDefinition(5, Label = "GUI Notification", Type = FieldType.Hidden)]
public bool Notify { get; set; }
public new bool Notify { get; set; }
[FieldDefinition(6, Label = "Update Library", HelpText = "Update Library on Download & Rename?", Type = FieldType.Hidden)]
public bool UpdateLibrary { get; set; }
public new bool UpdateLibrary { get; set; }
[FieldDefinition(7, Label = "Clean Library", HelpText = "Clean Library after update?", Type = FieldType.Hidden)]
public bool CleanLibrary { get; set; }
public new bool CleanLibrary { get; set; }
[FieldDefinition(8, Label = "Always Update", HelpText = "Update Library even when a video is playing?", Type = FieldType.Hidden)]
public bool AlwaysUpdate { get; set; }
public new bool AlwaysUpdate { get; set; }
}
}