1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

Correctly migrate to fs-extra

This commit is contained in:
Chocobozzz 2018-08-27 16:23:34 +02:00
parent 84b6dbcc6e
commit 62689b942b
No known key found for this signature in database
GPG key ID: 583A612D890159BE
29 changed files with 100 additions and 117 deletions

View file

@ -1,11 +1,11 @@
import * as ffmpeg from 'fluent-ffmpeg'
import { join } from 'path'
import { VideoResolution } from '../../shared/models/videos'
import { CONFIG, VIDEO_TRANSCODING_FPS, FFMPEG_NICE } from '../initializers'
import { unlinkPromise } from './core-utils'
import { CONFIG, FFMPEG_NICE, VIDEO_TRANSCODING_FPS } from '../initializers'
import { processImage } from './image-utils'
import { logger } from './logger'
import { checkFFmpegEncoders } from '../initializers/checker'
import { remove } from 'fs-extra'
function computeResolutionsToTranscode (videoFileHeight: number) {
const resolutionsEnabled: number[] = []
@ -90,7 +90,7 @@ async function generateImageFromVideoFile (fromPath: string, folder: string, ima
logger.error('Cannot generate image from video %s.', fromPath, { err })
try {
await unlinkPromise(pendingImagePath)
await remove(pendingImagePath)
} catch (err) {
logger.debug('Cannot remove pending image path after generation error.', { err })
}