diff --git a/src/components/CastPerson.vue b/src/components/CastPerson.vue index 73e6b08..67ccb29 100644 --- a/src/components/CastPerson.vue +++ b/src/components/CastPerson.vue @@ -2,8 +2,8 @@
  • -

    {{ person.name }}

    -

    {{ person.character }}

    +

    {{ person.name || person.title }}

    +

    {{ person.character || person.year }}

  • @@ -22,14 +22,22 @@ export default { methods: { ...mapActions("popup", ["open"]), openPerson() { - const { id } = this.person; - if (id) this.open({ id, type: "person" }); + let { id, media_type } = this.person; + if (media_type === "tv") media_type = "show"; + + if (media_type) { + this.open({ id, type: media_type }); + } else if (id) { + this.open({ id, type: "person" }); + } } }, computed: { pictureUrl() { - const { profile_path } = this.person; + const { profile_path, poster_path } = 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; return "/assets/no-image_small.svg"; }