mirror of
https://github.com/SrIzan10/hctv.git
synced 2026-06-06 00:56:56 +00:00
chore: revert variable dir stuff
This commit is contained in:
@@ -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 });
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user