mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-03-05 13:20:20 -05:00
Compare commits
2 Commits
v4.0.1.933
...
v2.0.0.464
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0cffd851f3 | ||
|
|
270bc9b955 |
@@ -9,7 +9,7 @@ namespace NzbDrone.Common.Http
|
||||
public class JsonRpcRequestBuilder : HttpRequestBuilder
|
||||
{
|
||||
public static HttpAccept JsonRpcHttpAccept = new HttpAccept("application/json-rpc, application/json");
|
||||
public static string JsonRpcContentType = "application/json-rpc";
|
||||
public static string JsonRpcContentType = "application/json";
|
||||
|
||||
public string JsonMethod { get; private set; }
|
||||
public List<object> JsonParameters { get; private set; }
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation.Proxies
|
||||
{
|
||||
if (retries == 5)
|
||||
{
|
||||
throw new DownloadClientException("Try to process same request more than 5 times");
|
||||
throw new DownloadClientException("Try to process request to {0} with {1} more than 5 times", api, arguments.ToJson().ToString());
|
||||
}
|
||||
|
||||
if (!_authenticated && api != DiskStationApi.Info && api != DiskStationApi.DSMInfo)
|
||||
@@ -72,15 +72,21 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation.Proxies
|
||||
}
|
||||
else
|
||||
{
|
||||
if (responseContent.Error.SessionError)
|
||||
{
|
||||
_authenticated = false;
|
||||
return ProcessRequest<T>(api, arguments, settings, operation, method, retries++);
|
||||
}
|
||||
|
||||
var msg = $"Failed to {operation}. Reason: {responseContent.Error.GetMessage(api)}";
|
||||
_logger.Error(msg);
|
||||
|
||||
if (responseContent.Error.SessionError)
|
||||
{
|
||||
_authenticated = false;
|
||||
|
||||
if (responseContent.Error.Code == 105)
|
||||
{
|
||||
throw new DownloadClientAuthenticationException(msg);
|
||||
}
|
||||
|
||||
return ProcessRequest<T>(api, arguments, settings, operation, method, ++retries);
|
||||
}
|
||||
|
||||
throw new DownloadClientException(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,7 +272,17 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
|
||||
{
|
||||
try
|
||||
{
|
||||
var downloadDir = GetDownloadDirectory();
|
||||
var downloadDir = GetDefaultDir();
|
||||
|
||||
if (downloadDir == null)
|
||||
{
|
||||
return new NzbDroneValidationFailure(nameof(Settings.TvDirectory), "No default destination")
|
||||
{
|
||||
DetailedDescription = $"You must login into your Diskstation as {Settings.Username} and manually set it up into DownloadStation settings under BT/HTTP/FTP/NZB -> Location."
|
||||
};
|
||||
}
|
||||
|
||||
downloadDir = GetDownloadDirectory();
|
||||
|
||||
if (downloadDir != null)
|
||||
{
|
||||
@@ -285,7 +295,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
|
||||
{
|
||||
return new NzbDroneValidationFailure(fieldName, $"Shared folder does not exist")
|
||||
{
|
||||
DetailedDescription = $"The DownloadStation does not have a Shared Folder with the name '{sharedFolder}', are you sure you specified it correctly?"
|
||||
DetailedDescription = $"The Diskstation does not have a Shared Folder with the name '{sharedFolder}', are you sure you specified it correctly?"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -300,6 +310,11 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
|
||||
|
||||
return null;
|
||||
}
|
||||
catch (DownloadClientAuthenticationException ex) // User could not have permission to access to downloadstation
|
||||
{
|
||||
_logger.Error(ex);
|
||||
return new NzbDroneValidationFailure(string.Empty, ex.Message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex);
|
||||
|
||||
@@ -190,7 +190,17 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
|
||||
{
|
||||
try
|
||||
{
|
||||
var downloadDir = GetDownloadDirectory();
|
||||
var downloadDir = GetDefaultDir();
|
||||
|
||||
if (downloadDir == null)
|
||||
{
|
||||
return new NzbDroneValidationFailure(nameof(Settings.TvDirectory), "No default destination")
|
||||
{
|
||||
DetailedDescription = $"You must login into your Diskstation as {Settings.Username} and manually set it up into DownloadStation settings under BT/HTTP/FTP/NZB -> Location."
|
||||
};
|
||||
}
|
||||
|
||||
downloadDir = GetDownloadDirectory();
|
||||
|
||||
if (downloadDir != null)
|
||||
{
|
||||
@@ -203,7 +213,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
|
||||
{
|
||||
return new NzbDroneValidationFailure(fieldName, $"Shared folder does not exist")
|
||||
{
|
||||
DetailedDescription = $"The DownloadStation does not have a Shared Folder with the name '{sharedFolder}', are you sure you specified it correctly?"
|
||||
DetailedDescription = $"The Diskstation does not have a Shared Folder with the name '{sharedFolder}', are you sure you specified it correctly?"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -218,6 +228,11 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
|
||||
|
||||
return null;
|
||||
}
|
||||
catch (DownloadClientAuthenticationException ex) // User could not have permission to access to downloadstation
|
||||
{
|
||||
_logger.Error(ex);
|
||||
return new NzbDroneValidationFailure(string.Empty, ex.Message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex);
|
||||
|
||||
Reference in New Issue
Block a user