mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Small changes that might fix #1985 but doubt it
This commit is contained in:
parent
7c61a3cc0e
commit
dd5e40f3cd
6 changed files with 12 additions and 37 deletions
9
src/Ombi.Api.Radarr/CommandResult.cs
Normal file
9
src/Ombi.Api.Radarr/CommandResult.cs
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Ombi.Api.Radarr
|
||||||
|
{
|
||||||
|
public class CommandResult
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -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; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -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; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -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; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue