mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 15:56:05 -07:00
Finished reworking the Sonarr Integration. Seems to be working as expected, faster and most stable. It's Not A Toomah!
This commit is contained in:
parent
858171e92a
commit
4836ab7e6c
3 changed files with 14 additions and 15 deletions
|
@ -124,12 +124,9 @@ namespace Ombi.Core.Tv
|
||||||
// Also make sure the series is now monitored otherwise we won't search for it
|
// Also make sure the series is now monitored otherwise we won't search for it
|
||||||
series.monitored = true;
|
series.monitored = true;
|
||||||
foreach (var seasons in series.seasons)
|
foreach (var seasons in series.seasons)
|
||||||
{
|
|
||||||
if (model.SeasonList.Any(x => x == seasons.seasonNumber))
|
|
||||||
{
|
{
|
||||||
seasons.monitored = true;
|
seasons.monitored = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Send the update command
|
// Send the update command
|
||||||
series = SonarrApi.UpdateSeries(series, sonarrSettings.ApiKey, sonarrSettings.FullUri);
|
series = SonarrApi.UpdateSeries(series, sonarrSettings.ApiKey, sonarrSettings.FullUri);
|
||||||
|
@ -217,6 +214,7 @@ namespace Ombi.Core.Tv
|
||||||
var season = new Season
|
var season = new Season
|
||||||
{
|
{
|
||||||
seasonNumber = i,
|
seasonNumber = i,
|
||||||
|
// The model.SeasonList.Lenth is 0 when this is a "request all"
|
||||||
monitored = model.SeasonList.Length == 0 || model.SeasonList.Any(x => x == i)
|
monitored = model.SeasonList.Length == 0 || model.SeasonList.Any(x => x == i)
|
||||||
};
|
};
|
||||||
seriesToAdd.seasons.Add(season);
|
seriesToAdd.seasons.Add(season);
|
||||||
|
|
|
@ -109,7 +109,7 @@ namespace Ombi.Services.Jobs
|
||||||
var metadata = PlexApi.GetEpisodeMetaData(settings.PlexAuthToken, settings.FullUri, video.RatingKey);
|
var metadata = PlexApi.GetEpisodeMetaData(settings.PlexAuthToken, settings.FullUri, video.RatingKey);
|
||||||
|
|
||||||
// Loop through the metadata and create the model to insert into the DB
|
// Loop through the metadata and create the model to insert into the DB
|
||||||
foreach (var metadataVideo in metadata.Video)
|
foreach (var metadataVideo in metadata?.Video ?? new List<Video>())
|
||||||
{
|
{
|
||||||
if(string.IsNullOrEmpty(metadataVideo.GrandparentTitle))
|
if(string.IsNullOrEmpty(metadataVideo.GrandparentTitle))
|
||||||
{
|
{
|
||||||
|
@ -119,11 +119,11 @@ namespace Ombi.Services.Jobs
|
||||||
entities.TryAdd(
|
entities.TryAdd(
|
||||||
new PlexEpisodes
|
new PlexEpisodes
|
||||||
{
|
{
|
||||||
EpisodeNumber = epInfo.EpisodeNumber,
|
EpisodeNumber = epInfo?.EpisodeNumber ?? 0,
|
||||||
EpisodeTitle = metadataVideo.Title,
|
EpisodeTitle = metadataVideo.Title,
|
||||||
ProviderId = epInfo.ProviderId,
|
ProviderId = epInfo?.ProviderId ?? "",
|
||||||
RatingKey = metadataVideo.RatingKey,
|
RatingKey = metadataVideo.RatingKey,
|
||||||
SeasonNumber = epInfo.SeasonNumber,
|
SeasonNumber = epInfo?.SeasonNumber ?? 0,
|
||||||
ShowTitle = metadataVideo.GrandparentTitle
|
ShowTitle = metadataVideo.GrandparentTitle
|
||||||
},
|
},
|
||||||
1);
|
1);
|
||||||
|
|
|
@ -1120,7 +1120,8 @@ namespace Ombi.UI.Modules
|
||||||
RequestedUsers = new List<string> { Username },
|
RequestedUsers = new List<string> { Username },
|
||||||
Issues = IssueState.None,
|
Issues = IssueState.None,
|
||||||
ImdbId = showInfo.externals?.imdb ?? string.Empty,
|
ImdbId = showInfo.externals?.imdb ?? string.Empty,
|
||||||
TvDbId = showId.ToString()
|
TvDbId = showId.ToString(),
|
||||||
|
ProviderId = showId
|
||||||
};
|
};
|
||||||
|
|
||||||
var totalSeasons = showInfo.Season.GroupBy(x => x.SeasonNumber);
|
var totalSeasons = showInfo.Season.GroupBy(x => x.SeasonNumber);
|
||||||
|
@ -1886,8 +1887,8 @@ namespace Ombi.UI.Modules
|
||||||
{
|
{
|
||||||
model.Approved = true;
|
model.Approved = true;
|
||||||
var s = await sonarrSettings;
|
var s = await sonarrSettings;
|
||||||
//var sender = new TvSenderV2(SonarrApi, SickrageApi, Cache);
|
var sender = new TvSenderV2(SonarrApi, SickrageApi, Cache);
|
||||||
var sender = new TvSenderOld(SonarrApi, SickrageApi, Cache);
|
//var sender = new TvSenderOld(SonarrApi, SickrageApi, Cache);
|
||||||
if (s.Enabled)
|
if (s.Enabled)
|
||||||
{
|
{
|
||||||
var result = await sender.SendToSonarr(s, model);
|
var result = await sender.SendToSonarr(s, model);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue