mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-13 16:52:56 -07:00
Got a bit of the work done, needs some polish then tackle tv
This commit is contained in:
parent
873823017c
commit
c5f123b903
35 changed files with 356 additions and 820 deletions
|
@ -69,19 +69,25 @@ namespace Ombi.Core.Engine
|
|||
var userDetails = await GetUser();
|
||||
var canRequestOnBehalf = false;
|
||||
|
||||
if (model.RequestOnBehalf.HasValue())
|
||||
var isAdmin = await UserManager.IsInRoleAsync(userDetails, OmbiRoles.PowerUser) || await UserManager.IsInRoleAsync(userDetails, OmbiRoles.Admin);
|
||||
if (model.RequestOnBehalf.HasValue() && !isAdmin)
|
||||
{
|
||||
canRequestOnBehalf = await UserManager.IsInRoleAsync(userDetails, OmbiRoles.PowerUser) || await UserManager.IsInRoleAsync(userDetails, OmbiRoles.Admin);
|
||||
|
||||
if (!canRequestOnBehalf)
|
||||
return new RequestEngineResult
|
||||
{
|
||||
return new RequestEngineResult
|
||||
{
|
||||
Result = false,
|
||||
Message = "You do not have the correct permissions to request on behalf of users!",
|
||||
ErrorMessage = $"You do not have the correct permissions to request on behalf of users!"
|
||||
};
|
||||
}
|
||||
Result = false,
|
||||
Message = "You do not have the correct permissions to request on behalf of users!",
|
||||
ErrorMessage = $"You do not have the correct permissions to request on behalf of users!"
|
||||
};
|
||||
}
|
||||
|
||||
if ((model.RootFolderOverride.HasValue || model.QualityPathOverride.HasValue) && !isAdmin)
|
||||
{
|
||||
return new RequestEngineResult
|
||||
{
|
||||
Result = false,
|
||||
Message = "You do not have the correct permissions!",
|
||||
ErrorMessage = $"You do not have the correct permissions!"
|
||||
};
|
||||
}
|
||||
|
||||
var requestModel = new MovieRequests
|
||||
|
@ -101,7 +107,9 @@ namespace Ombi.Core.Engine
|
|||
RequestedUserId = canRequestOnBehalf ? model.RequestOnBehalf : userDetails.Id,
|
||||
Background = movieInfo.BackdropPath,
|
||||
LangCode = model.LanguageCode,
|
||||
RequestedByAlias = model.RequestedByAlias
|
||||
RequestedByAlias = model.RequestedByAlias,
|
||||
RootPathOverride = model.RootFolderOverride.GetValueOrDefault(),
|
||||
QualityOverride = model.QualityPathOverride.GetValueOrDefault()
|
||||
};
|
||||
|
||||
var usDates = movieInfo.ReleaseDates?.Results?.FirstOrDefault(x => x.IsoCode == "US");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue