diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-12-29 11:17:11 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-12-29 11:17:11 +0100 |
commit | 98ac898a03ed7bbb4edec74fe823b3f2d6d4904a (patch) | |
tree | d96e2b5fe8db9b4f1f1628067910495ec5679e3e /server/models/video.js | |
parent | 4712081f2a5f48749cf125d729e78b926ab28d6d (diff) | |
download | PeerTube-98ac898a03ed7bbb4edec74fe823b3f2d6d4904a.tar.gz PeerTube-98ac898a03ed7bbb4edec74fe823b3f2d6d4904a.tar.zst PeerTube-98ac898a03ed7bbb4edec74fe823b3f2d6d4904a.zip |
Server: use video hook to send information to other pods when a video is
deleted
Diffstat (limited to 'server/models/video.js')
-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 | } |