const constants = require('../initializers/constants')
const logger = require('../helpers/logger')
+const friends = require('../lib/friends')
const modelUtils = require('./utils')
const customVideosValidators = require('../helpers/custom-validators').videos
}
},
{
+ indexes: [
+ {
+ fields: [ 'authorId' ]
+ },
+ {
+ fields: [ 'remoteId' ]
+ },
+ {
+ fields: [ 'name' ]
+ },
+ {
+ fields: [ 'createdAt' ]
+ },
+ {
+ fields: [ 'duration' ]
+ },
+ {
+ fields: [ 'infoHash' ]
+ }
+ ],
classMethods: {
associate,
function (callback) {
removeFile(video, callback)
},
+
function (callback) {
removeTorrent(video, callback)
},
+
function (callback) {
removePreview(video, callback)
+ },
+
+ function (callback) {
+ const params = {
+ name: video.name,
+ remoteId: video.id
+ }
+
+ friends.removeVideoToFriends(params)
+
+ return callback()
}
)
}