Small changes that might fix #1985 but doubt it

This commit is contained in:
Jamie 2018-02-19 13:55:58 +00:00
parent 7c61a3cc0e
commit dd5e40f3cd
6 changed files with 12 additions and 37 deletions

View file

@ -0,0 +1,9 @@
using System;
namespace Ombi.Api.Radarr
{
public class CommandResult
{
public string name { get; set; }
}
}

View file

@ -17,10 +17,7 @@ namespace Ombi.Api.Radarr.Models
public bool monitored { get; set; } public bool monitored { get; set; }
public int tmdbId { get; set; } public int tmdbId { get; set; }
public List<string> images { get; set; } public List<string> images { get; set; }
public string cleanTitle { get; set; }
public string imdbId { get; set; }
public string titleSlug { get; set; } public string titleSlug { get; set; }
public int id { get; set; }
public int year { get; set; } public int year { get; set; }
public string minimumAvailability { get; set; } public string minimumAvailability { get; set; }
} }

View file

@ -3,19 +3,10 @@
public class RadarrError public class RadarrError
{ {
public string message { get; set; } public string message { get; set; }
public string description { get; set; }
} }
public class RadarrErrorResponse public class RadarrErrorResponse
{ {
public string propertyName { get; set; }
public string errorMessage { get; set; } public string errorMessage { get; set; }
public object attemptedValue { get; set; }
public FormattedMessagePlaceholderValues formattedMessagePlaceholderValues { get; set; }
}
public class FormattedMessagePlaceholderValues
{
public string propertyName { get; set; }
public object propertyValue { get; set; }
} }
} }

View file

@ -1,17 +0,0 @@
using System;
namespace Ombi.Api.Radarr
{
public partial class RadarrApi
{
public class CommandResult
{
public string name { get; set; }
public DateTime startedOn { get; set; }
public DateTime stateChangeTime { get; set; }
public bool sendUpdatesToClient { get; set; }
public string state { get; set; }
public int id { get; set; }
}
}
}

View file

@ -82,7 +82,7 @@ namespace Ombi.Api.Radarr
titleSlug = title, titleSlug = title,
monitored = true, monitored = true,
year = year, year = year,
minimumAvailability = minimumAvailability, minimumAvailability = minimumAvailability
}; };
if (searchNow) if (searchNow)
@ -97,9 +97,9 @@ namespace Ombi.Api.Radarr
request.AddHeader("X-Api-Key", apiKey); request.AddHeader("X-Api-Key", apiKey);
request.AddJsonBody(options); request.AddJsonBody(options);
var response = await Api.RequestContent(request);
try try
{ {
var response = await Api.RequestContent(request);
if (response.Contains("\"message\":")) if (response.Contains("\"message\":"))
{ {
var error = JsonConvert.DeserializeObject<RadarrError>(response); var error = JsonConvert.DeserializeObject<RadarrError>(response);
@ -114,7 +114,7 @@ namespace Ombi.Api.Radarr
} }
catch (JsonSerializationException jse) catch (JsonSerializationException jse)
{ {
Logger.LogError(LoggingEvents.RadarrApi, jse, "Error When adding movie to Radarr"); Logger.LogError(LoggingEvents.RadarrApi, jse, "Error When adding movie to Radarr, Reponse: {0}", response);
} }
return null; return null;
} }

View file

@ -8,11 +8,6 @@ namespace Ombi.Api.Sonarr.Models
public class CommandResult public class CommandResult
{ {
public string name { get; set; } public string name { get; set; }
public DateTime startedOn { get; set; }
public DateTime stateChangeTime { get; set; }
public bool sendUpdatesToClient { get; set; }
public string state { get; set; }
public int id { get; set; }
} }
} }