diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-01-06 23:24:47 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-01-06 23:46:36 +0100 |
commit | ed04d94f6d7132055f97a2f757b85c03c5f2a0b6 (patch) | |
tree | 2f1f8c6f6e46b9ab18ba009403f80b14af61af68 /server/models | |
parent | bb0b243c92577872a5f4d98f707e078082af4d2a (diff) | |
download | PeerTube-ed04d94f6d7132055f97a2f757b85c03c5f2a0b6.tar.gz PeerTube-ed04d94f6d7132055f97a2f757b85c03c5f2a0b6.tar.zst PeerTube-ed04d94f6d7132055f97a2f757b85c03c5f2a0b6.zip |
Server: try to have a better video integrity
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/pod.js | 9 | ||||
-rw-r--r-- | server/models/request.js | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/server/models/pod.js b/server/models/pod.js index 83ecd732e..8e7dd1fd8 100644 --- a/server/models/pod.js +++ b/server/models/pod.js | |||
@@ -115,11 +115,18 @@ function list (callback) { | |||
115 | return this.findAll().asCallback(callback) | 115 | return this.findAll().asCallback(callback) |
116 | } | 116 | } |
117 | 117 | ||
118 | function listAllIds (callback) { | 118 | function listAllIds (transaction, callback) { |
119 | if (!callback) { | ||
120 | callback = transaction | ||
121 | transaction = null | ||
122 | } | ||
123 | |||
119 | const query = { | 124 | const query = { |
120 | attributes: [ 'id' ] | 125 | attributes: [ 'id' ] |
121 | } | 126 | } |
122 | 127 | ||
128 | if (transaction) query.transaction = transaction | ||
129 | |||
123 | return this.findAll(query).asCallback(function (err, pods) { | 130 | return this.findAll(query).asCallback(function (err, pods) { |
124 | if (err) return callback(err) | 131 | if (err) return callback(err) |
125 | 132 | ||
diff --git a/server/models/request.js b/server/models/request.js index bae227c05..1d6038044 100644 --- a/server/models/request.js +++ b/server/models/request.js | |||
@@ -291,8 +291,8 @@ function listWithLimitAndRandom (limit, callback) { | |||
291 | order: [ | 291 | order: [ |
292 | [ 'id', 'ASC' ] | 292 | [ 'id', 'ASC' ] |
293 | ], | 293 | ], |
294 | offset: start, | 294 | // offset: start, |
295 | limit: limit, | 295 | // limit: limit, |
296 | include: [ this.sequelize.models.Pod ] | 296 | include: [ this.sequelize.models.Pod ] |
297 | } | 297 | } |
298 | 298 | ||