aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-12-29 11:17:11 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-12-29 11:17:11 +0100
commit98ac898a03ed7bbb4edec74fe823b3f2d6d4904a (patch)
treed96e2b5fe8db9b4f1f1628067910495ec5679e3e /server/models
parent4712081f2a5f48749cf125d729e78b926ab28d6d (diff)
downloadPeerTube-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')
-rw-r--r--server/models/video.js14
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
13const constants = require('../initializers/constants') 13const constants = require('../initializers/constants')
14const logger = require('../helpers/logger') 14const logger = require('../helpers/logger')
15const friends = require('../lib/friends')
15const modelUtils = require('./utils') 16const modelUtils = require('./utils')
16const customVideosValidators = require('../helpers/custom-validators').videos 17const 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 }