mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 04:49:33 -07:00
Merge branch 'dev' of https://github.com/tidusjar/PlexRequests.Net.git
This commit is contained in:
commit
a1bf73f137
3 changed files with 43 additions and 12 deletions
|
@ -65,7 +65,7 @@ namespace PlexRequests.Helpers.Tests
|
|||
"ProviderId", "ImdbId", "TvDbId", "Overview", "Title", "PosterPath", "ReleaseDate", "Type",
|
||||
"Status", "Approved", "RequestedBy", "RequestedDate", "Available", "Issues", "OtherMessage", "AdminNote",
|
||||
"SeasonList", "SeasonCount", "SeasonsRequested", "MusicBrainzId", "RequestedUsers","ArtistName",
|
||||
"ArtistId","IssueId","Episodes","AllUsers","CanApprove","Id"
|
||||
"ArtistId","IssueId","Episodes", "Denied", "DeniedReason", "AllUsers","CanApprove","Id",
|
||||
}).SetName("Requested Model");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ using PlexRequests.Api.Models.Sonarr;
|
|||
using PlexRequests.Core.SettingModels;
|
||||
using PlexRequests.Store;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using PlexRequests.Helpers.Exceptions;
|
||||
|
@ -93,7 +94,7 @@ namespace PlexRequests.UI.Helpers
|
|||
|
||||
// Get the series that was just added
|
||||
series = await GetSonarrSeries(sonarrSettings, model.ProviderId);
|
||||
series.monitored = false; // Un-monitor the series
|
||||
series.monitored = true; // We want to make sure we are monitoring the series
|
||||
|
||||
// Un-monitor all seasons
|
||||
foreach (var season in series.seasons)
|
||||
|
@ -112,6 +113,12 @@ namespace PlexRequests.UI.Helpers
|
|||
}
|
||||
|
||||
if (series != null)
|
||||
{
|
||||
var requestAll = model.SeasonsRequested.Equals("All", StringComparison.CurrentCultureIgnoreCase);
|
||||
var first = model.SeasonsRequested.Equals("First", StringComparison.CurrentCultureIgnoreCase);
|
||||
var latest = model.SeasonsRequested.Equals("Latest", StringComparison.CurrentCultureIgnoreCase);
|
||||
|
||||
if (model.SeasonList.Any())
|
||||
{
|
||||
// Monitor the seasons that we have chosen
|
||||
foreach (var season in series.seasons)
|
||||
|
@ -121,6 +128,29 @@ namespace PlexRequests.UI.Helpers
|
|||
season.monitored = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (requestAll)
|
||||
{
|
||||
// Monitor all seasons
|
||||
foreach (var season in series.seasons)
|
||||
{
|
||||
season.monitored = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (first)
|
||||
{
|
||||
var firstSeries = series?.seasons?.OrderBy(x => x.seasonNumber)?.FirstOrDefault() ?? new Season();
|
||||
firstSeries.monitored = true;
|
||||
}
|
||||
|
||||
if (latest)
|
||||
{
|
||||
var lastSeries = series?.seasons?.OrderByDescending(x => x.seasonNumber)?.FirstOrDefault() ?? new Season();
|
||||
lastSeries.monitored = true;
|
||||
}
|
||||
|
||||
|
||||
// Update the series in sonarr with the new monitored status
|
||||
SonarrApi.UpdateSeries(series, sonarrSettings.ApiKey, sonarrSettings.FullUri);
|
||||
|
|
|
@ -53,14 +53,15 @@ namespace PlexRequests.UI.Modules
|
|||
private Response CheckAuth()
|
||||
{
|
||||
var settings = PlexRequestSettings.GetSettings();
|
||||
|
||||
var baseUrl = settings.BaseUrl;
|
||||
|
||||
// Have we been through the wizard?
|
||||
if (!settings.Wizard)
|
||||
{
|
||||
return Context.GetRedirect("~/wizard");
|
||||
return Context.GetRedirect(string.IsNullOrEmpty(baseUrl) ? "~/wizard" : $"~/{baseUrl}/wizard");
|
||||
}
|
||||
|
||||
var baseUrl = settings.BaseUrl;
|
||||
|
||||
var redirectPath = string.IsNullOrEmpty(baseUrl) ? "~/userlogin" : $"~/{baseUrl}/userlogin";
|
||||
|
||||
return Session[SessionKeys.UsernameKey] == null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue