fix: unecessary stuff

This commit is contained in:
diced
2023-05-29 17:55:39 -07:00
parent e92d78f671
commit 88fdb2fcc1
3 changed files with 10 additions and 22 deletions

View File

@@ -1,5 +1,3 @@
-- AlterTable
ALTER TABLE "File" ADD COLUMN "thumbnailId" INTEGER;
-- CreateTable -- CreateTable
CREATE TABLE "Thumbnail" ( CREATE TABLE "Thumbnail" (

View File

@@ -1,8 +0,0 @@
/*
Warnings:
- You are about to drop the column `thumbnailId` on the `File` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "File" DROP COLUMN "thumbnailId";

View File

@@ -1,16 +1,14 @@
import Logger from 'lib/logger';
import { isMainThread, workerData } from 'worker_threads';
// import ffmpeg from 'ffmpeg-static';
import prisma from 'lib/prisma';
import datasource from 'lib/datasource';
import config from 'lib/config';
import { spawn } from 'child_process';
import { join } from 'path';
import { createWriteStream } from 'fs';
import { File } from '@prisma/client'; import { File } from '@prisma/client';
import { spawn } from 'child_process';
import ffmpeg from 'ffmpeg-static'; import ffmpeg from 'ffmpeg-static';
import { createWriteStream } from 'fs';
import { rm } from 'fs/promises'; import { rm } from 'fs/promises';
import config from 'lib/config';
import datasource from 'lib/datasource';
import Logger from 'lib/logger';
import prisma from 'lib/prisma';
import { join } from 'path';
import { isMainThread, workerData } from 'worker_threads';
const { id } = workerData as { id: number }; const { id } = workerData as { id: number };
@@ -26,12 +24,12 @@ async function loadThumbnail(path) {
const child = spawn(ffmpeg, args, { stdio: ['ignore', 'pipe', 'ignore'] }); const child = spawn(ffmpeg, args, { stdio: ['ignore', 'pipe', 'ignore'] });
const data = await new Promise((resolve, reject) => { const data: Promise<Buffer> = new Promise((resolve, reject) => {
child.stdout.once('data', resolve); child.stdout.once('data', resolve);
child.once('error', reject); child.once('error', reject);
}); });
return data as unknown as Buffer; return data;
} }
async function loadFileTmp(file: File) { async function loadFileTmp(file: File) {