From: Chocobozzz Date: Wed, 8 Feb 2017 19:34:01 +0000 (+0100) Subject: Fix update host script X-Git-Tag: v0.0.1-alpha~533 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9cc99d7b569765412c9898cfd5452dba5ee5e4b4;p=oweals%2Fpeertube.git Fix update host script --- 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) {