支持自定义tmdb图片baseurl

This commit is contained in:
mtvpls
2026-01-17 20:26:09 +08:00
parent be8373de40
commit 837e862d75
5 changed files with 59 additions and 10 deletions

View File

@@ -6,6 +6,7 @@ import { createPortal } from 'react-dom';
import { CheckCircle, AlertCircle, Plus } from 'lucide-react';
import PageLayout from '@/components/PageLayout';
import { getTMDBImageUrl } from '@/lib/tmdb.client';
interface TMDBResult {
id: number;
@@ -116,7 +117,7 @@ export default function MovieRequestPage() {
const submitRequest = async (item: TMDBResult, season?: number) => {
setSubmitting(true);
try {
let poster = item.poster_path ? `https://image.tmdb.org/t/p/w500${item.poster_path}` : undefined;
let poster = item.poster_path ? getTMDBImageUrl(item.poster_path, 'w500') : undefined;
let title = item.title || item.name || '';
if (season && seasons.length > 0) {
@@ -124,7 +125,7 @@ export default function MovieRequestPage() {
if (seasonData) {
title = `${title} ${seasonData.name}`;
if (seasonData.poster_path) {
poster = `https://image.tmdb.org/t/p/w500${seasonData.poster_path}`;
poster = getTMDBImageUrl(seasonData.poster_path, 'w500');
}
}
}
@@ -310,7 +311,7 @@ export default function MovieRequestPage() {
>
{item.poster_path ? (
<img
src={`https://image.tmdb.org/t/p/w500${item.poster_path}`}
src={getTMDBImageUrl(item.poster_path, 'w500')}
alt={item.title || item.name}
className='w-full aspect-[2/3] object-cover'
/>