aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-channel.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-09-04 10:22:10 +0200
committerChocobozzz <me@florianbigard.com>2018-09-04 10:49:53 +0200
commit5cf84858d49f4231cc4efec5e3132f17f65f6cf6 (patch)
treef1ff23476ff54c32c3fa34db79c11f242855d3b4 /server/models/video/video-channel.ts
parent0b74c74abe5a44e9f564ab6adb5177ab17d28e91 (diff)
downloadPeerTube-5cf84858d49f4231cc4efec5e3132f17f65f6cf6.tar.gz
PeerTube-5cf84858d49f4231cc4efec5e3132f17f65f6cf6.tar.zst
PeerTube-5cf84858d49f4231cc4efec5e3132f17f65f6cf6.zip
Add federation to ownership change
Diffstat (limited to 'server/models/video/video-channel.ts')
-rw-r--r--server/models/video/video-channel.ts16
1 files changed, 11 insertions, 5 deletions
diff --git a/server/models/video/video-channel.ts b/server/models/video/video-channel.ts
index 475530daf..f4586917e 100644
--- a/server/models/video/video-channel.ts
+++ b/server/models/video/video-channel.ts
@@ -296,6 +296,12 @@ export class VideoChannelModel extends Model<VideoChannelModel> {
296 }) 296 })
297 } 297 }
298 298
299 static loadByIdAndPopulateAccount (id: number) {
300 return VideoChannelModel.unscoped()
301 .scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ])
302 .findById(id)
303 }
304
299 static loadByIdAndAccount (id: number, accountId: number) { 305 static loadByIdAndAccount (id: number, accountId: number) {
300 const query = { 306 const query = {
301 where: { 307 where: {
@@ -304,13 +310,13 @@ export class VideoChannelModel extends Model<VideoChannelModel> {
304 } 310 }
305 } 311 }
306 312
307 return VideoChannelModel 313 return VideoChannelModel.unscoped()
308 .scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ]) 314 .scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ])
309 .findOne(query) 315 .findOne(query)
310 } 316 }
311 317
312 static loadAndPopulateAccount (id: number) { 318 static loadAndPopulateAccount (id: number) {
313 return VideoChannelModel 319 return VideoChannelModel.unscoped()
314 .scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ]) 320 .scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ])
315 .findById(id) 321 .findById(id)
316 } 322 }
@@ -365,7 +371,7 @@ export class VideoChannelModel extends Model<VideoChannelModel> {
365 ] 371 ]
366 } 372 }
367 373
368 return VideoChannelModel 374 return VideoChannelModel.unscoped()
369 .scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ]) 375 .scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ])
370 .findOne(query) 376 .findOne(query)
371 } 377 }
@@ -390,7 +396,7 @@ export class VideoChannelModel extends Model<VideoChannelModel> {
390 ] 396 ]
391 } 397 }
392 398
393 return VideoChannelModel 399 return VideoChannelModel.unscoped()
394 .scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ]) 400 .scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ])
395 .findOne(query) 401 .findOne(query)
396 } 402 }
@@ -402,7 +408,7 @@ export class VideoChannelModel extends Model<VideoChannelModel> {
402 ] 408 ]
403 } 409 }
404 410
405 return VideoChannelModel 411 return VideoChannelModel.unscoped()
406 .scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT, ScopeNames.WITH_VIDEOS ]) 412 .scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT, ScopeNames.WITH_VIDEOS ])
407 .findById(id, options) 413 .findById(id, options)
408 } 414 }