diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-12-25 09:44:57 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-12-25 09:44:57 +0100 |
commit | b769007f733769d3afe2d29a3eb23e2e7693f301 (patch) | |
tree | 3816d542e907f298d08338129e0f6b9ca0df8fbb /server/models/video.js | |
parent | dd6019932efd6ae3b790bf024bc0cd74162e4517 (diff) | |
download | PeerTube-b769007f733769d3afe2d29a3eb23e2e7693f301.tar.gz PeerTube-b769007f733769d3afe2d29a3eb23e2e7693f301.tar.zst PeerTube-b769007f733769d3afe2d29a3eb23e2e7693f301.zip |
Update migrations code
Diffstat (limited to 'server/models/video.js')
-rw-r--r-- | server/models/video.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/models/video.js b/server/models/video.js index 0023a24e1..af05a861f 100644 --- a/server/models/video.js +++ b/server/models/video.js | |||
@@ -16,7 +16,7 @@ const modelUtils = require('./utils') | |||
16 | // --------------------------------------------------------------------------- | 16 | // --------------------------------------------------------------------------- |
17 | 17 | ||
18 | module.exports = function (sequelize, DataTypes) { | 18 | module.exports = function (sequelize, DataTypes) { |
19 | // TODO: add indexes on searchable columns | 19 | // TODO: add indexes on searchable columns |
20 | const Video = sequelize.define('Video', | 20 | const Video = sequelize.define('Video', |
21 | { | 21 | { |
22 | id: { | 22 | id: { |
@@ -50,6 +50,7 @@ module.exports = function (sequelize, DataTypes) { | |||
50 | 50 | ||
51 | generateThumbnailFromBase64, | 51 | generateThumbnailFromBase64, |
52 | getDurationFromFile, | 52 | getDurationFromFile, |
53 | list, | ||
53 | listForApi, | 54 | listForApi, |
54 | listByHostAndRemoteId, | 55 | listByHostAndRemoteId, |
55 | listOwnedAndPopulateAuthorAndTags, | 56 | listOwnedAndPopulateAuthorAndTags, |
@@ -310,6 +311,10 @@ function getDurationFromFile (videoPath, callback) { | |||
310 | }) | 311 | }) |
311 | } | 312 | } |
312 | 313 | ||
314 | function list (callback) { | ||
315 | return this.find().asCallback() | ||
316 | } | ||
317 | |||
313 | function listForApi (start, count, sort, callback) { | 318 | function listForApi (start, count, sort, callback) { |
314 | const query = { | 319 | const query = { |
315 | offset: start, | 320 | offset: start, |