Fixed the broken images on the cards

pull/3895/head
Jamie Rees 6 years ago
parent fe23a01081
commit 09bf919d4d

@ -231,7 +231,7 @@ namespace Ombi.Core.Engine.V2
{
var result = await Cache.GetOrAdd(nameof(GetMoviesByActor) + actorId + langCode,
async () => await MovieApi.GetActorMovieCredits(actorId, langCode));
//TODO need to run through the rules so we can get the availability etc
// Later we run this through the rules engine
return result;
}

@ -1,6 +1,6 @@
import { Component } from "@angular/core";
import { Component, AfterViewInit } from "@angular/core";
import { ActivatedRoute } from "@angular/router";
import { SearchV2Service, RequestService, MessageService } from "../../services";
import { SearchV2Service } from "../../services";
import { IActorCredits } from "../../interfaces/ISearchTvResultV2";
import { IDiscoverCardResult } from "../interfaces";
import { RequestType } from "../../interfaces";
@ -9,7 +9,7 @@ import { RequestType } from "../../interfaces";
templateUrl: "./discover-actor.component.html",
styleUrls: ["./discover-actor.component.scss"],
})
export class DiscoverActorComponent {
export class DiscoverActorComponent implements AfterViewInit {
public actorId: number;
public actorCredits: IActorCredits;
public loadingFlag: boolean;
@ -17,9 +17,7 @@ export class DiscoverActorComponent {
public discoverResults: IDiscoverCardResult[] = [];
constructor(private searchService: SearchV2Service,
private route: ActivatedRoute,
private requestService: RequestService,
private messageService: MessageService) {
private route: ActivatedRoute) {
this.route.params.subscribe((params: any) => {
this.actorId = params.actorId;
this.loading();
@ -30,21 +28,33 @@ export class DiscoverActorComponent {
});
}
public async ngAfterViewInit() {
this.discoverResults.forEach((result) => {
this.searchService.getFullMovieDetails(result.id).subscribe(x => {
result.available = x.available;
result.approved = x.approved;
result.rating = x.voteAverage;
result.requested = x.requested;
result.url = x.homepage;
});
});
}
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
available: false,
posterPath: m.poster_path ? `https://image.tmdb.org/t/p/w300/${m.poster_path}` : "../../../images/default_movie_poster.png",
requested: false,
title: m.title,
type: RequestType.movie,
id: m.id,
url: null, // TODO
url: null,
rating: 0,
overview: m.overview,
approved: false // TODO
approved: false
});
});
}

@ -130,7 +130,7 @@ export class DiscoverComponent implements OnInit {
this.movies.forEach(m => {
tempResults.push({
available: m.available,
posterPath: `https://image.tmdb.org/t/p/w300/${m.posterPath}`,
posterPath: m.posterPath ? `https://image.tmdb.org/t/p/w300/${m.posterPath}` : "../../../images/default_movie_poster.png",
requested: m.requested,
title: m.title,
type: RequestType.movie,

@ -2,7 +2,6 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using Microsoft.AspNetCore.SignalR;
using Microsoft.EntityFrameworkCore;
using Ombi.Attributes;
using Ombi.Core.Authentication;

Loading…
Cancel
Save