mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-10-02 00:34:37 +02:00
Fixed: (Apps) Use forceSave=true
to avoid validation warnings
This commit is contained in:
@@ -86,13 +86,23 @@ namespace NzbDrone.Core.Applications.Radarr
|
||||
|
||||
request.SetContent(indexer.ToJson());
|
||||
|
||||
return ExecuteIndexerRequest(request);
|
||||
try
|
||||
{
|
||||
return ExecuteIndexerRequest(request);
|
||||
}
|
||||
catch (HttpException ex) when (ex.Response.StatusCode == HttpStatusCode.BadRequest)
|
||||
{
|
||||
request.Url = request.Url.AddQueryParam("forceSave", "true");
|
||||
|
||||
return ExecuteIndexerRequest(request);
|
||||
}
|
||||
}
|
||||
|
||||
public RadarrIndexer UpdateIndexer(RadarrIndexer indexer, RadarrSettings settings)
|
||||
{
|
||||
var request = BuildRequest(settings, $"{AppIndexerApiRoute}/{indexer.Id}", HttpMethod.Put);
|
||||
|
||||
request.Url = request.Url.AddQueryParam("forceSave", "true");
|
||||
request.SetContent(indexer.ToJson());
|
||||
|
||||
return ExecuteIndexerRequest(request);
|
||||
@@ -192,8 +202,10 @@ namespace NzbDrone.Core.Applications.Radarr
|
||||
break;
|
||||
default:
|
||||
_logger.Error(ex, "Unexpected response status code: {0}", ex.Response.StatusCode);
|
||||
throw;
|
||||
break;
|
||||
}
|
||||
|
||||
throw;
|
||||
}
|
||||
catch (JsonReaderException ex)
|
||||
{
|
||||
@@ -205,8 +217,6 @@ namespace NzbDrone.Core.Applications.Radarr
|
||||
_logger.Error(ex, "Unable to add or update indexer");
|
||||
throw;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private HttpRequest BuildRequest(RadarrSettings settings, string resource, HttpMethod method)
|
||||
|
Reference in New Issue
Block a user