diff options
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/video.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/server/models/video.js b/server/models/video.js index d1595ce51..564e362fd 100644 --- a/server/models/video.js +++ b/server/models/video.js | |||
@@ -12,6 +12,7 @@ const values = require('lodash/values') | |||
12 | 12 | ||
13 | const constants = require('../initializers/constants') | 13 | const constants = require('../initializers/constants') |
14 | const logger = require('../helpers/logger') | 14 | const logger = require('../helpers/logger') |
15 | const friends = require('../lib/friends') | ||
15 | const modelUtils = require('./utils') | 16 | const modelUtils = require('./utils') |
16 | const customVideosValidators = require('../helpers/custom-validators').videos | 17 | const customVideosValidators = require('../helpers/custom-validators').videos |
17 | 18 | ||
@@ -205,11 +206,24 @@ function afterDestroy (video, options, next) { | |||
205 | function (callback) { | 206 | function (callback) { |
206 | removeFile(video, callback) | 207 | removeFile(video, callback) |
207 | }, | 208 | }, |
209 | |||
208 | function (callback) { | 210 | function (callback) { |
209 | removeTorrent(video, callback) | 211 | removeTorrent(video, callback) |
210 | }, | 212 | }, |
213 | |||
211 | function (callback) { | 214 | function (callback) { |
212 | removePreview(video, callback) | 215 | removePreview(video, callback) |
216 | }, | ||
217 | |||
218 | function (callback) { | ||
219 | const params = { | ||
220 | name: video.name, | ||
221 | remoteId: video.id | ||
222 | } | ||
223 | |||
224 | friends.removeVideoToFriends(params) | ||
225 | |||
226 | return callback() | ||
213 | } | 227 | } |
214 | ) | 228 | ) |
215 | } | 229 | } |