Cleaning up

This commit is contained in:
Zoe Roux 2020-05-01 03:08:42 +02:00
parent 1f070d9d14
commit 034d326730
7 changed files with 23 additions and 7 deletions

View File

@ -3,7 +3,7 @@
<mat-card class="show">
<a href="/show/{{show.slug}}" routerLink="show/{{show.slug}}" class="d-flex">
<div class="thumb">
<div [style.background-image]="getThumb(show.slug)"> </div>
<div [style.background-image]="getThumb(show)"> </div>
</div>
<div class="data">
<p class="title">{{show.title}}</p>

View File

@ -10,11 +10,12 @@ import {DomSanitizer} from "@angular/platform-browser";
export class ShowGridComponent
{
@Input() shows: Show[]
@Input() externalShows: boolean = false;
constructor(private sanitizer: DomSanitizer) { }
getThumb(slug: string)
getThumb(show: Show)
{
return this.sanitizer.bypassSecurityTrustStyle("url(/poster/" + slug + ")");
return this.sanitizer.bypassSecurityTrustStyle(`url(${show.poster})`);
}
}

View File

@ -1,3 +1,5 @@
import {ExternalID} from "./external-id";
export interface Episode
{
seasonNumber: number;
@ -8,6 +10,6 @@ export interface Episode
overview: string;
releaseDate;
runtime: number;
externalIDs: string;
showTitle: string;
externalIDs: ExternalID[];
}

View File

@ -0,0 +1,6 @@
export interface ExternalID
{
provider: {name: string, logo: string};
id: string;
link: string;
}

View File

@ -1,3 +1,5 @@
import {ExternalID} from "./external-id";
export interface People
{
slug: string;
@ -5,5 +7,5 @@ export interface People
role: string;
type: string;
externalIDs: string;
externalIDs: ExternalID[];
}

View File

@ -1,4 +1,5 @@
import { Episode } from "./episode";
import {ExternalID} from "./external-id";
export interface Season
{
@ -6,4 +7,5 @@ export interface Season
title: string;
overview: string;
episodes: Episode[];
externalIDs: ExternalID[]
}

View File

@ -2,6 +2,7 @@ import { Season } from "./season";
import { Genre } from "./genre";
import { People } from "./people";
import { Studio } from "./studio";
import {ExternalID} from "./external-id";
export interface Show
{
@ -17,9 +18,11 @@ export interface Show
trailerUrl: string;
isCollection: boolean;
isMovie: boolean;
startYear: number;
endYear : number;
poster: string;
logo: string;
backdrop: string;
externalIDs: [string, string][];
externalIDs: ExternalID[];
}