mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-23 14:35:24 -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();
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<button id="recentlyAddedBtn" class="btn btn-primary-outline">Send test email to Admin</button>
|
||||
<button id="recentlyAddedBtn" class="btn btn-primary-outline">Send test email to Admin <div id="spinner"></div></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -103,7 +103,7 @@
|
|||
e.preventDefault();
|
||||
var base = '@Html.GetBaseUrl()';
|
||||
var url = createBaseUrl(base, '/admin/recentlyAddedTest');
|
||||
|
||||
$('#spinner').attr("class", "fa fa-spinner fa-spin");
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: url,
|
||||
|
@ -111,14 +111,17 @@
|
|||
success: function (response) {
|
||||
if (response) {
|
||||
generateNotify(response.message, "success");
|
||||
$('#spinner').attr("class", "fa fa-check");
|
||||
} else {
|
||||
|
||||
generateNotify(response.message, "danger");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
$('#spinner').attr("class", "fa fa-times");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -223,11 +223,10 @@
|
|||
{{/if}}
|
||||
<div>@UI.Requests_RequestedDate: {{requestedDate}}</div>
|
||||
<div>
|
||||
@UI.Issues_Issue:
|
||||
{{#if_eq issueId 0}}
|
||||
<i class="fa fa-times"></i>
|
||||
@*Nothing*@
|
||||
{{else}}
|
||||
<a href="@formAction/issues/{{issueId}}"><i class="fa fa-check"></i></a>
|
||||
@UI.Issues_Issue: <a href="@formAction/issues/{{issueId}}"><i class="fa fa-check"></i></a>
|
||||
{{/if_eq}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue