]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/models/video/sql/comment/video-comment-table-attributes.ts
Bumped to version v5.2.1
[github/Chocobozzz/PeerTube.git] / server / models / video / sql / comment / video-comment-table-attributes.ts
CommitLineData
eb66ee88
C
1import { Memoize } from '@server/helpers/memoize'
2import { AccountModel } from '@server/models/account/account'
3import { ActorModel } from '@server/models/actor/actor'
4import { ActorImageModel } from '@server/models/actor/actor-image'
5import { ServerModel } from '@server/models/server/server'
6import { VideoCommentModel } from '../../video-comment'
7
cde3d90d
C
8export class VideoCommentTableAttributes {
9
eb66ee88 10 @Memoize()
cde3d90d 11 getVideoCommentAttributes () {
eb66ee88 12 return VideoCommentModel.getSQLAttributes('VideoCommentModel').join(', ')
cde3d90d
C
13 }
14
eb66ee88 15 @Memoize()
cde3d90d 16 getAccountAttributes () {
eb66ee88 17 return AccountModel.getSQLAttributes('Account', 'Account.').join(', ')
cde3d90d
C
18 }
19
eb66ee88 20 @Memoize()
cde3d90d
C
21 getVideoAttributes () {
22 return [
23 `"Video"."id" AS "Video.id"`,
24 `"Video"."uuid" AS "Video.uuid"`,
25 `"Video"."name" AS "Video.name"`
26 ].join(', ')
27 }
28
eb66ee88 29 @Memoize()
cde3d90d 30 getActorAttributes () {
eb66ee88 31 return ActorModel.getSQLAPIAttributes('Account->Actor', `Account.Actor.`).join(', ')
cde3d90d
C
32 }
33
eb66ee88 34 @Memoize()
cde3d90d 35 getServerAttributes () {
eb66ee88 36 return ServerModel.getSQLAttributes('Account->Actor->Server', `Account.Actor.Server.`).join(', ')
cde3d90d
C
37 }
38
eb66ee88 39 @Memoize()
cde3d90d 40 getAvatarAttributes () {
a8749f7c 41 return ActorImageModel.getSQLAttributes('Account->Actor->Avatars', 'Account.Actor.Avatars.').join(', ')
cde3d90d
C
42 }
43}