mirror of https://github.com/Ombi-app/Ombi
Added actor searching for movies. You can also click on the actors image in the details page to get a list of movies that actor has been in
parent
b12282067a
commit
fe23a01081
@ -0,0 +1,11 @@
|
||||
<div class="small-middle-container" *ngIf="actorCredits">
|
||||
|
||||
<div *ngIf="loadingFlag" class="row justify-content-md-center top-spacing loading-spinner">
|
||||
<mat-spinner [color]="'accent'"></mat-spinner>
|
||||
</div>
|
||||
<div *ngIf="discoverResults" class="row full-height">
|
||||
<div class="col-xl-2 col-lg-3 col-md-3 col-6 col-sm-4 small-padding" *ngFor="let result of discoverResults">
|
||||
<discover-card [result]="result"></discover-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,19 @@
|
||||
.full-height {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
.small-middle-container{
|
||||
margin: auto;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.small-padding {
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
|
||||
.loading-spinner {
|
||||
margin: 10%;
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
import { Component } from "@angular/core";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
import { SearchV2Service, RequestService, MessageService } from "../../services";
|
||||
import { IActorCredits } from "../../interfaces/ISearchTvResultV2";
|
||||
import { IDiscoverCardResult } from "../interfaces";
|
||||
import { RequestType } from "../../interfaces";
|
||||
|
||||
@Component({
|
||||
templateUrl: "./discover-actor.component.html",
|
||||
styleUrls: ["./discover-actor.component.scss"],
|
||||
})
|
||||
export class DiscoverActorComponent {
|
||||
public actorId: number;
|
||||
public actorCredits: IActorCredits;
|
||||
public loadingFlag: boolean;
|
||||
|
||||
public discoverResults: IDiscoverCardResult[] = [];
|
||||
|
||||
constructor(private searchService: SearchV2Service,
|
||||
private route: ActivatedRoute,
|
||||
private requestService: RequestService,
|
||||
private messageService: MessageService) {
|
||||
this.route.params.subscribe((params: any) => {
|
||||
this.actorId = params.actorId;
|
||||
this.loading();
|
||||
this.searchService.getMoviesByActor(this.actorId).subscribe(res => {
|
||||
this.actorCredits = res;
|
||||
this.createModel();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private createModel() {
|
||||
this.finishLoading();
|
||||
this.discoverResults = [];
|
||||
this.actorCredits.cast.forEach(m => {
|
||||
this.discoverResults.push({
|
||||
available: false, // TODO
|
||||
posterPath: `https://image.tmdb.org/t/p/w300/${m.poster_path}`,
|
||||
requested: false, // TODO
|
||||
title: m.title,
|
||||
type: RequestType.movie,
|
||||
id: m.id,
|
||||
url: null, // TODO
|
||||
rating: 0,
|
||||
overview: m.overview,
|
||||
approved: false // TODO
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private loading() {
|
||||
this.loadingFlag = true;
|
||||
}
|
||||
|
||||
private finishLoading() {
|
||||
this.loadingFlag = false;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue