X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fvideo.js;h=05c4f51cb2d7211918e71f5c261b605c2d90b51c;hb=2c49ca42d14087ce8e1695759435f796a290470b;hp=4b941a40cf6ee8d11ef8b71b8f30a1fe3fd841bc;hpb=25cad919924faebda48f8741d3e6e0c3e23c6182;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/video.js b/server/models/video.js index 4b941a40c..05c4f51cb 100644 --- a/server/models/video.js +++ b/server/models/video.js @@ -57,7 +57,7 @@ VideoSchema.statics = { getDurationFromFile, listForApi, listByUrlAndMagnet, - listByUrls, + listByUrl, listOwned, listOwnedByAuthor, listRemotes, @@ -94,7 +94,7 @@ VideoSchema.pre('save', function (next) { const tasks = [] if (video.isOwned()) { - const videoPath = pathUtils.join(constants.CONFIG.STORAGE.UPLOAD_DIR, video.filename) + const videoPath = pathUtils.join(constants.CONFIG.STORAGE.VIDEOS_DIR, video.filename) this.podUrl = constants.CONFIG.WEBSERVER.URL tasks.push( @@ -218,8 +218,8 @@ function listByUrlAndMagnet (fromUrl, magnetUri, callback) { this.find({ podUrl: fromUrl, magnetUri: magnetUri }, callback) } -function listByUrls (fromUrls, callback) { - this.find({ podUrl: { $in: fromUrls } }, callback) +function listByUrl (fromUrl, callback) { + this.find({ podUrl: fromUrl }, callback) } function listOwned (callback) { @@ -258,7 +258,7 @@ function removeThumbnail (video, callback) { } function removeFile (video, callback) { - fs.unlink(constants.CONFIG.STORAGE.UPLOAD_DIR + video.filename, callback) + fs.unlink(constants.CONFIG.STORAGE.VIDEOS_DIR + video.filename, callback) } // Maybe the torrent is not seeded, but we catch the error to don't stop the removing process