mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-10 15:32:37 -07:00
#132 auto-approve for admins
This commit is contained in:
parent
2d4f680537
commit
ea6f33102a
1 changed files with 11 additions and 3 deletions
|
@ -31,6 +31,7 @@ using System.Linq;
|
|||
|
||||
using Nancy;
|
||||
using Nancy.Responses.Negotiation;
|
||||
using Nancy.Security;
|
||||
|
||||
using NLog;
|
||||
|
||||
|
@ -107,6 +108,13 @@ namespace PlexRequests.UI.Modules
|
|||
private IHeadphonesApi HeadphonesApi { get; }
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private bool IsAdmin {
|
||||
get
|
||||
{
|
||||
return Context.CurrentUser.IsAuthenticated();
|
||||
}
|
||||
}
|
||||
|
||||
private Negotiator RequestLoad()
|
||||
{
|
||||
var settings = PrService.GetSettings();
|
||||
|
@ -260,7 +268,7 @@ namespace PlexRequests.UI.Modules
|
|||
};
|
||||
|
||||
Log.Trace(settings.DumpJson());
|
||||
if (!settings.RequireMovieApproval || settings.ApprovalWhiteList.Any(x => x.Equals(Username, StringComparison.OrdinalIgnoreCase)))
|
||||
if (IsAdmin || !settings.RequireMovieApproval || settings.ApprovalWhiteList.Any(x => x.Equals(Username, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var cpSettings = CpService.GetSettings();
|
||||
|
||||
|
@ -414,7 +422,7 @@ namespace PlexRequests.UI.Modules
|
|||
|
||||
model.SeasonList = seasonsList.ToArray();
|
||||
|
||||
if (!settings.RequireTvShowApproval || settings.ApprovalWhiteList.Any(x => x.Equals(Username, StringComparison.OrdinalIgnoreCase)))
|
||||
if (IsAdmin || !settings.RequireTvShowApproval || settings.ApprovalWhiteList.Any(x => x.Equals(Username, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var sonarrSettings = SonarrService.GetSettings();
|
||||
var sender = new TvSender(SonarrApi, SickrageApi);
|
||||
|
@ -529,7 +537,7 @@ namespace PlexRequests.UI.Modules
|
|||
};
|
||||
|
||||
|
||||
if (!settings.RequireMusicApproval ||
|
||||
if (IsAdmin || !settings.RequireMusicApproval ||
|
||||
settings.ApprovalWhiteList.Any(x => x.Equals(Username, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
Log.Debug("We don't require approval OR the user is in the whitelist");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue