mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-31 12:00:06 -07:00
feat: fixed up all the movie requests page
This commit is contained in:
parent
d500e1a9d6
commit
5e8f06cd24
7 changed files with 52 additions and 36 deletions
|
@ -102,7 +102,7 @@ namespace Ombi.Core.Engine
|
||||||
{
|
{
|
||||||
if (model.Is4kRequest)
|
if (model.Is4kRequest)
|
||||||
{
|
{
|
||||||
existingRequest.Has4KRequest = model.Is4kRequest;
|
existingRequest.Is4kRequest = true;
|
||||||
existingRequest.RequestedDate4k = DateTime.Now;
|
existingRequest.RequestedDate4k = DateTime.Now;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -134,7 +134,8 @@ namespace Ombi.Core.Engine
|
||||||
RequestedByAlias = model.RequestedByAlias,
|
RequestedByAlias = model.RequestedByAlias,
|
||||||
RootPathOverride = model.RootFolderOverride.GetValueOrDefault(),
|
RootPathOverride = model.RootFolderOverride.GetValueOrDefault(),
|
||||||
QualityOverride = model.QualityPathOverride.GetValueOrDefault(),
|
QualityOverride = model.QualityPathOverride.GetValueOrDefault(),
|
||||||
Has4KRequest = model.Is4kRequest
|
RequestedDate4k = model.Is4kRequest ? DateTime.Now : DateTime.MinValue,
|
||||||
|
Is4kRequest = model.Is4kRequest
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +156,7 @@ namespace Ombi.Core.Engine
|
||||||
|
|
||||||
if (requestModel.Approved) // The rules have auto approved this
|
if (requestModel.Approved) // The rules have auto approved this
|
||||||
{
|
{
|
||||||
var requestEngineResult = await AddMovieRequest(requestModel, fullMovieName, model.RequestOnBehalf, isExisting);
|
var requestEngineResult = await AddMovieRequest(requestModel, fullMovieName, model.RequestOnBehalf, isExisting, model.Is4kRequest);
|
||||||
if (requestEngineResult.Result)
|
if (requestEngineResult.Result)
|
||||||
{
|
{
|
||||||
var result = await ApproveMovie(requestModel, model.Is4kRequest);
|
var result = await ApproveMovie(requestModel, model.Is4kRequest);
|
||||||
|
@ -176,7 +177,7 @@ namespace Ombi.Core.Engine
|
||||||
// If there are no providers then it's successful but movie has not been sent
|
// If there are no providers then it's successful but movie has not been sent
|
||||||
}
|
}
|
||||||
|
|
||||||
return await AddMovieRequest(requestModel, fullMovieName, model.RequestOnBehalf, isExisting);
|
return await AddMovieRequest(requestModel, fullMovieName, model.RequestOnBehalf, isExisting, model.Is4kRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -581,9 +582,18 @@ namespace Ombi.Core.Engine
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
request.MarkedAsApproved = DateTime.Now;
|
if (is4K)
|
||||||
request.Approved = true;
|
{
|
||||||
request.Denied = false;
|
request.MarkedAsApproved4K = DateTime.Now;
|
||||||
|
request.Approved4K = true;
|
||||||
|
request.Denied4K = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
request.MarkedAsApproved = DateTime.Now;
|
||||||
|
request.Approved = true;
|
||||||
|
request.Denied = false;
|
||||||
|
}
|
||||||
await MovieRepository.Update(request);
|
await MovieRepository.Update(request);
|
||||||
|
|
||||||
var canNotify = await RunSpecificRule(request, SpecificRules.CanSendNotification, string.Empty);
|
var canNotify = await RunSpecificRule(request, SpecificRules.CanSendNotification, string.Empty);
|
||||||
|
@ -789,8 +799,12 @@ namespace Ombi.Core.Engine
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<RequestEngineResult> AddMovieRequest(MovieRequests model, string movieName, string requestOnBehalf, bool isExisting)
|
private async Task<RequestEngineResult> AddMovieRequest(MovieRequests model, string movieName, string requestOnBehalf, bool isExisting, bool is4k)
|
||||||
{
|
{
|
||||||
|
if (is4k)
|
||||||
|
{
|
||||||
|
model.Has4KRequest = true;
|
||||||
|
}
|
||||||
if (!isExisting)
|
if (!isExisting)
|
||||||
{
|
{
|
||||||
await MovieRepository.Add(model);
|
await MovieRepository.Add(model);
|
||||||
|
|
|
@ -31,11 +31,11 @@ namespace Ombi.Core.Rule.Rules.Request
|
||||||
if (obj.RequestType == RequestType.Movie)
|
if (obj.RequestType == RequestType.Movie)
|
||||||
{
|
{
|
||||||
var movie = (MovieRequests)obj;
|
var movie = (MovieRequests)obj;
|
||||||
if (movie.Has4KRequest)
|
if (movie.Is4kRequest)
|
||||||
{
|
{
|
||||||
movie.Approved4K = true;
|
movie.Approved4K = true;
|
||||||
}
|
}
|
||||||
if (movie.RequestedDate != DateTime.MinValue)
|
else
|
||||||
{
|
{
|
||||||
obj.Approved = true;
|
obj.Approved = true;
|
||||||
}
|
}
|
||||||
|
@ -50,11 +50,11 @@ namespace Ombi.Core.Rule.Rules.Request
|
||||||
if (obj.RequestType == RequestType.Movie && await _manager.IsInRoleAsync(user, OmbiRoles.AutoApproveMovie))
|
if (obj.RequestType == RequestType.Movie && await _manager.IsInRoleAsync(user, OmbiRoles.AutoApproveMovie))
|
||||||
{
|
{
|
||||||
var movie = (MovieRequests)obj;
|
var movie = (MovieRequests)obj;
|
||||||
if (movie.Has4KRequest)
|
if (movie.Is4kRequest)
|
||||||
{
|
{
|
||||||
movie.Approved4K = true;
|
movie.Approved4K = true;
|
||||||
}
|
}
|
||||||
if (movie.RequestedDate != DateTime.MinValue)
|
else
|
||||||
{
|
{
|
||||||
obj.Approved = true;
|
obj.Approved = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace Ombi.Core.Rule.Rules.Request
|
||||||
var hasAutoApprove = await _manager.IsInRoleAsync(user, OmbiRoles.AutoApproveMovie);
|
var hasAutoApprove = await _manager.IsInRoleAsync(user, OmbiRoles.AutoApproveMovie);
|
||||||
if (await _manager.IsInRoleAsync(user, OmbiRoles.RequestMovie) || hasAutoApprove)
|
if (await _manager.IsInRoleAsync(user, OmbiRoles.RequestMovie) || hasAutoApprove)
|
||||||
{
|
{
|
||||||
if (movie.Has4KRequest && !hasAutoApprove)
|
if (movie.Is4kRequest && !hasAutoApprove)
|
||||||
{
|
{
|
||||||
var has4kPermission = await _manager.IsInRoleAsync(user, OmbiRoles.Request4KMovie);
|
var has4kPermission = await _manager.IsInRoleAsync(user, OmbiRoles.Request4KMovie);
|
||||||
if (has4kPermission)
|
if (has4kPermission)
|
||||||
|
|
|
@ -58,11 +58,11 @@ namespace Ombi.Core.Rule.Rules.Request
|
||||||
|
|
||||||
private static bool Check4KRequests(MovieRequests movie,MovieRequests existing)
|
private static bool Check4KRequests(MovieRequests movie,MovieRequests existing)
|
||||||
{
|
{
|
||||||
if (movie.Has4KRequest && existing.Has4KRequest)
|
if (movie.Is4kRequest && existing.Has4KRequest)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!movie.Has4KRequest && !existing.Has4KRequest)
|
if (!movie.Is4kRequest && !existing.Has4KRequest)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,13 @@ namespace Ombi.Store.Entities.Requests
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public bool ShowSubscribe { get; set; }
|
public bool ShowSubscribe { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This is only used during the request process to identify if
|
||||||
|
/// it's a regular request or a 4k
|
||||||
|
/// </summary>
|
||||||
|
[NotMapped]
|
||||||
|
public bool Is4kRequest { get; set; }
|
||||||
|
|
||||||
public int RootPathOverride { get; set; }
|
public int RootPathOverride { get; set; }
|
||||||
public int QualityOverride { get; set; }
|
public int QualityOverride { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@
|
||||||
|
|
||||||
<!-- 4k Status -->
|
<!-- 4k Status -->
|
||||||
<button mat-raised-button class="btn-green btn-spacing" id="availableBtn" *ngIf="movie.available4K && !movie.plexUrl && !movie.embyUrl && !movie.jellyfinUrl"> {{
|
<button mat-raised-button class="btn-green btn-spacing" id="availableBtn" *ngIf="movie.available4K && !movie.plexUrl && !movie.embyUrl && !movie.jellyfinUrl"> {{
|
||||||
'Common.Available' | translate }}</button>
|
'Common.Available4K' | translate }}</button>
|
||||||
<span *ngIf="!movie.available4K">
|
<span *ngIf="!movie.available4K">
|
||||||
<span *ngIf="movie.has4KRequest || movie.approved4K; then requestedBtn4K else notRequestedBtn4K"></span>
|
<span *ngIf="movie.has4KRequest || movie.approved4K; then requestedBtn4K else notRequestedBtn4K"></span>
|
||||||
<ng-template #requestedBtn4K>
|
<ng-template #requestedBtn4K>
|
||||||
|
@ -105,43 +105,37 @@
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span *ngIf="isAdmin && hasRequest">
|
<span *ngIf="isAdmin && hasRequest">
|
||||||
<button id="approveBtn" *ngIf="!movie.approved && movie.requested" (click)="approve(false)" mat-raised-button class="btn-spacing" color="accent">
|
<button id="approveBtn" *ngIf="!movie.approved && movie.requested" (click)="approve(false)" mat-raised-button class="btn-spacing" color="accent">
|
||||||
<i class="fas fa-plus"></i> {{ 'Common.Approve' | translate }}
|
<i class="fas fa-plus"></i> {{ 'Common.Approve' | translate }}
|
||||||
</button>
|
</button>
|
||||||
<button id="approve4kBtn" *ngIf="!movie.approved4K && movie.has4KRequest " (click)="approve(true)" mat-raised-button class="btn-spacing" color="accent">
|
<button id="approve4kBtn" *ngIf="!movie.approved4K && movie.has4KRequest" (click)="approve(true)" mat-raised-button class="btn-spacing" color="accent">
|
||||||
<i class="fas fa-plus"></i> {{ 'Common.Approve4K' | translate }}
|
<i class="fas fa-plus"></i> {{ 'Common.Approve4K' | translate }}
|
||||||
</button>
|
</button>
|
||||||
<button id="markAvailableBtn" *ngIf="!movie.available" (click)="markAvailable(false)" mat-raised-button class="btn-spacing"
|
<button id="markAvailableBtn" *ngIf="!movie.available && movie.requested" (click)="markAvailable(false)" mat-raised-button class="btn-spacing"
|
||||||
color="accent">
|
color="accent">
|
||||||
<i class="fas fa-plus"></i> {{ 'Requests.MarkAvailable' | translate }}
|
<i class="fas fa-plus"></i> {{ 'Requests.MarkAvailable' | translate }}
|
||||||
</button>
|
</button>
|
||||||
<button id="markAvailable4kBtn" *ngIf="!movie.available4K" (click)="markAvailable(true)" mat-raised-button class="btn-spacing"
|
<button id="markAvailable4kBtn" *ngIf="!movie.available4K && movie.has4KRequest" (click)="markAvailable(true)" mat-raised-button class="btn-spacing"
|
||||||
color="accent">
|
color="accent">
|
||||||
<i class="fas fa-plus"></i> {{ 'Requests.MarkAvailable4K' | translate }}
|
<i class="fas fa-plus"></i> {{ 'Requests.MarkAvailable4K' | translate }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button id="markUnavailableBtn" *ngIf="movie.available" (click)="markUnavailable(false)" mat-raised-button class="btn-spacing"
|
<button id="markUnavailableBtn" *ngIf="movie.available && movie.requested" (click)="markUnavailable(false)" mat-raised-button class="btn-spacing"
|
||||||
color="accent">
|
color="accent">
|
||||||
<i class="fas fa-minus"></i> {{ 'Requests.MarkUnavailable' | translate }}
|
<i class="fas fa-minus"></i> {{ 'Requests.MarkUnavailable' | translate }}
|
||||||
</button>
|
</button>
|
||||||
<button id="markUnavailable4kBtn" *ngIf="movie.available4K" (click)="markUnavailable(true)" mat-raised-button class="btn-spacing"
|
<button id="markUnavailable4kBtn" *ngIf="movie.available4K" (click)="markUnavailable(true)" mat-raised-button class="btn-spacing"
|
||||||
color="accent">
|
color="accent">
|
||||||
<i class="fas fa-minus"></i> {{ 'Requests.MarkUnavailable4K' | translate }}
|
<i class="fas fa-minus"></i> {{ 'Requests.MarkUnavailable4K' | translate }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button id="denyBtn" *ngIf="!movieRequest.denied" mat-raised-button class="btn-spacing" color="warn" (click)="deny(false)">
|
<button id="denyBtn" *ngIf="!movieRequest.denied && movie.requested" mat-raised-button class="btn-spacing" color="warn" (click)="deny(false)">
|
||||||
<i class="fas fa-times"></i> {{'Requests.Deny' | translate }}
|
<i class="fas fa-times"></i> {{'Requests.Deny' | translate }}
|
||||||
</button>
|
</button>
|
||||||
<button id="denyBtn4K" *ngIf="!movieRequest.denied4K" mat-raised-button class="btn-spacing" color="warn" (click)="deny(true)">
|
|
||||||
<i class="fas fa-times"></i> {{'Requests.Deny4K' | translate }}
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button id="deniedButton" *ngIf="movieRequest && movieRequest.denied" [matTooltip]="movieRequest.deniedReason" mat-raised-button class="btn-spacing" color="warn">
|
<button id="deniedButton" *ngIf="movieRequest && movieRequest.denied" [matTooltip]="movieRequest.deniedReason" mat-raised-button class="btn-spacing" color="warn">
|
||||||
<i class="fas fa-times"></i> {{'MediaDetails.Denied' | translate }}
|
<i class="fas fa-times"></i> {{'MediaDetails.Denied' | translate }}
|
||||||
</button>
|
</button>
|
||||||
<button id="deniedButton4k" *ngIf="movieRequest.denied4K" [matTooltip]="movieRequest.deniedReason4K" mat-raised-button class="btn-spacing" color="warn">
|
|
||||||
<i class="fas fa-times"></i> {{'MediaDetails.Denied4K' | translate }}
|
|
||||||
</button>
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<button id="reportIssueBtn" mat-raised-button class="btn-spacing" color="danger" (click)="issue()" *ngIf="issuesEnabled">
|
<button id="reportIssueBtn" mat-raised-button class="btn-spacing" color="danger" (click)="issue()" *ngIf="issuesEnabled">
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
"Common": {
|
"Common": {
|
||||||
"ContinueButton": "Continue",
|
"ContinueButton": "Continue",
|
||||||
"Available": "Available",
|
"Available": "Available",
|
||||||
|
"Available4K": "Available 4K",
|
||||||
"Approved": "Approved",
|
"Approved": "Approved",
|
||||||
"Approve4K": "Approve 4K",
|
"Approve4K": "Approve 4K",
|
||||||
"Pending": "Pending",
|
"Pending": "Pending",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue