mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 05:43:19 -07:00
Added root folder and approving quality profiles in radarr #1065
This commit is contained in:
parent
10ef372cfd
commit
a93c18bc04
14 changed files with 395 additions and 32 deletions
|
@ -50,5 +50,6 @@ namespace Ombi.Core
|
|||
public const string GetPlexRequestSettings = nameof(GetPlexRequestSettings);
|
||||
public const string LastestProductVersion = nameof(LastestProductVersion);
|
||||
public const string SonarrRootFolders = nameof(SonarrRootFolders);
|
||||
public const string RadarrRootFolders = nameof(RadarrRootFolders);
|
||||
}
|
||||
}
|
|
@ -73,7 +73,7 @@ namespace Ombi.Core
|
|||
|
||||
if (radarrSettings.Enabled)
|
||||
{
|
||||
return SendToRadarr(model, radarrSettings);
|
||||
return SendToRadarr(model, radarrSettings, qualityId);
|
||||
}
|
||||
|
||||
return new MovieSenderResult { Result = false, MovieSendingEnabled = false };
|
||||
|
@ -102,16 +102,25 @@ namespace Ombi.Core
|
|||
return new MovieSenderResult { Result = result, MovieSendingEnabled = true };
|
||||
}
|
||||
|
||||
private MovieSenderResult SendToRadarr(RequestedModel model, RadarrSettings settings)
|
||||
private MovieSenderResult SendToRadarr(RequestedModel model, RadarrSettings settings, string qualityId)
|
||||
{
|
||||
var qualityProfile = 0;
|
||||
int.TryParse(settings.QualityProfile, out qualityProfile);
|
||||
if (!string.IsNullOrEmpty(qualityId)) // try to parse the passed in quality, otherwise use the settings default quality
|
||||
{
|
||||
int.TryParse(qualityId, out qualityProfile);
|
||||
}
|
||||
|
||||
if (qualityProfile <= 0)
|
||||
{
|
||||
int.TryParse(settings.QualityProfile, out qualityProfile);
|
||||
}
|
||||
|
||||
var result = RadarrApi.AddMovie(model.ProviderId, model.Title, model.ReleaseDate.Year, qualityProfile, settings.RootPath, settings.ApiKey, settings.FullUri, true);
|
||||
|
||||
if (!string.IsNullOrEmpty(result.Error?.message))
|
||||
{
|
||||
Log.Error(result.Error.message);
|
||||
return new MovieSenderResult { Result = false, Error = true};
|
||||
return new MovieSenderResult { Result = false, Error = true , MovieSendingEnabled = true};
|
||||
}
|
||||
if (!string.IsNullOrEmpty(result.title))
|
||||
{
|
||||
|
|
|
@ -32,6 +32,6 @@ namespace Ombi.Core.SettingModels
|
|||
public string ApiKey { get; set; }
|
||||
public string QualityProfile { get; set; }
|
||||
public string RootPath { get; set; }
|
||||
|
||||
public string FullRootPath { get; set; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue