diff options
Diffstat (limited to 'server/models/video/video-blacklist.ts')
-rw-r--r-- | server/models/video/video-blacklist.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/server/models/video/video-blacklist.ts b/server/models/video/video-blacklist.ts index b4df6cd6a..533bfe1ad 100644 --- a/server/models/video/video-blacklist.ts +++ b/server/models/video/video-blacklist.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | import { AllowNull, BelongsTo, Column, CreatedAt, DataType, Default, ForeignKey, Is, Model, Table, UpdatedAt } from 'sequelize-typescript' | 1 | import { AllowNull, BelongsTo, Column, CreatedAt, DataType, Default, ForeignKey, Is, Model, Table, UpdatedAt } from 'sequelize-typescript' |
2 | import { getSortOnModel, SortType, throwIfNotValid } from '../utils' | 2 | import { getBlacklistSort, SortType, throwIfNotValid } from '../utils' |
3 | import { VideoModel } from './video' | 3 | import { VideoModel } from './video' |
4 | import { ScopeNames as VideoChannelScopeNames, SummaryOptions, VideoChannelModel } from './video-channel' | 4 | import { ScopeNames as VideoChannelScopeNames, SummaryOptions, VideoChannelModel } from './video-channel' |
5 | import { isVideoBlacklistReasonValid, isVideoBlacklistTypeValid } from '../../helpers/custom-validators/video-blacklist' | 5 | import { isVideoBlacklistReasonValid, isVideoBlacklistTypeValid } from '../../helpers/custom-validators/video-blacklist' |
6 | import { VideoBlacklist, VideoBlacklistType } from '../../../shared/models/videos' | 6 | import { VideoBlacklist, VideoBlacklistType } from '../../../shared/models/videos' |
7 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' | 7 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' |
8 | import { FindOptions } from 'sequelize' | 8 | import { FindOptions, literal } from 'sequelize' |
9 | import { ThumbnailModel } from './thumbnail' | 9 | import { ThumbnailModel } from './thumbnail' |
10 | import * as Bluebird from 'bluebird' | 10 | import * as Bluebird from 'bluebird' |
11 | import { MVideoBlacklist, MVideoBlacklistFormattable } from '@server/typings/models' | 11 | import { MVideoBlacklist, MVideoBlacklistFormattable } from '@server/typings/models' |
@@ -59,14 +59,13 @@ export class VideoBlacklistModel extends Model<VideoBlacklistModel> { | |||
59 | return { | 59 | return { |
60 | offset: start, | 60 | offset: start, |
61 | limit: count, | 61 | limit: count, |
62 | order: getSortOnModel(sort.sortModel, sort.sortValue) | 62 | order: getBlacklistSort(sort.sortModel, sort.sortValue) |
63 | } | 63 | } |
64 | } | 64 | } |
65 | 65 | ||
66 | const countQuery = buildBaseQuery() | 66 | const countQuery = buildBaseQuery() |
67 | 67 | ||
68 | const findQuery = buildBaseQuery() | 68 | const findQuery = buildBaseQuery() |
69 | findQuery.subQuery = false | ||
70 | findQuery.include = [ | 69 | findQuery.include = [ |
71 | { | 70 | { |
72 | model: VideoModel, | 71 | model: VideoModel, |