diff --git a/src/Ombi.Api.SickRage/Models/SickRageBase.cs b/src/Ombi.Api.SickRage/Models/SickRageBase.cs index 6ec1254b2..0ef34121d 100644 --- a/src/Ombi.Api.SickRage/Models/SickRageBase.cs +++ b/src/Ombi.Api.SickRage/Models/SickRageBase.cs @@ -7,4 +7,3 @@ public string result { get; set; } } } -} \ No newline at end of file diff --git a/src/Ombi.Core/Ombi.Core.csproj b/src/Ombi.Core/Ombi.Core.csproj index 741c727d9..46ac6a3df 100644 --- a/src/Ombi.Core/Ombi.Core.csproj +++ b/src/Ombi.Core/Ombi.Core.csproj @@ -23,6 +23,7 @@ + diff --git a/src/Ombi.Core/Senders/TvSender.cs b/src/Ombi.Core/Senders/TvSender.cs index d23ee7c49..0275656cf 100644 --- a/src/Ombi.Core/Senders/TvSender.cs +++ b/src/Ombi.Core/Senders/TvSender.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Ombi.Api.DogNzb; using Ombi.Api.DogNzb.Models; +using Ombi.Api.SickRage; using Ombi.Api.Sonarr; using Ombi.Api.Sonarr.Models; using Ombi.Core.Settings; @@ -17,20 +18,25 @@ namespace Ombi.Core.Senders public class TvSender : ITvSender { public TvSender(ISonarrApi sonarrApi, ILogger log, ISettingsService sonarrSettings, - ISettingsService dog, IDogNzbApi dogApi) + ISettingsService dog, IDogNzbApi dogApi, ISettingsService srSettings, + ISickRageApi srApi) { SonarrApi = sonarrApi; Logger = log; SonarrSettings = sonarrSettings; DogNzbSettings = dog; DogNzbApi = dogApi; + SickRageSettings = srSettings; + SickRageApi = srApi; } private ISonarrApi SonarrApi { get; } private IDogNzbApi DogNzbApi { get; } + private ISickRageApi SickRageApi { get; } private ILogger Logger { get; } private ISettingsService SonarrSettings { get; } private ISettingsService DogNzbSettings { get; } + private ISettingsService SickRageSettings { get; } public async Task Send(ChildRequests model) { @@ -240,6 +246,26 @@ namespace Ombi.Core.Senders } } + public async Task SendToSickRage(ChildRequests model, string qualityId = null) + { + var settings = await SickRageSettings.GetSettingsAsync(); + if (qualityId.HasValue()) + { + if (settings.Qualities.All(x => x.Key != qualityId)) + { + qualityId = settings.QualityProfile; + } + } + + //var apiResult = SickRageApi.AddSeries(model.ParentRequest.TvDbId, model.SeasonCount, model.SeasonList, qualityId, + // sickRageSettings.ApiKey, sickRageSettings.FullUri); + + //var result = apiResult.Result; + + + //return result; + } + private async Task SearchForRequest(ChildRequests model, IEnumerable sonarrEpList, SonarrSeries existingSeries, SonarrSettings s, IReadOnlyCollection episodesToUpdate) { diff --git a/src/Ombi/Ombi.csproj b/src/Ombi/Ombi.csproj index 0188741f5..0f0dfb8c6 100644 --- a/src/Ombi/Ombi.csproj +++ b/src/Ombi/Ombi.csproj @@ -78,6 +78,7 @@ +