Type is defined in person response so can handle more consistent
This commit is contained in:
@@ -22,22 +22,20 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
...mapActions("popup", ["open"]),
|
...mapActions("popup", ["open"]),
|
||||||
openPerson() {
|
openPerson() {
|
||||||
let { id, media_type } = this.person;
|
let { id, type } = this.person;
|
||||||
if (media_type === "tv") media_type = "show";
|
|
||||||
|
|
||||||
if (media_type) {
|
if (type) {
|
||||||
this.open({ id, type: media_type });
|
this.open({ id, type });
|
||||||
} else if (id) {
|
|
||||||
this.open({ id, type: "person" });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
pictureUrl() {
|
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;
|
if (profile_path) return "https://image.tmdb.org/t/p/w185" + profile_path;
|
||||||
else if (poster_path)
|
else if (poster_path)
|
||||||
return "https://image.tmdb.org/t/p/w185" + 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";
|
return "/assets/no-image_small.svg";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user