This commit is contained in:
1 parent
c5c3ba1a38
commit
92707e00e3
4 files changed
+7
-4
No files matched your search
@@ -6,7 +6,6 @@ import Craftattack from '@assets/img/craftattack.webp';
|
|||||||
import Background from '@assets/img/background.webp';
|
import Background from '@assets/img/background.webp';
|
||||||
import { HOMEPAGE_TRAILER_URL, START_DATE } from 'astro:env/server';
|
import { HOMEPAGE_TRAILER_URL, START_DATE } from 'astro:env/server';
|
||||||
import { getSetting, SettingKey } from '@util/settings';
|
import { getSetting, SettingKey } from '@util/settings';
|
||||||
import { siteUrl } from '@util/url.ts';
|
|
||||||
import { db } from '@db/database.ts';
|
import { db } from '@db/database.ts';
|
||||||
|
|
||||||
const signupEnabled = await getSetting(db, SettingKey.SignupEnabled, false);
|
const signupEnabled = await getSetting(db, SettingKey.SignupEnabled, false);
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ if (!metadata) return new Response(null, { status: 404 });
|
|||||||
|
|
||||||
const { title, description, longDescription } = metadata;
|
const { title, description, longDescription } = metadata;
|
||||||
const streamUrl = siteUrl(`video/${encodeURIComponent(video.name)}/stream`);
|
const streamUrl = siteUrl(`video/${encodeURIComponent(video.name)}/stream`);
|
||||||
const thumbnailUrl = siteUrl(`video/${encodeURIComponent(video.name)}/thumbnail.jpg`);
|
const thumbnailUrl = siteUrl(
|
||||||
|
`video/${encodeURIComponent(video.name)}/thumbnail.jpg?v=${video.modifiedAt.getTime()}-${video.size}`
|
||||||
|
);
|
||||||
---
|
---
|
||||||
|
|
||||||
<WebsiteLayout title={title} description={description ?? undefined} openGraph="minimal">
|
<WebsiteLayout title={title} description={description ?? undefined} openGraph="minimal">
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ if (!video) return new Response(null, { status: 404 });
|
|||||||
const metadata = await getVideoMetadata(video);
|
const metadata = await getVideoMetadata(video);
|
||||||
const title = metadata?.title ?? video.name;
|
const title = metadata?.title ?? video.name;
|
||||||
const streamUrl = siteUrl(`video/${encodeURIComponent(video.name)}/stream`);
|
const streamUrl = siteUrl(`video/${encodeURIComponent(video.name)}/stream`);
|
||||||
const thumbnailUrl = siteUrl(`video/${encodeURIComponent(video.name)}/thumbnail.jpg`);
|
const thumbnailUrl = siteUrl(
|
||||||
|
`video/${encodeURIComponent(video.name)}/thumbnail.jpg?v=${video.modifiedAt.getTime()}-${video.size}`
|
||||||
|
);
|
||||||
---
|
---
|
||||||
|
|
||||||
<BaseLayout title={title}>
|
<BaseLayout title={title}>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ async function handle(context: APIContext, headersOnly = false) {
|
|||||||
const headers = {
|
const headers = {
|
||||||
'Content-Type': thumbnail.contentType,
|
'Content-Type': thumbnail.contentType,
|
||||||
'Content-Length': stats.size.toString(),
|
'Content-Length': stats.size.toString(),
|
||||||
'Cache-Control': 'public, max-age=86400'
|
'Cache-Control': 'public, max-age=31536000, immutable'
|
||||||
};
|
};
|
||||||
|
|
||||||
if (headersOnly) return new Response(null, { headers });
|
if (headersOnly) return new Response(null, { headers });
|
||||||
|
|||||||
Reference in new issue
Block a user