- static listForApi (start: number, count: number, sort: SortType, type?: VideoBlacklistType) {
- const query: FindOptions = {
- offset: start,
- limit: count,
- order: getSortOnModel(sort.sortModel, sort.sortValue),
- include: [
- {
- model: VideoModel.scope(VideoModelScopeNames.WITH_THUMBNAILS),
- required: true,
- include: [
- {
- model: VideoChannelModel.scope({ method: [ VideoChannelScopeNames.SUMMARY, true ] }),
- required: true
- }
- ]
- }
- ]
+ static listForApi (parameters: {
+ start: number
+ count: number
+ sort: string
+ search?: string
+ type?: VideoBlacklistType
+ }) {
+ const { start, count, sort, search, type } = parameters
+
+ function buildBaseQuery (): FindOptions {
+ return {
+ offset: start,
+ limit: count,
+ order: getBlacklistSort(sort)
+ }