From 06a48e738d6cecd6876eb499c07921b4c4e5c778 Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Sun, 6 Mar 2022 12:00:36 +0100 Subject: [PATCH] Type is defined in person response so can handle more consistent --- src/components/CastPerson.vue | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/CastPerson.vue b/src/components/CastPerson.vue index ad88db1..be5de18 100644 --- a/src/components/CastPerson.vue +++ b/src/components/CastPerson.vue @@ -22,22 +22,20 @@ export default { methods: { ...mapActions("popup", ["open"]), openPerson() { - let { id, media_type } = this.person; - if (media_type === "tv") media_type = "show"; + let { id, type } = this.person; - if (media_type) { - this.open({ id, type: media_type }); - } else if (id) { - this.open({ id, type: "person" }); + if (type) { + this.open({ id, type }); } } }, computed: { pictureUrl() { - const { profile_path, poster_path } = this.person; + const { profile_path, poster_path, poster } = this.person; if (profile_path) return "https://image.tmdb.org/t/p/w185" + profile_path; else if (poster_path) return "https://image.tmdb.org/t/p/w185" + poster_path; + else if (poster) return "https://image.tmdb.org/t/p/w185" + poster; return "/assets/no-image_small.svg"; }