aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/sql
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video/sql')
-rw-r--r--server/models/video/sql/video/videos-id-list-query-builder.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/models/video/sql/video/videos-id-list-query-builder.ts b/server/models/video/sql/video/videos-id-list-query-builder.ts
index 09cb791db..8692a436a 100644
--- a/server/models/video/sql/video/videos-id-list-query-builder.ts
+++ b/server/models/video/sql/video/videos-id-list-query-builder.ts
@@ -2,7 +2,7 @@ import { Sequelize } from 'sequelize'
2import validator from 'validator' 2import validator from 'validator'
3import { exists } from '@server/helpers/custom-validators/misc' 3import { exists } from '@server/helpers/custom-validators/misc'
4import { WEBSERVER } from '@server/initializers/constants' 4import { WEBSERVER } from '@server/initializers/constants'
5import { buildDirectionAndField, createSafeIn } from '@server/models/utils' 5import { buildDirectionAndField, createSafeIn, parseRowCountResult } from '@server/models/utils'
6import { MUserAccountId, MUserId } from '@server/types/models' 6import { MUserAccountId, MUserId } from '@server/types/models'
7import { VideoInclude, VideoPrivacy, VideoState } from '@shared/models' 7import { VideoInclude, VideoPrivacy, VideoState } from '@shared/models'
8import { AbstractRunQuery } from '../../../shared/abstract-run-query' 8import { AbstractRunQuery } from '../../../shared/abstract-run-query'
@@ -105,7 +105,7 @@ export class VideosIdListQueryBuilder extends AbstractRunQuery {
105 countVideoIds (countOptions: BuildVideosListQueryOptions): Promise<number> { 105 countVideoIds (countOptions: BuildVideosListQueryOptions): Promise<number> {
106 this.buildIdsListQuery(countOptions) 106 this.buildIdsListQuery(countOptions)
107 107
108 return this.runQuery().then(rows => rows.length !== 0 ? rows[0].total : 0) 108 return this.runQuery().then(rows => parseRowCountResult(rows))
109 } 109 }
110 110
111 getQuery (options: BuildVideosListQueryOptions) { 111 getQuery (options: BuildVideosListQueryOptions) {