Start of ESM update
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { Request, Response } from "express";
|
||||
import ft from "file-type";
|
||||
import core from "file-type/core";
|
||||
import { fileTypeFromFile } from "file-type";
|
||||
import { FileTypeResult } from "file-type/core";
|
||||
import fs from "fs-extra";
|
||||
import path, { relative } from "path";
|
||||
import path from "path";
|
||||
import GenerateUrl from "../util/MediaUrlGen";
|
||||
import GenerateThumbnail from "../util/generateThumbnail";
|
||||
import MediaFile from "../util/interfaces/MediaFile";
|
||||
@@ -25,7 +25,7 @@ export async function BillsListMedia(req: Request, res: Response) {
|
||||
const relativeFilePath: string = path.join(PathToRoBillsFolder(jobid), file.filename);
|
||||
|
||||
const relativeThumbPath: string = await GenerateThumbnail(relativeFilePath);
|
||||
const type: core.FileTypeResult | undefined = await ft.fileTypeFromFile(relativeFilePath);
|
||||
const type: FileTypeResult | undefined = await fileTypeFromFile(relativeFilePath);
|
||||
return {
|
||||
type,
|
||||
size: file.size,
|
||||
@@ -68,7 +68,7 @@ export async function BillsListMedia(req: Request, res: Response) {
|
||||
const relativeFilePath: string = path.join(PathToRoBillsFolder(jobid), file.name);
|
||||
|
||||
const relativeThumbPath: string = await GenerateThumbnail(relativeFilePath);
|
||||
const type: core.FileTypeResult | undefined = await ft.fileTypeFromFile(relativeFilePath);
|
||||
const type: FileTypeResult | undefined = await fileTypeFromFile(relativeFilePath);
|
||||
const fileSize = await fs.stat(relativeFilePath);
|
||||
return {
|
||||
type,
|
||||
|
||||
Reference in New Issue
Block a user