mirror of
https://github.com/ngthanhvu/kr-phim.git
synced 2026-08-10 14:27:47 +00:00
feat: thêm cái proxy hình ảnh dùng webp
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user