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 }))
}
// ---------------------------------------------------------------------------
export {
- deleteFileAsync,
+ deleteFileAndCatch,
generateRandomString,
getFormattedObjects,
getSecureTorrentName,