From a8749f7c3b137f433e6944bb99fd721a6f0cfc1e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 10 Jan 2023 09:16:33 +0100 Subject: Fix comments SQL pagination --- .../video/sql/comment/video-comment-list-query-builder.ts | 11 +---------- .../video/sql/comment/video-comment-table-attributes.ts | 2 +- 2 files changed, 2 insertions(+), 11 deletions(-) (limited to 'server/models') diff --git a/server/models/video/sql/comment/video-comment-list-query-builder.ts b/server/models/video/sql/comment/video-comment-list-query-builder.ts index f3f6910e1..49b41b6d8 100644 --- a/server/models/video/sql/comment/video-comment-list-query-builder.ts +++ b/server/models/video/sql/comment/video-comment-list-query-builder.ts @@ -87,8 +87,7 @@ export class VideoCommentListQueryBuilder extends AbstractRunQuery { this.query = `${this.select} ` + `FROM (${this.innerQuery}) AS "VideoCommentModel" ` + `${this.joins} ` + - `${this.getOrder()} ` + - `${this.getLimit()}` + `${this.getOrder()}` } private buildInnerListQuery () { @@ -375,14 +374,6 @@ export class VideoCommentListQueryBuilder extends AbstractRunQuery { return 'ORDER BY ' + orders.map(o => `"${o[0]}" ${o[1]}`).join(', ') } - private getLimit () { - if (!this.options.count) return '' - - this.replacements.limit = this.options.count - - return `LIMIT :limit ` - } - private getInnerLimit () { if (!this.options.count) return '' diff --git a/server/models/video/sql/comment/video-comment-table-attributes.ts b/server/models/video/sql/comment/video-comment-table-attributes.ts index 10e635e41..87f8750c1 100644 --- a/server/models/video/sql/comment/video-comment-table-attributes.ts +++ b/server/models/video/sql/comment/video-comment-table-attributes.ts @@ -38,6 +38,6 @@ export class VideoCommentTableAttributes { @Memoize() getAvatarAttributes () { - return ActorImageModel.getSQLAttributes('Account->Actor->Avatars', 'Account.Actor.Avatars.id').join(', ') + return ActorImageModel.getSQLAttributes('Account->Actor->Avatars', 'Account.Actor.Avatars.').join(', ') } } -- cgit v1.2.3