feat: thêm cái proxy hình ảnh dùng webp

This commit is contained in:
ngthanhvu
2026-07-30 22:32:44 -04:00
parent 2ab5766e02
commit 63ef322ccf
9 changed files with 727 additions and 22 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
import { movies } from '../database/schema'
import { desc, like, and, eq, sql } from 'drizzle-orm'
import { proxyImageUrl } from '../utils/proxy-image'
export default defineEventHandler(async (event) => {
const db = useDb()
@@ -67,8 +68,8 @@ function mapMovieToResponse(movie: any) {
slug: movie.slug,
name: movie.name,
originName: movie.originName || '',
thumb: movie.customThumb || movie.thumb || '',
poster: movie.customPoster || movie.poster || '',
thumb: movie.customThumb ? proxyImageUrl(movie.customThumb) : proxyImageUrl(movie.thumb || ''),
poster: movie.customPoster ? proxyImageUrl(movie.customPoster) : proxyImageUrl(movie.poster || ''),
year: movie.year || undefined,
time: movie.time || undefined,
episode: movie.episode || undefined,