From 9cc99d7b569765412c9898cfd5452dba5ee5e4b4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 8 Feb 2017 20:34:01 +0100 Subject: [PATCH] Fix update host script --- scripts/update-host.js | 4 ++-- server/models/video.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/update-host.js b/scripts/update-host.js index 91051e68b..18e35386c 100755 --- a/scripts/update-host.js +++ b/scripts/update-host.js @@ -26,9 +26,9 @@ db.init(true, function () { if (err) throw err videos.forEach(function (video) { - const torrentName = video._id + '.torrent' + const torrentName = video.id + '.torrent' const torrentPath = constants.CONFIG.STORAGE.TORRENTS_DIR + torrentName - const filename = video._id + video.extname + const filename = video.id + video.extname const parsed = parseTorrent(fs.readFileSync(torrentPath)) parsed.announce = [ constants.CONFIG.WEBSERVER.WS + '://' + constants.CONFIG.WEBSERVER.HOST + '/tracker/socket' ] diff --git a/server/models/video.js b/server/models/video.js index 742150d69..d0fd61eb4 100644 --- a/server/models/video.js +++ b/server/models/video.js @@ -414,7 +414,7 @@ function getDurationFromFile (videoPath, callback) { } function list (callback) { - return this.find().asCallback() + return this.findAll().asCallback(callback) } function listForApi (start, count, sort, callback) {