mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 13:53:19 -07:00
fixed #608 and some other small stuff
This commit is contained in:
parent
bbe52a17d8
commit
4dc4f83506
8 changed files with 109 additions and 35 deletions
|
@ -119,43 +119,19 @@ namespace PlexRequests.UI.Helpers
|
|||
return addResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (requestAll ?? false)
|
||||
{
|
||||
//// Monitor all seasons
|
||||
//foreach (var season in series.seasons)
|
||||
//{
|
||||
// season.monitored = true;
|
||||
//}
|
||||
|
||||
|
||||
//SonarrApi.UpdateSeries(series, sonarrSettings.ApiKey, sonarrSettings.FullUri);
|
||||
//SonarrApi.SearchForSeries(series.id, sonarrSettings.ApiKey, sonarrSettings.FullUri); // Search For all episodes!"
|
||||
|
||||
|
||||
// This is a work around for this issue: https://github.com/Sonarr/Sonarr/issues/1507
|
||||
// The above is the previous code.
|
||||
SonarrApi.AddSeries(model.ProviderId, model.Title, qualityProfile,
|
||||
sonarrSettings.SeasonFolders, sonarrSettings.RootPath, 0, model.SeasonList, sonarrSettings.ApiKey,
|
||||
sonarrSettings.FullUri, true, true);
|
||||
return new SonarrAddSeries { title = series.title }; // We have updated it
|
||||
}
|
||||
|
||||
// Series exists, don't need to add it
|
||||
if (series == null)
|
||||
{
|
||||
// Set the series as monitored with a season count as 0 so it doesn't search for anything
|
||||
SonarrApi.AddSeries(model.ProviderId, model.Title, qualityProfile,
|
||||
sonarrSettings.SeasonFolders, sonarrSettings.RootPath, 0, model.SeasonList, sonarrSettings.ApiKey,
|
||||
SonarrApi.AddSeriesNew(model.ProviderId, model.Title, qualityProfile,
|
||||
sonarrSettings.SeasonFolders, sonarrSettings.RootPath, new int[] {1,2,3,4,5,6,7,8,9,10,11,12,13}, sonarrSettings.ApiKey,
|
||||
sonarrSettings.FullUri);
|
||||
|
||||
await Task.Delay(TimeSpan.FromSeconds(1));
|
||||
|
||||
series = await GetSonarrSeries(sonarrSettings, model.ProviderId);
|
||||
|
||||
|
||||
// Due to the bug above, we need to make sure all seasons are not monitored
|
||||
|
||||
foreach (var s in series.seasons)
|
||||
{
|
||||
s.monitored = false;
|
||||
|
@ -164,6 +140,29 @@ namespace PlexRequests.UI.Helpers
|
|||
SonarrApi.UpdateSeries(series, sonarrSettings.ApiKey, sonarrSettings.FullUri);
|
||||
}
|
||||
|
||||
if (requestAll ?? false)
|
||||
{
|
||||
// Monitor all seasons
|
||||
foreach (var season in series.seasons)
|
||||
{
|
||||
season.monitored = true;
|
||||
}
|
||||
|
||||
|
||||
SonarrApi.UpdateSeries(series, sonarrSettings.ApiKey, sonarrSettings.FullUri);
|
||||
SonarrApi.SearchForSeries(series.id, sonarrSettings.ApiKey, sonarrSettings.FullUri); // Search For all episodes!"
|
||||
|
||||
|
||||
//// This is a work around for this issue: https://github.com/Sonarr/Sonarr/issues/1507
|
||||
//// The above is the previous code.
|
||||
//SonarrApi.AddSeries(model.ProviderId, model.Title, qualityProfile,
|
||||
// sonarrSettings.SeasonFolders, sonarrSettings.RootPath, 0, model.SeasonList, sonarrSettings.ApiKey,
|
||||
// sonarrSettings.FullUri, true, true);
|
||||
return new SonarrAddSeries { title = series.title }; // We have updated it
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (first ?? false)
|
||||
{
|
||||
var firstSeries = (series?.seasons?.OrderBy(x => x.seasonNumber)).FirstOrDefault(x => x.seasonNumber > 0) ?? new Season();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue