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

View File

@ -10,11 +10,12 @@ import {DomSanitizer} from "@angular/platform-browser";
export class ShowGridComponent export class ShowGridComponent
{ {
@Input() shows: Show[] @Input() shows: Show[]
@Input() externalShows: boolean = false;
constructor(private sanitizer: DomSanitizer) { } 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 export interface Episode
{ {
seasonNumber: number; seasonNumber: number;
@ -8,6 +10,6 @@ export interface Episode
overview: string; overview: string;
releaseDate; releaseDate;
runtime: number; runtime: number;
externalIDs: string;
showTitle: 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 export interface People
{ {
slug: string; slug: string;
@ -5,5 +7,5 @@ export interface People
role: string; role: string;
type: string; type: string;
externalIDs: string; externalIDs: ExternalID[];
} }

View File

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

View File

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