diff options
Diffstat (limited to 'server/models/video/sql')
-rw-r--r-- | server/models/video/sql/video/videos-id-list-query-builder.ts | 4 |
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' | |||
2 | import validator from 'validator' | 2 | import validator from 'validator' |
3 | import { exists } from '@server/helpers/custom-validators/misc' | 3 | import { exists } from '@server/helpers/custom-validators/misc' |
4 | import { WEBSERVER } from '@server/initializers/constants' | 4 | import { WEBSERVER } from '@server/initializers/constants' |
5 | import { buildDirectionAndField, createSafeIn } from '@server/models/utils' | 5 | import { buildDirectionAndField, createSafeIn, parseRowCountResult } from '@server/models/utils' |
6 | import { MUserAccountId, MUserId } from '@server/types/models' | 6 | import { MUserAccountId, MUserId } from '@server/types/models' |
7 | import { VideoInclude, VideoPrivacy, VideoState } from '@shared/models' | 7 | import { VideoInclude, VideoPrivacy, VideoState } from '@shared/models' |
8 | import { AbstractRunQuery } from '../../../shared/abstract-run-query' | 8 | import { 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) { |