Added the collections back to the page!

pull/3895/head
tidusjar 6 years ago
parent e6ec08052d
commit 957f7db195

@ -1,8 +1,14 @@
<div class="small-middle-container" *ngIf="collection">
<div class="row justify-content-md-center top-spacing">
<h3 class="row">{{collection.name}}</h3>
<p class="row">{{collection.overview}}</p>
<div class="row top-spacing">
<h3 class="col-12 text-center">{{collection.name}}</h3>
</div>
<div class="row">
<p class="col-12 text-center">{{collection.overview}}</p>
</div>
<div class="row justify-content-md-center">
<button class="col-2" mat-raised-button color="accent" (click)="requestCollection();">Request
Collection</button>
</div>
<div *ngIf="loadingFlag" class="row justify-content-md-center top-spacing loading-spinner">
<mat-spinner [color]="'accent'"></mat-spinner>

@ -1,6 +1,6 @@
import { Component, OnInit } from "@angular/core";
import { ActivatedRoute } from "@angular/router";
import { SearchV2Service } from "../../services";
import { SearchV2Service, RequestService, NotificationService, MessageService } from "../../services";
import { IMovieCollectionsViewModel } from "../../interfaces/ISearchTvResultV2";
import { IDiscoverCardResult } from "../interfaces";
import { RequestType } from "../../interfaces";
@ -17,7 +17,10 @@ export class DiscoverCollectionsComponent implements OnInit {
public discoverResults: IDiscoverCardResult[] = [];
constructor(private searchService: SearchV2Service, private route: ActivatedRoute) {
constructor(private searchService: SearchV2Service,
private route: ActivatedRoute,
private requestService: RequestService,
private messageService: MessageService) {
this.route.params.subscribe((params: any) => {
this.collectionId = params.collectionId;
});
@ -29,6 +32,13 @@ export class DiscoverCollectionsComponent implements OnInit {
this.createModel();
}
public async requestCollection() {
await this.collection.collection.forEach(async (movie) => {
await this.requestService.requestMovie({theMovieDbId: movie.id, languageCode: null}).toPromise();
});
this.messageService.send("Requested Collection");
}
private createModel() {
this.finishLoading();
this.collection.collection.forEach(m => {

Loading…
Cancel
Save