fix: add missing cache for some tmdb images (#1656)

This PR replaces some Images with CachedImage for missing TMDB-related images.
This commit is contained in:
Gauthier
2025-05-12 21:28:12 +02:00
committed by GitHub
parent e69649d71d
commit 8949edea7e
3 changed files with 15 additions and 9 deletions

View File

@@ -1,3 +1,4 @@
import CachedImage from '@app/components/Common/CachedImage';
import Header from '@app/components/Common/Header'; import Header from '@app/components/Common/Header';
import ListView from '@app/components/Common/ListView'; import ListView from '@app/components/Common/ListView';
import PageTitle from '@app/components/Common/PageTitle'; import PageTitle from '@app/components/Common/PageTitle';
@@ -7,7 +8,6 @@ import Error from '@app/pages/_error';
import defineMessages from '@app/utils/defineMessages'; import defineMessages from '@app/utils/defineMessages';
import type { TvNetwork } from '@server/models/common'; import type { TvNetwork } from '@server/models/common';
import type { TvResult } from '@server/models/Search'; import type { TvResult } from '@server/models/Search';
import Image from 'next/image';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import { useIntl } from 'react-intl'; import { useIntl } from 'react-intl';
@@ -49,7 +49,8 @@ const DiscoverTvNetwork = () => {
<Header> <Header>
{firstResultData?.network.logoPath ? ( {firstResultData?.network.logoPath ? (
<div className="relative mb-6 flex h-24 justify-center sm:h-32"> <div className="relative mb-6 flex h-24 justify-center sm:h-32">
<Image <CachedImage
type="tmdb"
src={`https://image.tmdb.org/t/p/w780_filter(duotone,ffffff,bababa)${firstResultData.network.logoPath}`} src={`https://image.tmdb.org/t/p/w780_filter(duotone,ffffff,bababa)${firstResultData.network.logoPath}`}
alt={firstResultData.network.name} alt={firstResultData.network.name}
className="object-contain" className="object-contain"

View File

@@ -1,3 +1,4 @@
import CachedImage from '@app/components/Common/CachedImage';
import Header from '@app/components/Common/Header'; import Header from '@app/components/Common/Header';
import ListView from '@app/components/Common/ListView'; import ListView from '@app/components/Common/ListView';
import PageTitle from '@app/components/Common/PageTitle'; import PageTitle from '@app/components/Common/PageTitle';
@@ -7,7 +8,6 @@ import Error from '@app/pages/_error';
import defineMessages from '@app/utils/defineMessages'; import defineMessages from '@app/utils/defineMessages';
import type { ProductionCompany } from '@server/models/common'; import type { ProductionCompany } from '@server/models/common';
import type { MovieResult } from '@server/models/Search'; import type { MovieResult } from '@server/models/Search';
import Image from 'next/image';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import { useIntl } from 'react-intl'; import { useIntl } from 'react-intl';
@@ -49,7 +49,8 @@ const DiscoverMovieStudio = () => {
<Header> <Header>
{firstResultData?.studio.logoPath ? ( {firstResultData?.studio.logoPath ? (
<div className="relative mb-6 flex h-24 justify-center sm:h-32"> <div className="relative mb-6 flex h-24 justify-center sm:h-32">
<Image <CachedImage
type="tmdb"
src={`https://image.tmdb.org/t/p/w780_filter(duotone,ffffff,bababa)${firstResultData.studio.logoPath}`} src={`https://image.tmdb.org/t/p/w780_filter(duotone,ffffff,bababa)${firstResultData.studio.logoPath}`}
alt={firstResultData.studio.name} alt={firstResultData.studio.name}
className="object-contain" className="object-contain"

View File

@@ -1,7 +1,7 @@
import CachedImage from '@app/components/Common/CachedImage';
import TitleCard from '@app/components/TitleCard'; import TitleCard from '@app/components/TitleCard';
import defineMessages from '@app/utils/defineMessages'; import defineMessages from '@app/utils/defineMessages';
import { ArrowRightCircleIcon } from '@heroicons/react/24/solid'; import { ArrowRightCircleIcon } from '@heroicons/react/24/solid';
import Image from 'next/image';
import Link from 'next/link'; import Link from 'next/link';
import { useState } from 'react'; import { useState } from 'react';
import { useInView } from 'react-intersection-observer'; import { useInView } from 'react-intersection-observer';
@@ -60,7 +60,8 @@ const ShowMoreCard = ({ url, posters }: ShowMoreCardProps) => {
<div className="relative z-10 grid h-full w-full grid-cols-2 items-center justify-center gap-2 opacity-30"> <div className="relative z-10 grid h-full w-full grid-cols-2 items-center justify-center gap-2 opacity-30">
{posters[0] && ( {posters[0] && (
<div className=""> <div className="">
<Image <CachedImage
type="tmdb"
src={`https://image.tmdb.org/t/p/w300_and_h450_face${posters[0]}`} src={`https://image.tmdb.org/t/p/w300_and_h450_face${posters[0]}`}
alt="" alt=""
className="rounded-md" className="rounded-md"
@@ -71,7 +72,8 @@ const ShowMoreCard = ({ url, posters }: ShowMoreCardProps) => {
)} )}
{posters[1] && ( {posters[1] && (
<div className=""> <div className="">
<Image <CachedImage
type="tmdb"
src={`https://image.tmdb.org/t/p/w300_and_h450_face${posters[1]}`} src={`https://image.tmdb.org/t/p/w300_and_h450_face${posters[1]}`}
alt="" alt=""
className="rounded-md" className="rounded-md"
@@ -82,7 +84,8 @@ const ShowMoreCard = ({ url, posters }: ShowMoreCardProps) => {
)} )}
{posters[2] && ( {posters[2] && (
<div className=""> <div className="">
<Image <CachedImage
type="tmdb"
src={`https://image.tmdb.org/t/p/w300_and_h450_face${posters[2]}`} src={`https://image.tmdb.org/t/p/w300_and_h450_face${posters[2]}`}
alt="" alt=""
className="rounded-md" className="rounded-md"
@@ -93,7 +96,8 @@ const ShowMoreCard = ({ url, posters }: ShowMoreCardProps) => {
)} )}
{posters[3] && ( {posters[3] && (
<div className=""> <div className="">
<Image <CachedImage
type="tmdb"
src={`https://image.tmdb.org/t/p/w300_and_h450_face${posters[3]}`} src={`https://image.tmdb.org/t/p/w300_and_h450_face${posters[3]}`}
alt="" alt=""
className="rounded-md" className="rounded-md"