Skip to content

Commit e5f644a

Browse files
committed
chore: set anime images to unoptimized
1 parent b9a030f commit e5f644a

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/app/about/anime/page.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { getConfig } from '@/services/config'
77
import Head from 'next/head'
88
import { notFound } from 'next/navigation'
99

10+
export const revalidate = 3600
11+
1012
export async function generateMetadata(): Promise<Metadata> {
1113
const config = getConfig()
1214
const animeTranslation = config.translation.anime
@@ -46,8 +48,7 @@ export default async function AnimePage() {
4648
: 'http://localhost:3000'
4749

4850
const response = await fetch(`${API_BASE_URL}/api/anime?userName=${anilist_username}`, {
49-
cache: 'force-cache',
50-
next: { tags: ['anime'], revalidate: 120 }, // Cache for 2 minutes
51+
next: { tags: ['anime'], revalidate: 3600 }, // Cache for 1 hour
5152
})
5253

5354
if (!response.ok) {

src/components/anime/AnimeList.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const AnimeList = ({ animeData, userName, author, lang, translation }: AnimeList
5656
|| (b.progress ?? 0) - (a.progress ?? 0)
5757
|| (b.notes !== null ? 1 : 0) - (a.notes !== null ? 1 : 0),
5858
)
59-
.map((entry: AniListListEntry) => (
59+
.map((entry: AniListListEntry, entryIndex) => (
6060
<div
6161
key={entry.media.id}
6262
className="relative group bg-gray-800 rounded-lg overflow-hidden shadow-md transition-all duration-300 hover:scale-105"
@@ -86,7 +86,8 @@ const AnimeList = ({ animeData, userName, author, lang, translation }: AnimeList
8686
: entry.media.title.romaji}
8787
fill
8888
className="object-cover"
89-
priority
89+
unoptimized
90+
priority={index === 1 && entryIndex <= 16}
9091
/>
9192
</div>
9293

src/schemas/anime.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const AniListListEntrySchema = z.object({
2929
})
3030

3131
const AniListListSchema = z.object({
32-
name: z.string(),
32+
name: z.string(), // Watching, Planning, Completed, Dropped, Paused, Repeating
3333
entries: z.array(
3434
AniListListEntrySchema,
3535
),

0 commit comments

Comments
 (0)