]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video.js
Update migrations code
[github/Chocobozzz/PeerTube.git] / server / models / video.js
index 0023a24e1c061ff1bb479e381aa2091fb7362a24..af05a861fbcaf4fc3c743b9edd6263fa8f010ef3 100644 (file)
@@ -16,7 +16,7 @@ const modelUtils = require('./utils')
 // ---------------------------------------------------------------------------
 
 module.exports = function (sequelize, DataTypes) {
-// TODO: add indexes on searchable columns
+  // TODO: add indexes on searchable columns
   const Video = sequelize.define('Video',
     {
       id: {
@@ -50,6 +50,7 @@ module.exports = function (sequelize, DataTypes) {
 
         generateThumbnailFromBase64,
         getDurationFromFile,
+        list,
         listForApi,
         listByHostAndRemoteId,
         listOwnedAndPopulateAuthorAndTags,
@@ -310,6 +311,10 @@ function getDurationFromFile (videoPath, callback) {
   })
 }
 
+function list (callback) {
+  return this.find().asCallback()
+}
+
 function listForApi (start, count, sort, callback) {
   const query = {
     offset: start,