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,6 +1,7 @@
import { movies } from '../../database/schema'
import { eq, and } from 'drizzle-orm'
import type { MovieDetail, NormalizedServer } from '../../utils/movies'
import { proxyImageUrl } from '../../utils/proxy-image'
function mapCustomServers(movie: any): NormalizedServer[] {
let raw = movie.customServers ?? movie.custom_servers
@@ -30,8 +31,8 @@ function mapMovieToDetail(movie: any): MovieDetail {
name: movie.name,
originName: movie.originName || '',
slug: movie.slug,
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,