chore: revert variable dir stuff

This commit is contained in:
2025-06-16 18:22:05 +02:00
parent 47fdbf66f9
commit d2e2d0ce62
2 changed files with 2 additions and 4 deletions

View File

@@ -1,7 +1,6 @@
import { validateRequest } from '@/lib/auth/validate';
import fsP from 'fs/promises';
import fs from 'fs';
import { thumbDir } from '@/lib/workers/worker/thumbnails';
export async function GET(request: Request, { params }: { params: Promise<{ username: string }> }) {
const { username } = await params;
@@ -13,7 +12,7 @@ export async function GET(request: Request, { params }: { params: Promise<{ user
return new Response("nuh uh", { status: 403 });
}
const filePath = `${thumbDir}/${username}.webp`;
const filePath = `/dev/shm/hctv-thumb/${username}.webp`;
if (!fs.existsSync(filePath)) {
return new Response("Not Found", { status: 404 });

View File

@@ -5,8 +5,6 @@ import { promisify } from 'node:util';
import { existsSync } from 'node:fs';
const pExec = promisify(exec);
export const thumbDir = process.env.NODE_ENV === 'development' ? '/dev/shm/hctv-thumb' : '/app/thumbs';
const globalForWorker = global as unknown as {
thumbnailWorker: Worker | null;
};
@@ -29,6 +27,7 @@ export async function registerThumbnailWorker(): Promise<void> {
// this is totally unnecessary, but i'll keep it for security purposes.
const name = job.data.name.replace(/[^a-zA-Z0-9]/g, '_');
const m3u8location = `/dev/shm/hls/${name}.m3u8`;
const thumbDir = '/dev/shm/hctv-thumb';
if (!existsSync(m3u8location)) return;
if (!existsSync(thumbDir)) {