From 736dde96336c5a00d3761f0894157b51a26081cc Mon Sep 17 00:00:00 2001 From: Sam Wilkins <35748010+samwilkins333@users.noreply.github.com> Date: Wed, 12 Feb 2020 16:32:48 -0500 Subject: standardized upload file response, particularly as it applies to video --- src/server/DashUploadUtils.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/server/DashUploadUtils.ts') diff --git a/src/server/DashUploadUtils.ts b/src/server/DashUploadUtils.ts index 0f1758c26..9ccc860f1 100644 --- a/src/server/DashUploadUtils.ts +++ b/src/server/DashUploadUtils.ts @@ -97,7 +97,7 @@ export namespace DashUploadUtils { } console.log(red(`Ignoring unsupported file (${name}) with upload type (${type}).`)); - return { accessPaths: undefined }; + return { accessPaths: {} }; } async function UploadPdf(absolutePath: string) { @@ -216,13 +216,15 @@ export namespace DashUploadUtils { }; }; - export async function MoveParsedFile(absolutePath: string, destination: Directory): Promise> { - return new Promise>(resolve => { + export async function MoveParsedFile(absolutePath: string, destination: Directory): Promise> { + return new Promise(resolve => { const filename = basename(absolutePath); const destinationPath = serverPathToFile(destination, filename); rename(absolutePath, destinationPath, error => { resolve(error ? undefined : { - agnostic: getAccessPaths(destination, filename) + accessPaths: { + agnostic: getAccessPaths(destination, filename) + } }); }); }); -- cgit v1.2.3-70-g09d2