IO-2008 Include mime type for listed media.
This commit is contained in:
@@ -8,6 +8,8 @@ import ListableChecker from "../util/listableChecker";
|
||||
import GenerateUrl from "../util/MediaUrlGen";
|
||||
import { PathToRoFolder } from "../util/pathGenerators";
|
||||
import { FolderPaths, JobRelativeFilePath } from "../util/serverInit";
|
||||
import ft from "file-type";
|
||||
import core from "file-type/core";
|
||||
|
||||
export async function JobsListMedia(req: Request, res: Response) {
|
||||
const jobid: string = (req.body.jobid || "").trim();
|
||||
@@ -27,7 +29,13 @@ export async function JobsListMedia(req: Request, res: Response) {
|
||||
const relativeThumbPath: string = await GenerateThumbnail(
|
||||
relativeFilePath
|
||||
);
|
||||
|
||||
const type: core.FileTypeResult | undefined = await ft.fromFile(
|
||||
relativeFilePath
|
||||
);
|
||||
|
||||
return {
|
||||
type,
|
||||
src: GenerateUrl([
|
||||
FolderPaths.StaticPath,
|
||||
FolderPaths.JobsFolder,
|
||||
@@ -64,7 +72,12 @@ export async function JobsListMedia(req: Request, res: Response) {
|
||||
const relativeThumbPath: string = await GenerateThumbnail(
|
||||
relativeFilePath
|
||||
);
|
||||
const type: core.FileTypeResult | undefined = await ft.fromFile(
|
||||
relativeFilePath
|
||||
);
|
||||
|
||||
return {
|
||||
type,
|
||||
src: GenerateUrl([
|
||||
FolderPaths.StaticPath,
|
||||
FolderPaths.JobsFolder,
|
||||
|
||||
Reference in New Issue
Block a user