}
function beforeValidate (video, options, next) {
- if (video.isOwned()) {
+ // Put a fake infoHash if it does not exists yet
+ if (video.isOwned() && !video.infoHash) {
// 40 hexa length
video.infoHash = '0123456789abcdef0123456789abcdef01234567'
}
function (callback) {
const params = {
- name: video.name,
remoteId: video.id
}
author: this.Author.name,
duration: this.duration,
tags: map(this.Tags, 'name'),
- thumbnailPath: constants.STATIC_PATHS.THUMBNAILS + '/' + this.getThumbnailName(),
+ thumbnailPath: pathUtils.join(constants.STATIC_PATHS.THUMBNAILS, this.getThumbnailName()),
createdAt: this.createdAt,
updatedAt: this.updatedAt
}