X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Faccount%2Fuser-video-history.ts;h=6be1d65ea19e76d2e29d0f0b86960f102a02dea3;hb=4024c44f9027a32809931de0692d40d001df721c;hp=3fe4c8db1c8823921c9e5b07209e58e799f7a5ec;hpb=001ed2d40c8d2c8f494f5dc7f91ed62d56df10fd;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/account/user-video-history.ts b/server/models/account/user-video-history.ts index 3fe4c8db1..6be1d65ea 100644 --- a/server/models/account/user-video-history.ts +++ b/server/models/account/user-video-history.ts @@ -2,7 +2,7 @@ import { AllowNull, BelongsTo, Column, CreatedAt, ForeignKey, IsInt, Model, Tabl 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', @@ -19,7 +19,7 @@ import { MUserAccountId, MUserId } from '@server/typings/models' } ] }) -export class UserVideoHistoryModel extends Model { +export class UserVideoHistoryModel extends Model { @CreatedAt createdAt: Date @@ -55,11 +55,12 @@ export class UserVideoHistoryModel extends Model { }) 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,