+ static listCommentsForApi (parameters: {
+ start: number
+ count: number
+ sort: string
+
+ onLocalVideo?: boolean
+ isLocal?: boolean
+ search?: string
+ searchAccount?: string
+ searchVideo?: string
+ }) {
+ const queryOptions: ListVideoCommentsOptions = {
+ ...pick(parameters, [ 'start', 'count', 'sort', 'isLocal', 'search', 'searchVideo', 'searchAccount', 'onLocalVideo' ]),
+
+ selectType: 'api',
+ notDeleted: true
+ }
+
+ return Promise.all([
+ new VideoCommentListQueryBuilder(VideoCommentModel.sequelize, queryOptions).listComments<MCommentAdminFormattable>(),
+ new VideoCommentListQueryBuilder(VideoCommentModel.sequelize, queryOptions).countComments()
+ ]).then(([ rows, count ]) => {
+ return { total: count, data: rows }
+ })
+ }
+