diff options
Diffstat (limited to 'server/models/video/video-channel.ts')
-rw-r--r-- | server/models/video/video-channel.ts | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/server/models/video/video-channel.ts b/server/models/video/video-channel.ts index b6a60827f..7a4df516a 100644 --- a/server/models/video/video-channel.ts +++ b/server/models/video/video-channel.ts | |||
@@ -37,7 +37,7 @@ import * as Bluebird from 'bluebird' | |||
37 | import { | 37 | import { |
38 | MChannelAccountDefault, | 38 | MChannelAccountDefault, |
39 | MChannelActor, | 39 | MChannelActor, |
40 | MChannelActorAccountDefaultVideos | 40 | MChannelActorAccountDefaultVideos, MChannelSummaryFormattable, MChannelFormattable |
41 | } from '../../typings/models/video' | 41 | } from '../../typings/models/video' |
42 | 42 | ||
43 | // FIXME: Define indexes here because there is an issue with TS and Sequelize.literal when called directly in the annotation | 43 | // FIXME: Define indexes here because there is an issue with TS and Sequelize.literal when called directly in the annotation |
@@ -482,7 +482,20 @@ export class VideoChannelModel extends Model<VideoChannelModel> { | |||
482 | .findByPk(id, options) | 482 | .findByPk(id, options) |
483 | } | 483 | } |
484 | 484 | ||
485 | toFormattedJSON (): VideoChannel { | 485 | toFormattedSummaryJSON (this: MChannelSummaryFormattable): VideoChannelSummary { |
486 | const actor = this.Actor.toFormattedSummaryJSON() | ||
487 | |||
488 | return { | ||
489 | id: this.id, | ||
490 | name: actor.name, | ||
491 | displayName: this.getDisplayName(), | ||
492 | url: actor.url, | ||
493 | host: actor.host, | ||
494 | avatar: actor.avatar | ||
495 | } | ||
496 | } | ||
497 | |||
498 | toFormattedJSON (this: MChannelFormattable): VideoChannel { | ||
486 | const actor = this.Actor.toFormattedJSON() | 499 | const actor = this.Actor.toFormattedJSON() |
487 | const videoChannel = { | 500 | const videoChannel = { |
488 | id: this.id, | 501 | id: this.id, |
@@ -500,19 +513,6 @@ export class VideoChannelModel extends Model<VideoChannelModel> { | |||
500 | return Object.assign(actor, videoChannel) | 513 | return Object.assign(actor, videoChannel) |
501 | } | 514 | } |
502 | 515 | ||
503 | toFormattedSummaryJSON (): VideoChannelSummary { | ||
504 | const actor = this.Actor.toFormattedJSON() | ||
505 | |||
506 | return { | ||
507 | id: this.id, | ||
508 | name: actor.name, | ||
509 | displayName: this.getDisplayName(), | ||
510 | url: actor.url, | ||
511 | host: actor.host, | ||
512 | avatar: actor.avatar | ||
513 | } | ||
514 | } | ||
515 | |||
516 | toActivityPubObject (): ActivityPubActor { | 516 | toActivityPubObject (): ActivityPubActor { |
517 | const obj = this.Actor.toActivityPubObject(this.name, 'VideoChannel') | 517 | const obj = this.Actor.toActivityPubObject(this.name, 'VideoChannel') |
518 | 518 | ||