mirror of https://github.com/Ombi-app/Ombi
parent
a65bd3f948
commit
f3e781d576
@ -1,18 +1,31 @@
|
|||||||
import { Component, Inject } from "@angular/core";
|
import { Component, Inject, OnInit } from "@angular/core";
|
||||||
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material";
|
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material";
|
||||||
import { IDiscoverCardResult } from "../interfaces";
|
import { IDiscoverCardResult } from "../interfaces";
|
||||||
|
import { SearchV2Service } from "../../services";
|
||||||
|
import { dataURLToBlob } from "blob-util";
|
||||||
|
import { RequestType } from "../../interfaces";
|
||||||
|
import { ISearchMovieResultV2 } from "../../interfaces/ISearchMovieResultV2";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "discover-card-details",
|
selector: "discover-card-details",
|
||||||
templateUrl: "./discover-card-details.component.html",
|
templateUrl: "./discover-card-details.component.html",
|
||||||
styleUrls: ["./discover-card-details.component.scss"],
|
styleUrls: ["./discover-card-details.component.scss"],
|
||||||
})
|
})
|
||||||
export class DiscoverCardDetailsComponent {
|
export class DiscoverCardDetailsComponent implements OnInit {
|
||||||
|
|
||||||
|
public result: ISearchMovieResultV2;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public dialogRef: MatDialogRef<DiscoverCardDetailsComponent>,
|
public dialogRef: MatDialogRef<DiscoverCardDetailsComponent>,
|
||||||
@Inject(MAT_DIALOG_DATA) public data: IDiscoverCardResult) { }
|
@Inject(MAT_DIALOG_DATA) public data: IDiscoverCardResult, private searchService: SearchV2Service) { }
|
||||||
|
|
||||||
onNoClick(): void {
|
public async ngOnInit() {
|
||||||
|
if (this.data.type === RequestType.movie) {
|
||||||
|
this.result = await this.searchService.getFullMovieDetailsPromise(this.data.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public onNoClick(): void {
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue