From 034d326730f2f9acebc2e18e80092298bfdef77a Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Fri, 1 May 2020 03:08:42 +0200 Subject: [PATCH] Cleaning up --- src/app/show-grid/show-grid.component.html | 2 +- src/app/show-grid/show-grid.component.ts | 5 +++-- src/models/episode.ts | 4 +++- src/models/external-id.ts | 6 ++++++ src/models/people.ts | 4 +++- src/models/season.ts | 2 ++ src/models/show.ts | 7 +++++-- 7 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 src/models/external-id.ts diff --git a/src/app/show-grid/show-grid.component.html b/src/app/show-grid/show-grid.component.html index 785cd911..2ab1d2fc 100644 --- a/src/app/show-grid/show-grid.component.html +++ b/src/app/show-grid/show-grid.component.html @@ -3,7 +3,7 @@
-
+

{{show.title}}

diff --git a/src/app/show-grid/show-grid.component.ts b/src/app/show-grid/show-grid.component.ts index 9be404c2..3206cf93 100644 --- a/src/app/show-grid/show-grid.component.ts +++ b/src/app/show-grid/show-grid.component.ts @@ -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})`); } } diff --git a/src/models/episode.ts b/src/models/episode.ts index 1f835cd7..80fddab8 100644 --- a/src/models/episode.ts +++ b/src/models/episode.ts @@ -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[]; } diff --git a/src/models/external-id.ts b/src/models/external-id.ts new file mode 100644 index 00000000..b0cd1a3b --- /dev/null +++ b/src/models/external-id.ts @@ -0,0 +1,6 @@ +export interface ExternalID +{ + provider: {name: string, logo: string}; + id: string; + link: string; +} \ No newline at end of file diff --git a/src/models/people.ts b/src/models/people.ts index 9fbc828a..fc2bd7b9 100644 --- a/src/models/people.ts +++ b/src/models/people.ts @@ -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[]; } diff --git a/src/models/season.ts b/src/models/season.ts index 17939d3c..c84ee74f 100644 --- a/src/models/season.ts +++ b/src/models/season.ts @@ -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[] } diff --git a/src/models/show.ts b/src/models/show.ts index f20ab2d5..093c5854 100644 --- a/src/models/show.ts +++ b/src/models/show.ts @@ -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[]; }