mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 13:23:20 -07:00
commit
43b190a0ac
5 changed files with 23 additions and 4 deletions
|
@ -107,6 +107,11 @@ namespace Ombi.Api
|
||||||
var error = JsonConvert.DeserializeObject < RadarrError>(response.Content);
|
var error = JsonConvert.DeserializeObject < RadarrError>(response.Content);
|
||||||
return new RadarrAddMovie {Error = error};
|
return new RadarrAddMovie {Error = error};
|
||||||
}
|
}
|
||||||
|
if (response.Content.Contains("\"errorMessage\":"))
|
||||||
|
{
|
||||||
|
var error = JsonConvert.DeserializeObject<List<SonarrError>>(response.Content).FirstOrDefault();
|
||||||
|
return new RadarrAddMovie {Error = new RadarrError {message = error?.errorMessage}};
|
||||||
|
}
|
||||||
return JsonConvert.DeserializeObject < RadarrAddMovie>(response.Content);
|
return JsonConvert.DeserializeObject < RadarrAddMovie>(response.Content);
|
||||||
}
|
}
|
||||||
catch (JsonSerializationException jse)
|
catch (JsonSerializationException jse)
|
||||||
|
|
|
@ -111,7 +111,7 @@ namespace Ombi.Core
|
||||||
if (!string.IsNullOrEmpty(result.Error?.message))
|
if (!string.IsNullOrEmpty(result.Error?.message))
|
||||||
{
|
{
|
||||||
Log.Error(result.Error.message);
|
Log.Error(result.Error.message);
|
||||||
return new MovieSenderResult { Result = false };
|
return new MovieSenderResult { Result = false, Error = true};
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(result.title))
|
if (!string.IsNullOrEmpty(result.title))
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,5 +36,7 @@ namespace Ombi.Core
|
||||||
/// <c>true</c> if [movie sending enabled]; otherwise, <c>false</c>.
|
/// <c>true</c> if [movie sending enabled]; otherwise, <c>false</c>.
|
||||||
/// </value>
|
/// </value>
|
||||||
public bool MovieSendingEnabled { get; set; }
|
public bool MovieSendingEnabled { get; set; }
|
||||||
|
|
||||||
|
public bool Error { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -275,7 +275,7 @@ namespace Ombi.UI.Modules
|
||||||
Episodes = tv.Episodes.ToArray(),
|
Episodes = tv.Episodes.ToArray(),
|
||||||
RootFolders = rootFolders.ToArray(),
|
RootFolders = rootFolders.ToArray(),
|
||||||
HasRootFolders = rootFolders.Any(),
|
HasRootFolders = rootFolders.Any(),
|
||||||
CurrentRootPath = GetRootPath(tv.RootFolderSelected, sonarrSettings).Result
|
CurrentRootPath = sonarrSettings.Enabled ? GetRootPath(tv.RootFolderSelected, sonarrSettings).Result : null
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
return Response.AsJson(viewModel);
|
return Response.AsJson(viewModel);
|
||||||
|
@ -292,7 +292,9 @@ namespace Ombi.UI.Modules
|
||||||
{
|
{
|
||||||
return r.path;
|
return r.path;
|
||||||
}
|
}
|
||||||
return string.Empty;
|
|
||||||
|
// Return default path
|
||||||
|
return rootFoldersResult.FirstOrDefault(x => x.id.Equals(int.Parse(sonarrSettings.RootPath)))?.path ?? string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<Response> GetAlbumRequests()
|
private async Task<Response> GetAlbumRequests()
|
||||||
|
|
|
@ -791,6 +791,16 @@ namespace Ombi.UI.Modules
|
||||||
return await AddRequest(model, settings,
|
return await AddRequest(model, settings,
|
||||||
$"{fullMovieName} {Resources.UI.Search_SuccessfullyAdded}");
|
$"{fullMovieName} {Resources.UI.Search_SuccessfullyAdded}");
|
||||||
}
|
}
|
||||||
|
if (result.Error)
|
||||||
|
|
||||||
|
{
|
||||||
|
return
|
||||||
|
Response.AsJson(new JsonResponseModel
|
||||||
|
{
|
||||||
|
Message = "Could not add movie, please contract your administrator",
|
||||||
|
Result = false
|
||||||
|
});
|
||||||
|
}
|
||||||
if (!result.MovieSendingEnabled)
|
if (!result.MovieSendingEnabled)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue