支持自定义tmdb图片baseurl
This commit is contained in:
@@ -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'
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user