This commit is contained in:
Jamie Rees 2019-03-29 14:08:53 +00:00
commit 403e79d5d3
4 changed files with 21 additions and 7 deletions

View file

@ -1,9 +1,8 @@
<div class="small-middle-container"> <div class="small-middle-container" *ngIf="collection">
<div class="row justify-content-md-center top-spacing"> <div class="row justify-content-md-center top-spacing">
<h2>{{collection.title}}</h2> <h3 class="row">{{collection.name}}</h3>
<p>{{collection.overview}}</p> <p class="row">{{collection.overview}}</p>
</div> </div>
<div *ngIf="loadingFlag" class="row justify-content-md-center top-spacing loading-spinner"> <div *ngIf="loadingFlag" class="row justify-content-md-center top-spacing loading-spinner">
<mat-spinner [color]="'accent'"></mat-spinner> <mat-spinner [color]="'accent'"></mat-spinner>

View file

@ -24,8 +24,9 @@ export class DiscoverCollectionsComponent implements OnInit {
} }
public async ngOnInit() { public async ngOnInit() {
this.collection = await this.searchService.getMovieCollections(this.collectionId); this.loadingFlag = true;
this.createModel(); this.collection = await this.searchService.getMovieCollections(this.collectionId);
this.createModel();
} }
private createModel() { private createModel() {
@ -39,7 +40,7 @@ export class DiscoverCollectionsComponent implements OnInit {
type: RequestType.movie, type: RequestType.movie,
id: m.id, id: m.id,
url: `http://www.imdb.com/title/${m.imdbId}/`, url: `http://www.imdb.com/title/${m.imdbId}/`,
rating: null, rating: 0,
overview: m.overview, overview: m.overview,
approved: m.approved approved: m.approved
}); });

View file

@ -43,6 +43,9 @@
<button (click)="approve()" mat-raised-button class="btn-spacing" color="accent"> <button (click)="approve()" mat-raised-button class="btn-spacing" color="accent">
<i class="fa fa-plus"></i> {{ 'Common.Approve' | translate }} <i class="fa fa-plus"></i> {{ 'Common.Approve' | translate }}
</button> </button>
<button *ngIf="!movie.available" (click)="markAvailable()" mat-raised-button class="btn-spacing" color="accent">
<i class="fa fa-plus"></i> {{ 'Requests.MarkAvailable' | translate }}
</button>
<button *ngIf="hasRequest && !movieRequest.denied" mat-raised-button class="btn-spacing" color="warn" (click)="deny()"> <button *ngIf="hasRequest && !movieRequest.denied" mat-raised-button class="btn-spacing" color="warn" (click)="deny()">
<i class="fa fa-times"></i> {{ <i class="fa fa-times"></i> {{

View file

@ -109,6 +109,16 @@ export class MovieDetailsComponent {
} }
} }
public async markAvailable() {
const result = await this.requestService.markMovieAvailable({id: this.movieRequest.id}).toPromise();
if (result.result) {
this.movie.available = true;
this.messageService.send(result.message, "Ok");
} else {
this.messageService.send(result.errorMessage, "Ok");
}
}
private setQualityOverrides(): void { private setQualityOverrides(): void {
if (this.radarrProfiles) { if (this.radarrProfiles) {
const profile = this.radarrProfiles.filter((p) => { const profile = this.radarrProfiles.filter((p) => {
@ -119,6 +129,7 @@ export class MovieDetailsComponent {
} }
} }
} }
private setRootFolderOverrides(): void { private setRootFolderOverrides(): void {
if (this.radarrRootFolders) { if (this.radarrRootFolders) {
const path = this.radarrRootFolders.filter((folder) => { const path = this.radarrRootFolders.filter((folder) => {