]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/utils.ts
Add ability to delete a specific video file
[github/Chocobozzz/PeerTube.git] / server / helpers / utils.ts
index 0545e89961bf6cd2b3780fbef50077d1d2f8ecd3..6b9333b533a6282d83343d22696a69ec89251ac6 100644 (file)
@@ -1,12 +1,13 @@
 import { remove } from 'fs-extra'
 import { Instance as ParseTorrent } from 'parse-torrent'
 import { join } from 'path'
-import { ResultList } from '../../shared'
+import { sha256 } from '@shared/extra-utils'
+import { ResultList } from '@shared/models'
 import { CONFIG } from '../initializers/config'
-import { execPromise, execPromise2, randomBytesPromise, sha256 } from './core-utils'
+import { execPromise, execPromise2, randomBytesPromise } from './core-utils'
 import { logger } from './logger'
 
-function deleteFileAsync (path: string) {
+function deleteFileAndCatch (path: string) {
   remove(path)
     .catch(err => logger.error('Cannot delete the file %s asynchronously.', path, { err }))
 }
@@ -83,7 +84,7 @@ function getUUIDFromFilename (filename: string) {
 // ---------------------------------------------------------------------------
 
 export {
-  deleteFileAsync,
+  deleteFileAndCatch,
   generateRandomString,
   getFormattedObjects,
   getSecureTorrentName,