mirror of
https://github.com/diced/zipline.git
synced 2025-12-05 20:40:12 -08:00
fix: unecessary stuff
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
-- AlterTable
|
|
||||||
ALTER TABLE "File" ADD COLUMN "thumbnailId" INTEGER;
|
|
||||||
|
|
||||||
-- CreateTable
|
-- CreateTable
|
||||||
CREATE TABLE "Thumbnail" (
|
CREATE TABLE "Thumbnail" (
|
||||||
|
|||||||
@@ -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";
|
|
||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user