perf(build): make standalone image deterministic

This commit is contained in:
2026-08-09 21:34:00 +07:00 Unverified
parent c06b2ef88f
commit 1dc44e0215
10 changed files with 65 additions and 32 deletions
+3 -3
View File
@@ -219,7 +219,7 @@ async function publishYoutube(upload: typeof videoUploads.$inferSelect) {
throw new Error(`YouTube upload initialization failed (${init.status}).`);
const location = init.headers.get("location");
if (!location) throw new Error("YouTube did not return an upload URL.");
const video = await readFile(upload.videoPath);
const video = await readFile(/* turbopackIgnore: true */ upload.videoPath);
const result = await fetch(location, {
method: "PUT",
headers: {
@@ -233,7 +233,7 @@ async function publishYoutube(upload: typeof videoUploads.$inferSelect) {
const data = (await result.json()) as { id?: string };
if (!data.id) throw new Error("YouTube did not return a video ID.");
if (upload.thumbnailPath) {
const thumbnail = await readFile(upload.thumbnailPath);
const thumbnail = await readFile(/* turbopackIgnore: true */ upload.thumbnailPath);
const thumb = await fetch(
`https://www.googleapis.com/upload/youtube/v3/thumbnails/set?videoId=${encodeURIComponent(data.id)}`,
{
@@ -279,7 +279,7 @@ async function publishTiktok(upload: typeof videoUploads.$inferSelect) {
settings.privacyLevel ??
creator.data?.privacy_level_options?.[0] ??
"SELF_ONLY";
const video = await readFile(upload.videoPath);
const video = await readFile(/* turbopackIgnore: true */ upload.videoPath);
const chunkSize = Math.min(10 * 1024 * 1024, video.byteLength);
const totalChunkCount = Math.max(1, Math.floor(video.byteLength / chunkSize));
const init = await fetch(