Fixed: Adjust Sonarr references to Radarr (#1977)

pull/2/head
James White 7 years ago committed by Leonardo Galli
parent 685c5daf36
commit 38af8edd59

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@ -108,7 +108,7 @@ namespace NzbDrone.Common.Disk
}
}
}
public bool CanUseGDIPlus()
{
try
@ -129,7 +129,7 @@ namespace NzbDrone.Common.Disk
{
return true;
}
try
{
using (var bmp = new Bitmap(filename))
@ -150,7 +150,7 @@ namespace NzbDrone.Common.Disk
try
{
var testPath = Path.Combine(path, "sonarr_write_test.txt");
var testPath = Path.Combine(path, "radarr_write_test.txt");
var testContent = string.Format("This file was created to verify if '{0}' is writable. It should've been automatically deleted. Feel free to delete it.", path);
File.WriteAllText(testPath, testContent);
File.Delete(testPath);

@ -136,7 +136,7 @@ namespace NzbDrone.Common.Http.Dispatchers
webRequest.TransferEncoding = header.Value;
break;
case "User-Agent":
throw new NotSupportedException("User-Agent other than Sonarr not allowed.");
throw new NotSupportedException("User-Agent other than Radarr not allowed.");
case "Proxy-Connection":
throw new NotImplementedException();
default:

@ -1,4 +1,4 @@
using System;
using System;
using System.Net;
using NLog;
using NzbDrone.Common.EnvironmentInfo;
@ -24,7 +24,7 @@ namespace NzbDrone.Common.Http
public HttpProvider(Logger logger)
{
_logger = logger;
_userAgent = string.Format("Sonarr {0}", BuildInfo.Version);
_userAgent = string.Format("Radarr {0}", BuildInfo.Version);
ServicePointManager.Expect100Continue = false;
}
@ -58,6 +58,6 @@ namespace NzbDrone.Common.Http
}
}
}
}
}

@ -54,7 +54,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.QBittorrentTests
protected void GivenRedirectToTorrent()
{
var httpHeader = new HttpHeader();
httpHeader["Location"] = "http://test.sonarr.tv/not-a-real-torrent.torrent";
httpHeader["Location"] = "http://test.radarr.video/not-a-real-torrent.torrent";
Mocker.GetMock<IHttpClient>()
.Setup(s => s.Get(It.Is<HttpRequest>(h => h.Url.FullUri == _downloadUrl)))
@ -405,7 +405,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.QBittorrentTests
[Test]
public void should_get_category_from_the_category_if_set()
{
const string category = "tv-sonarr";
const string category = "movies-radarr";
GivenMaxRatio(1.0f);
var torrent = new QBittorrentTorrent
@ -430,7 +430,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.QBittorrentTests
[Test]
public void should_get_category_from_the_label_if_the_category_is_not_available()
{
const string category = "tv-sonarr";
const string category = "movies-radarr";
GivenMaxRatio(1.0f);
var torrent = new QBittorrentTorrent

@ -107,7 +107,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.UTorrentTests
protected void GivenRedirectToTorrent()
{
var httpHeader = new HttpHeader();
httpHeader["Location"] = "http://test.sonarr.tv/not-a-real-torrent.torrent";
httpHeader["Location"] = "http://test.radarr.video/not-a-real-torrent.torrent";
Mocker.GetMock<IHttpClient>()
.Setup(s => s.Get(It.Is<HttpRequest>(h => h.Url.ToString() == _downloadUrl)))

@ -1,4 +1,4 @@
using System.Text.RegularExpressions;
using System.Text.RegularExpressions;
using FluentValidation;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Annotations;
@ -42,7 +42,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
[FieldDefinition(3, Label = "Password", Type = FieldType.Password)]
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. Creates a [category] subdirectory in the output directory.")]
[FieldDefinition(4, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Radarr avoids conflicts with unrelated downloads, but it's optional. Creates a [category] subdirectory in the output directory.")]
public string TvCategory { get; set; }
[FieldDefinition(5, Label = "Directory", Type = FieldType.Textbox, HelpText = "Optional shared folder to put downloads into, leave blank to use the default Download Station location")]

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@ -345,7 +345,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure("Username", "Authentication failure")
{
DetailedDescription = $"Please verify your username and password. Also verify if the host running Sonarr isn't blocked from accessing {Name} by WhiteList limitations in the {Name} configuration."
DetailedDescription = $"Please verify your username and password. Also verify if the host running Radarr isn't blocked from accessing {Name} by WhiteList limitations in the {Name} configuration."
};
}
catch (WebException ex)

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
@ -259,7 +259,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure("Username", "Authentication failure")
{
DetailedDescription = $"Please verify your username and password. Also verify if the host running Sonarr isn't blocked from accessing {Name} by WhiteList limitations in the {Name} configuration."
DetailedDescription = $"Please verify your username and password. Also verify if the host running Radarr isn't blocked from accessing {Name} by WhiteList limitations in the {Name} configuration."
};
}
catch (WebException ex)

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Net;
using System.Xml;
@ -59,7 +59,7 @@ namespace NzbDrone.Core.Indexers.Newznab
}
catch (Exception ex)
{
_logger.Debug(ex, "Failed to get newznab api capabilities from {0}", indexerSettings.BaseUrl);
_logger.Debug(ex, "Failed to get Newznab API capabilities from {0}", indexerSettings.BaseUrl);
throw;
}
@ -74,7 +74,7 @@ namespace NzbDrone.Core.Indexers.Newznab
}
catch (Exception ex)
{
_logger.Error(ex, "Failed to determine newznab api capabilities for {0}, using the defaults instead till Sonarr restarts.", indexerSettings.BaseUrl);
_logger.Error(ex, "Failed to determine newznab api capabilities for {0}, using the defaults instead till Radarr restarts.", indexerSettings.BaseUrl);
}
return capabilities;

@ -1,4 +1,4 @@
using FluentValidation.Results;
using FluentValidation.Results;
using Growl.Connector;
using Growl.CoreLibrary;
using NzbDrone.Common.Extensions;
@ -102,7 +102,7 @@ namespace NzbDrone.Core.Notifications.Growl
private void Register(string host, int port, string password)
{
_logger.Debug("Registering Sonarr with Growl host: {0}:{1}", host, port);
_logger.Debug("Registering Radarr with Growl host: {0}:{1}", host, port);
var growlConnector = GetGrowlConnector(host, port, password);

@ -1,4 +1,4 @@
using System;
using System;
using System.Net;
using FluentValidation.Results;
using NLog;
@ -49,13 +49,13 @@ namespace NzbDrone.Core.Notifications.MediaBrowser
{
_logger.Debug("Testing connection to MediaBrowser: {0}", settings.Address);
Notify(settings, "Test from Sonarr", "Success! MediaBrowser has been successfully configured!");
Notify(settings, "Test from Radarr", "Success! MediaBrowser has been successfully configured!");
}
catch (RestException ex)
{
if (ex.Response.StatusCode == HttpStatusCode.Unauthorized)
{
return new ValidationFailure("ApiKey", "API Key is incorrect");
return new ValidationFailure("ApiKey", "API key is incorrect");
}
}
catch (Exception ex)

@ -1,4 +1,4 @@
using RestSharp;
using RestSharp;
using NzbDrone.Common.EnvironmentInfo;
namespace NzbDrone.Core.Rest
@ -9,7 +9,7 @@ namespace NzbDrone.Core.Rest
{
var restClient = new RestClient(baseUrl);
restClient.UserAgent = string.Format("Sonarr/{0} (RestSharp/{1}; {2}/{3})",
restClient.UserAgent = string.Format("Radarr/{0} (RestSharp/{1}; {2}/{3})",
BuildInfo.Version,
restClient.GetType().Assembly.GetName().Version,
OsInfo.Os, OsInfo.Version.ToString(2));

@ -1,4 +1,4 @@
using System.Text.RegularExpressions;
using System.Text.RegularExpressions;
using FluentValidation;
using FluentValidation.Validators;
using NzbDrone.Core.Parser;
@ -36,7 +36,7 @@ namespace NzbDrone.Core.Validation
public static IRuleBuilderOptions<T, string> ValidUrlBase<T>(this IRuleBuilder<T, string> ruleBuilder)
{
return ruleBuilder.SetValidator(new RegularExpressionValidator(@"^(?!\/?https?://[-_a-z0-9.]+)", RegexOptions.IgnoreCase)).WithMessage("Must be a valid URL path (ie: '/sonarr')");
return ruleBuilder.SetValidator(new RegularExpressionValidator(@"^(?!\/?https?://[-_a-z0-9.]+)", RegexOptions.IgnoreCase)).WithMessage("Must be a valid URL path (ie: '/radarr')");
}
public static IRuleBuilderOptions<T, int> ValidPort<T>(this IRuleBuilder<T, int> ruleBuilder)
@ -68,4 +68,4 @@ namespace NzbDrone.Core.Validation
return ruleBuilder.WithState(v => NzbDroneValidationState.Warning);
}
}
}
}

@ -15,7 +15,7 @@ namespace NzbDrone.Integration.Test
config.LogLevel = "Trace";
HostConfig.Put(config);
var logFile = Path.Combine(_runner.AppData, "logs", "sonarr.trace.txt");
var logFile = Path.Combine(_runner.AppData, "logs", "radarr.trace.txt");
var logLines = File.ReadAllLines(logFile);
var result = Series.InvalidPost(new Api.Series.SeriesResource());

Loading…
Cancel
Save