From 15a7eafb892441957ba7dd6fcbf556086fe5b2b3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 26 Jul 2021 15:04:37 +0200 Subject: Refactor video links builders --- shared/core-utils/logs/logs.ts | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 shared/core-utils/logs/logs.ts (limited to 'shared/core-utils/logs/logs.ts') diff --git a/shared/core-utils/logs/logs.ts b/shared/core-utils/logs/logs.ts deleted file mode 100644 index d0996cf55..000000000 --- a/shared/core-utils/logs/logs.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { stat } from 'fs-extra' - -async function mtimeSortFilesDesc (files: string[], basePath: string) { - const promises = [] - const out: { file: string, mtime: number }[] = [] - - for (const file of files) { - const p = stat(basePath + '/' + file) - .then(stats => { - if (stats.isFile()) out.push({ file, mtime: stats.mtime.getTime() }) - }) - - promises.push(p) - } - - await Promise.all(promises) - - out.sort((a, b) => b.mtime - a.mtime) - - return out -} - -export { - mtimeSortFilesDesc -} -- cgit v1.2.3