import { VideoModel } from '../video/video'
import { UserModel } from './user'
import { DestroyOptions, Op, Transaction } from 'sequelize'
-import { MUserAccountId, MUserId } from '@server/typings/models'
+import { MUserAccountId, MUserId } from '@server/types/models'
@Table({
tableName: 'userVideoHistory',
}
]
})
-export class UserVideoHistoryModel extends Model<UserVideoHistoryModel> {
+export class UserVideoHistoryModel extends Model {
@CreatedAt
createdAt: Date
})
User: UserModel
- static listForApi (user: MUserAccountId, start: number, count: number) {
+ static listForApi (user: MUserAccountId, start: number, count: number, search?: string) {
return VideoModel.listForApi({
start,
count,
- sort: '-UserVideoHistories.updatedAt',
+ search,
+ sort: '-"userVideoHistory"."updatedAt"',
nsfw: null, // All
includeLocalVideos: true,
withFiles: false,