Server: fix videos pagination
authorChocobozzz <florian.bigard@gmail.com>
Wed, 6 Jul 2016 17:57:47 +0000 (19:57 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Wed, 6 Jul 2016 17:57:47 +0000 (19:57 +0200)
server/models/video.js

index 1c06e477cc195c7a842799ff8c70af1d39c72a7a..8054caa773fc667b298dcdc06e0b19fb25e19bdd 100644 (file)
@@ -248,7 +248,7 @@ function findWithCount (query, start, count, sort, callback) {
 
   async.parallel([
     function (asyncCallback) {
-      self.find(query).skip(start).limit(start + count).sort(sort).exec(asyncCallback)
+      self.find(query).skip(start).limit(count).sort(sort).exec(asyncCallback)
     },
     function (asyncCallback) {
       self.count(query, asyncCallback)