From 37074d60f173503436774a18be45746c3996ef82 Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Mon, 14 Dec 2020 20:34:17 +0100 Subject: [PATCH] Fix issue with missing poster --- index.html | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 250269b..afcdd98 100644 --- a/index.html +++ b/index.html @@ -41,6 +41,14 @@ cursor: pointer; } + .poster { + height: 392px; + width: 276px; + display: inline-block; + background-color: gray; + margin: 1em; + } + .no-bullet { list-style-type: none; } @@ -77,7 +85,7 @@
@@ -257,11 +265,15 @@ var app = new Vue({ } this.searchItems = response.items.map((item) => { + var poster = null; + if (item['poster']) { + poster = item['poster'].replace('{profile}', 's276'); + } return { id: item.id, title: item.title, type: item.object_type, - poster_url: `https://images.justwatch.com${item['poster'].replace('{profile}', 's276')}` + poster_url: `https://images.justwatch.com${poster}` }; }); this.step += 1;