Skip to content

Commit

Permalink
image proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp committed Jan 5, 2024
1 parent d02fe55 commit ace7a66
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "moviepilot",
"version": "1.5.7-1",
"version": "1.5.7-2",
"private": true,
"bin": "dist/service.js",
"scripts": {
Expand Down
8 changes: 7 additions & 1 deletion src/components/cards/BackdropCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ function goPlay() {
if (props.media?.link)
window.open(props.media?.link, '_blank')
}
// 计算图片地址
const getImgUrl = computed(() => {
const image = props.media?.image || ''
return `${import.meta.env.VITE_API_BASE_URL}system/img/${encodeURIComponent(image)}`
})
</script>

<template>
Expand All @@ -43,7 +49,7 @@ function goPlay() {
>
<template #image>
<VImg
:src="props.media?.image"
:src="getImgUrl"
aspect-ratio="2/3"
cover
@load="imageLoadHandler"
Expand Down
3 changes: 2 additions & 1 deletion src/components/cards/LibraryCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ function imageLoadHandler() {
// 计算图片地址
const getImgUrl = computed(() => {
return props.media?.image || props.media?.image_list?.[0]
const image = props.media?.image || props.media?.image_list?.[0] || ''
return `${import.meta.env.VITE_API_BASE_URL}system/img/${encodeURIComponent(image)}`
})
// 跳转播放
Expand Down
3 changes: 2 additions & 1 deletion src/components/cards/PosterCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function getChipColor(type: string) {
const getImgUrl = computed(() => {
if (imageLoadError.value)
return noImage
return props.media?.image
const image = props.media?.image || ''
return `${import.meta.env.VITE_API_BASE_URL}system/img/${encodeURIComponent(image)}`
})
// 跳转播放
Expand Down

0 comments on commit ace7a66

Please sign in to comment.