aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/user
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/user')
-rw-r--r--server/models/user/user-video-history.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/server/models/user/user-video-history.ts b/server/models/user/user-video-history.ts
index 92f4fe7a1..f4d0889a1 100644
--- a/server/models/user/user-video-history.ts
+++ b/server/models/user/user-video-history.ts
@@ -69,6 +69,17 @@ export class UserVideoHistoryModel extends Model<Partial<AttributesOnly<UserVide
69 }) 69 })
70 } 70 }
71 71
72 static removeUserHistoryElement (user: MUserId, videoId: number) {
73 const query: DestroyOptions = {
74 where: {
75 userId: user.id,
76 videoId
77 }
78 }
79
80 return UserVideoHistoryModel.destroy(query)
81 }
82
72 static removeUserHistoryBefore (user: MUserId, beforeDate: string, t: Transaction) { 83 static removeUserHistoryBefore (user: MUserId, beforeDate: string, t: Transaction) {
73 const query: DestroyOptions = { 84 const query: DestroyOptions = {
74 where: { 85 where: {