More fixes around music

pull/3856/head
Jamie Rees 4 years ago
parent 9438bbf81d
commit a991b2fff2

@ -1,8 +1,11 @@
<mat-nav-list>
<a (click)="delete()" mat-list-item>
<span mat-line>Delete Request</span>
<span mat-line>{{'Requests.RequestPanel.Delete' | translate}}</span>
</a>
<a *ngIf="data.canApprove" (click)="approve()" mat-list-item>
<span mat-line>Approve Request</span>
<span mat-line>{{'Requests.RequestPanel.Approve' | translate}}</span>
</a>
<a *ngIf="data.type !== RequestType.tvShow" (click)="changeAvailability()" mat-list-item>
<span mat-line>{{'Requests.RequestPanel.ChangeAvailability' | translate}}</span>
</a>
</mat-nav-list>

@ -9,6 +9,9 @@ import { UpdateType } from '../../models/UpdateType';
templateUrl: './request-options.component.html',
})
export class RequestOptionsComponent {
public RequestType = RequestType;
constructor(@Inject(MAT_BOTTOM_SHEET_DATA) public data: any,
private requestService: RequestService, private bottomSheetRef: MatBottomSheetRef<RequestOptionsComponent>) { }
@ -41,4 +44,16 @@ export class RequestOptionsComponent {
this.bottomSheetRef.dismiss({type: UpdateType.Approve});
return;
}
public async changeAvailability() {
if (this.data.type === RequestType.movie) {
await this.requestService.markMovieAvailable({id: this.data.id}).toPromise();
}
if (this.data.type === RequestType.album) {
await this.requestService.markAlbumAvailable({id: this.data.id}).toPromise();
}
this.bottomSheetRef.dismiss({type: UpdateType.Availability});
return;
}
}

@ -29,6 +29,12 @@ export class RequestsListComponent {
event.onChange();
return;
}
if (result.type == UpdateType.Availability) {
// Need to do this here, as the status is calculated on the server
event.request.requestStatus = 'Common.Available';
event.onChange();
return;
}
});
}
}

@ -1,4 +1,5 @@
export enum UpdateType {
Delete,
Approve
Delete,
Approve,
Availability
}

@ -139,7 +139,7 @@ namespace Ombi.Controllers.V2
return await _tvRequestEngine.UpdateAdvancedOptions(options);
}
[HttpGet("albums/available/{count:int}/{position:int}/{sort}/{sortOrder}")]
[HttpGet("album/available/{count:int}/{position:int}/{sort}/{sortOrder}")]
public async Task<RequestsViewModel<AlbumRequest>> GetAvailableAlbumRequests(int count, int position, string sort, string sortOrder)
{
return await _musicRequestEngine.GetRequestsByStatus(count, position, sort, sortOrder, RequestStatus.Available);

@ -175,7 +175,12 @@
"RequestsToDisplay": "Requests to display",
"RequestsTitle": "Title",
"Details": "Details",
"Options": "Options"
"Options": "Options",
"RequestPanel": {
"Delete":"Delete Request",
"Approve":"Approve Request",
"ChangeAvailability":"Mark Available"
}
},
"Issues": {
"Title": "Issues",

Loading…
Cancel
Save