mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-30 11:38:32 -07:00
feat: Added 4k to the requests list and bulk approve
This commit is contained in:
parent
fd58570077
commit
9b1a1062ac
4 changed files with 28 additions and 3 deletions
|
@ -21,6 +21,7 @@ export interface IMovieRequests extends IFullBaseRequest {
|
|||
available4K: boolean;
|
||||
denied4K: boolean;
|
||||
deniedReason4K: string;
|
||||
requestedDate4k: Date;
|
||||
|
||||
// For the UI
|
||||
rootPathOverrideTitle: string;
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
<ng-container matColumnDef="requestedDate">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> {{ 'Requests.RequestDate' | translate}} </th>
|
||||
<td mat-cell id="requestedDate{{element.id}}" *matCellDef="let element"> {{element.requestedDate | amLocal | amUserLocale | amDateFormat: 'LL'}} </td>
|
||||
<td mat-cell id="requestedDate{{element.id}}" *matCellDef="let element"> {{getRequestDate(element) | amLocal | amUserLocale | amDateFormat: 'LL'}} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="status">
|
||||
|
@ -66,6 +66,14 @@
|
|||
<td mat-cell id="status{{element.id}}" *matCellDef="let element"> {{element.status |translateStatus }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="has4kRequest">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> {{ 'Requests.Has4KRequest' | translate}} </th>
|
||||
<td mat-cell id="has4kRequest{{element.id}}" *matCellDef="let element">
|
||||
<i *ngIf="element.has4KRequest" class="fas fa-check"></i>
|
||||
<i *ngIf="!element.has4KRequest" class="fas fa-times"></i>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
|
||||
<ng-container matColumnDef="requestStatus">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> {{ 'Requests.RequestStatus' | translate}} </th>
|
||||
|
@ -92,4 +100,5 @@
|
|||
<mat-menu #aboveMenu="matMenu" yPosition="above">
|
||||
<button id="deleteFabButton" mat-menu-item (click)="bulkDelete()">{{'Requests.RequestPanel.Delete' | translate}}</button>
|
||||
<button id="approveFabButton" mat-menu-item (click)="bulkApprove()">{{'Requests.RequestPanel.Approve' | translate}}</button>
|
||||
<button id="approve4kFabButton" mat-menu-item (click)="bulkApprove4K()">{{'Requests.RequestPanel.Approve4K' | translate}}</button>
|
||||
</mat-menu>
|
|
@ -59,6 +59,9 @@ export class MoviesGridComponent implements OnInit, AfterViewInit {
|
|||
this.manageOwnRequests = this.auth.hasRole("ManageOwnRequests")
|
||||
if (this.isAdmin) {
|
||||
this.displayedColumns.unshift('select');
|
||||
this.displayedColumns.splice(4,0,'has4kRequest');
|
||||
} else if (this.auth.hasRole("Request4KMovie")) {
|
||||
this.displayedColumns.splice(4,0,'has4kRequest');
|
||||
}
|
||||
const defaultCount = this.storageService.get(this.storageKeyGridCount);
|
||||
const defaultSort = this.storageService.get(this.storageKey);
|
||||
|
@ -176,13 +179,17 @@ export class MoviesGridComponent implements OnInit, AfterViewInit {
|
|||
});
|
||||
}
|
||||
|
||||
public bulkApprove() {
|
||||
public bulkApprove = () => this.bulkApproveInternal(false);
|
||||
|
||||
public bulkApprove4K = () => this.bulkApproveInternal(true);
|
||||
|
||||
private bulkApproveInternal(is4k: boolean) {
|
||||
if (this.selection.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
let tasks = new Array<Observable<IRequestEngineResult>>();
|
||||
this.selection.selected.forEach((selected) => {
|
||||
tasks.push(this.requestServiceV1.approveMovie({ id: selected.id, is4K: false }));
|
||||
tasks.push(this.requestServiceV1.approveMovie({ id: selected.id, is4K: is4k }));
|
||||
});
|
||||
|
||||
this.isLoadingResults = true;
|
||||
|
@ -199,4 +206,11 @@ export class MoviesGridComponent implements OnInit, AfterViewInit {
|
|||
this.ngAfterViewInit();
|
||||
})
|
||||
}
|
||||
|
||||
public getRequestDate(request: IMovieRequests) : Date {
|
||||
if (new Date(request.requestedDate).getFullYear() === 1) {
|
||||
return request.requestedDate4k;
|
||||
}
|
||||
return request.requestedDate;
|
||||
}
|
||||
}
|
|
@ -171,6 +171,7 @@
|
|||
"Remove": "Remove",
|
||||
"Deny": "Deny",
|
||||
"Deny4K": "Deny 4K",
|
||||
"Has4KRequest": "Has 4K Request",
|
||||
"DenyReason": "Deny Reason",
|
||||
"DeniedReason": "Denied Reason",
|
||||
"Season": "Season",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue