aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-channel.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-20 13:52:49 +0200
committerChocobozzz <me@florianbigard.com>2019-08-20 14:53:42 +0200
commit0283eaac2a8e73006c66df3cf5bb9012e37450e5 (patch)
tree1fb73aeef57f984a77f47828ade23c6365ce8eb0 /server/models/video/video-channel.ts
parent96ca24f00e5ae5471dee9ee596489fe50af2b46f (diff)
downloadPeerTube-0283eaac2a8e73006c66df3cf5bb9012e37450e5.tar.gz
PeerTube-0283eaac2a8e73006c66df3cf5bb9012e37450e5.tar.zst
PeerTube-0283eaac2a8e73006c66df3cf5bb9012e37450e5.zip
Cleanup model types
Diffstat (limited to 'server/models/video/video-channel.ts')
-rw-r--r--server/models/video/video-channel.ts11
1 files changed, 5 insertions, 6 deletions
diff --git a/server/models/video/video-channel.ts b/server/models/video/video-channel.ts
index 79b9e7d2b..b6a60827f 100644
--- a/server/models/video/video-channel.ts
+++ b/server/models/video/video-channel.ts
@@ -37,7 +37,6 @@ import * as Bluebird from 'bluebird'
37import { 37import {
38 MChannelAccountDefault, 38 MChannelAccountDefault,
39 MChannelActor, 39 MChannelActor,
40 MChannelActorAccountDefault,
41 MChannelActorAccountDefaultVideos 40 MChannelActorAccountDefaultVideos
42} from '../../typings/models/video' 41} from '../../typings/models/video'
43 42
@@ -376,13 +375,13 @@ export class VideoChannelModel extends Model<VideoChannelModel> {
376 }) 375 })
377 } 376 }
378 377
379 static loadByIdAndPopulateAccount (id: number): Bluebird<MChannelActorAccountDefault> { 378 static loadByIdAndPopulateAccount (id: number): Bluebird<MChannelAccountDefault> {
380 return VideoChannelModel.unscoped() 379 return VideoChannelModel.unscoped()
381 .scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ]) 380 .scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ])
382 .findByPk(id) 381 .findByPk(id)
383 } 382 }
384 383
385 static loadByIdAndAccount (id: number, accountId: number): Bluebird<MChannelActorAccountDefault> { 384 static loadByIdAndAccount (id: number, accountId: number): Bluebird<MChannelAccountDefault> {
386 const query = { 385 const query = {
387 where: { 386 where: {
388 id, 387 id,
@@ -395,7 +394,7 @@ export class VideoChannelModel extends Model<VideoChannelModel> {
395 .findOne(query) 394 .findOne(query)
396 } 395 }
397 396
398 static loadAndPopulateAccount (id: number): Bluebird<MChannelActorAccountDefault> { 397 static loadAndPopulateAccount (id: number): Bluebird<MChannelAccountDefault> {
399 return VideoChannelModel.unscoped() 398 return VideoChannelModel.unscoped()
400 .scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ]) 399 .scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ])
401 .findByPk(id) 400 .findByPk(id)
@@ -427,7 +426,7 @@ export class VideoChannelModel extends Model<VideoChannelModel> {
427 return VideoChannelModel.loadByNameAndHostAndPopulateAccount(name, host) 426 return VideoChannelModel.loadByNameAndHostAndPopulateAccount(name, host)
428 } 427 }
429 428
430 static loadLocalByNameAndPopulateAccount (name: string): Bluebird<MChannelActorAccountDefault> { 429 static loadLocalByNameAndPopulateAccount (name: string): Bluebird<MChannelAccountDefault> {
431 const query = { 430 const query = {
432 include: [ 431 include: [
433 { 432 {
@@ -446,7 +445,7 @@ export class VideoChannelModel extends Model<VideoChannelModel> {
446 .findOne(query) 445 .findOne(query)
447 } 446 }
448 447
449 static loadByNameAndHostAndPopulateAccount (name: string, host: string): Bluebird<MChannelActorAccountDefault> { 448 static loadByNameAndHostAndPopulateAccount (name: string, host: string): Bluebird<MChannelAccountDefault> {
450 const query = { 449 const query = {
451 include: [ 450 include: [
452 { 451 {