diff options
Diffstat (limited to 'server/initializers/migrations/0065-video-file-size.ts')
-rw-r--r-- | server/initializers/migrations/0065-video-file-size.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/initializers/migrations/0065-video-file-size.ts b/server/initializers/migrations/0065-video-file-size.ts index 66f25016a..e9ce77e50 100644 --- a/server/initializers/migrations/0065-video-file-size.ts +++ b/server/initializers/migrations/0065-video-file-size.ts | |||
@@ -2,6 +2,7 @@ import * as Sequelize from 'sequelize' | |||
2 | import * as Promise from 'bluebird' | 2 | import * as Promise from 'bluebird' |
3 | import { stat } from 'fs-extra' | 3 | import { stat } from 'fs-extra' |
4 | import { VideoModel } from '../../models/video/video' | 4 | import { VideoModel } from '../../models/video/video' |
5 | import { getVideoFilePath } from '@server/lib/video-paths' | ||
5 | 6 | ||
6 | function up (utils: { | 7 | function up (utils: { |
7 | transaction: Sequelize.Transaction, | 8 | transaction: Sequelize.Transaction, |
@@ -16,7 +17,7 @@ function up (utils: { | |||
16 | videos.forEach(video => { | 17 | videos.forEach(video => { |
17 | video.VideoFiles.forEach(videoFile => { | 18 | video.VideoFiles.forEach(videoFile => { |
18 | const p = new Promise((res, rej) => { | 19 | const p = new Promise((res, rej) => { |
19 | stat(video.getVideoFilePath(videoFile), (err, stats) => { | 20 | stat(getVideoFilePath(video, videoFile), (err, stats) => { |
20 | if (err) return rej(err) | 21 | if (err) return rej(err) |
21 | 22 | ||
22 | videoFile.size = stats.size | 23 | videoFile.size = stats.size |