]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/account/account-video-rate.ts
Import torrents with webtorrent
[github/Chocobozzz/PeerTube.git] / server / models / account / account-video-rate.ts
index 508ab814f93fe34f94031f477dafcef90a0fa32d..c99e32012b55e14854a94f856efe0ec35aaf14bd 100644 (file)
@@ -17,6 +17,15 @@ import { ActorModel } from '../activitypub/actor'
     {
       fields: [ 'videoId', 'accountId' ],
       unique: true
+    },
+    {
+      fields: [ 'videoId' ]
+    },
+    {
+      fields: [ 'accountId' ]
+    },
+    {
+      fields: [ 'videoId', 'type' ]
     }
   ]
 })
@@ -70,8 +79,8 @@ export class AccountVideoRateModel extends Model<AccountVideoRateModel> {
 
   static listAndCountAccountUrlsByVideoId (rateType: VideoRateType, videoId: number, start: number, count: number, t?: Transaction) {
     const query = {
-      start,
-      count,
+      offset: start,
+      limit: count,
       where: {
         videoId,
         type: rateType