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/index.ts | 1 - shared/core-utils/logs/logs.ts | 25 ------------------------- 2 files changed, 26 deletions(-) delete mode 100644 shared/core-utils/logs/index.ts delete mode 100644 shared/core-utils/logs/logs.ts (limited to 'shared/core-utils/logs') diff --git a/shared/core-utils/logs/index.ts b/shared/core-utils/logs/index.ts deleted file mode 100644 index ceb5d7a7f..000000000 --- a/shared/core-utils/logs/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './logs' 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