-import { VideoResolution } from '../../shared/models/videos/video-resolution.enum'
-
-function badRequest (req: express.Request, res: express.Response, next: express.NextFunction) {
- res.type('json').status(400).end()
+import { CONFIG } from '../initializers'
+import { ApplicationModel } from '../models/application/application'
+import { pseudoRandomBytesPromise, sha256 } from './core-utils'
+import { logger } from './logger'
+import { join } from 'path'
+import { Instance as ParseTorrent } from 'parse-torrent'
+import { remove } from 'fs-extra'
+import * as memoizee from 'memoizee'
+
+function deleteFileAsync (path: string) {
+ remove(path)
+ .catch(err => logger.error('Cannot delete the file %s asynchronously.', path, { err }))