mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
style: Optimize image URL handling in MediaDetailView
This commit is contained in:
@@ -321,18 +321,17 @@ function getW500Image(url = '') {
|
|||||||
if (!url) return ''
|
if (!url) return ''
|
||||||
url = url.replace('original', 'w500')
|
url = url.replace('original', 'w500')
|
||||||
// 使用图片缓存
|
// 使用图片缓存
|
||||||
if (globalSettings.GLOBAL_IMAGE_CACHE) return `${import.meta.env.VITE_API_BASE_URL}${encodeURIComponent(url)}`
|
if (globalSettings.GLOBAL_IMAGE_CACHE) return `${import.meta.env.VITE_API_BASE_URL}${url}`
|
||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算Poster地址
|
// 计算Poster地址
|
||||||
const getPosterUrl: Ref<string> = computed(() => {
|
const getPosterUrl: Ref<string> = computed(() => {
|
||||||
const url = mediaDetail.value.poster_path ?? ''
|
const url = mediaDetail.value.poster_path ?? ''
|
||||||
// 如果地址中包含douban则使用中转代理
|
|
||||||
if (url.includes('doubanio.com'))
|
|
||||||
return `${import.meta.env.VITE_API_BASE_URL}douban/img?imgurl=${encodeURIComponent(url)}`
|
|
||||||
// 使用图片缓存
|
// 使用图片缓存
|
||||||
if (globalSettings.GLOBAL_IMAGE_CACHE) return `${import.meta.env.VITE_API_BASE_URL}${url}`
|
if (globalSettings.GLOBAL_IMAGE_CACHE) return `${import.meta.env.VITE_API_BASE_URL}${url}`
|
||||||
|
// 如果地址中包含douban则使用中转代理
|
||||||
|
if (url.includes('doubanio.com')) return `${import.meta.env.VITE_API_BASE_URL}douban/img?imgurl=${url}`
|
||||||
return url
|
return url
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -341,9 +340,6 @@ const getBackdropUrl: Ref<string> = computed(() => {
|
|||||||
const url = mediaDetail.value.backdrop_path ?? ''
|
const url = mediaDetail.value.backdrop_path ?? ''
|
||||||
// 使用图片缓存
|
// 使用图片缓存
|
||||||
if (globalSettings.GLOBAL_IMAGE_CACHE) return `${import.meta.env.VITE_API_BASE_URL}${url}`
|
if (globalSettings.GLOBAL_IMAGE_CACHE) return `${import.meta.env.VITE_API_BASE_URL}${url}`
|
||||||
// 如果地址中包含douban则使用中转代理
|
|
||||||
if (url.includes('doubanio.com'))
|
|
||||||
return `${import.meta.env.VITE_API_BASE_URL}douban/img?imgurl=${encodeURIComponent(url)}`
|
|
||||||
return url
|
return url
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user