Skip to content

Commit c1235a7

Browse files
committed
Fixes
1 parent 69fb19e commit c1235a7

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

src/app/album-art/route.tsx

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -107,38 +107,40 @@ export async function GET(request: NextRequest) {
107107
/>
108108
);
109109
}
110-
111-
// Fetch Roboto font
112-
const fontReg = await fetch(
113-
new URL('https://cdn.jsdelivr.net/fontsource/fonts/roboto@latest/latin-400-normal.ttf')
114-
).then((res) => res.arrayBuffer());
115-
116-
const fontBold = await fetch(
117-
new URL('https://cdn.jsdelivr.net/fontsource/fonts/roboto@latest/latin-700-normal.ttf')
118-
).then((res) => res.arrayBuffer());
119-
120-
const fontMegaBold = await fetch(
121-
new URL('https://cdn.jsdelivr.net/fontsource/fonts/roboto@latest/latin-900-normal.ttf')
122-
).then((res) => res.arrayBuffer());
110+
const [fontReg, fontBold, fontMegaBold] = await Promise.all([
111+
fetch(
112+
new URL('https://cdn.jsdelivr.net/fontsource/fonts/roboto@latest/latin-400-normal.ttf'),
113+
{ next: { revalidate: 60 * 60 * 24 * 30 } } // Cache for 30 days
114+
).then((res) => res.arrayBuffer()),
115+
fetch(
116+
new URL('https://cdn.jsdelivr.net/fontsource/fonts/roboto@latest/latin-700-normal.ttf'),
117+
{ next: { revalidate: 60 * 60 * 24 * 30 } } // Cache for 30 days
118+
).then((res) => res.arrayBuffer()),
119+
fetch(
120+
new URL('https://cdn.jsdelivr.net/fontsource/fonts/roboto@latest/latin-900-normal.ttf'),
121+
{ next: { revalidate: 60 * 60 * 24 * 30 } } // Cache for 30 days
122+
).then((res) => res.arrayBuffer()),
123+
]);
123124

124125
return new ImageResponse(
125126
(
126127
<div
127128
tw="flex h-full w-full flex-col items-center justify-center p-10 text-white relative overflow-hidden"
128129
style={{ background: bgGradient }}
129130
>
130-
<div tw="flex w-full max-w-[800px] flex-col items-center justify-center rounded-xl bg-black/10 p-10">
131-
<div tw="mb-2 text-center text-7xl font-extrabold">{artistName}</div>
132-
<div tw="mb-2 text-center text-6xl font-bold">{show.display_date}</div>
133-
<div tw="flex items-center justify-center" style={{ gap: 4 }}>
131+
<div tw="flex w-full max-w-[800px] flex-col items-center justify-center rounded-2xl bg-black/20 p-12 backdrop-blur-sm shadow-2xl">
132+
<div tw="mb-4 text-center text-7xl font-extrabold tracking-tight">{artistName}</div>
133+
<div tw="mb-6 text-center text-6xl font-bold">{show.display_date}</div>
134+
<div tw="flex items-center justify-center" style={{ gap: 8 }}>
134135
{show.venue?.name && (
135-
<div tw="rounded-lg bg-white/20 px-4 py-2 text-4xl flex">
136-
{show.venue?.name} {show.venue?.location ?? ''}
136+
<div tw="rounded-xl bg-white/25 px-6 py-3 text-4xl flex text-center backdrop-blur-sm">
137+
{show.venue?.name} {show.venue?.location ? `• ${show.venue.location}` : ''}
137138
</div>
138139
)}
139140
</div>
140141
</div>
141-
<div tw="absolute bottom-5 right-5 text-4xl opacity-80 font-bold">Relisten.net</div>
142+
143+
<div tw="absolute bottom-6 right-6 text-4xl font-bold">Relisten.net</div>
142144
{patternElements}
143145
</div>
144146
),

src/app/queries.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const fetchShow = async (
3131
cache: 'no-cache',
3232
}).json()) as Tape;
3333

34-
if (parsed) {
34+
if (parsed?.sources?.length) {
3535
parsed.sources = sortSources(parsed.sources);
3636

3737
return parsed;
@@ -49,7 +49,7 @@ export const fetchShowByUUID = async (showUuid: string): Promise<Partial<Tape> |
4949
cache: 'no-cache',
5050
}).json()) as Tape;
5151

52-
if (parsed) {
52+
if (parsed?.sources?.length) {
5353
parsed.sources = sortSources(parsed.sources);
5454

5555
return parsed;

0 commit comments

Comments
 (0)