X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Fupdate-host.js;h=8ae0f0d0e400e045f236ea6cb8d009913e5a16b1;hb=7593a21d13baad422efedfb658d7ceda4e0a8c6b;hp=91051e68b400d85e843bce8fe340a8ebb7da516e;hpb=99fe265a5fc077cb66c322e7f3d191ff7110aea0;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/update-host.js b/scripts/update-host.js index 91051e68b..8ae0f0d0e 100755 --- a/scripts/update-host.js +++ b/scripts/update-host.js @@ -2,8 +2,6 @@ 'use strict' -// TODO: document this script - const fs = require('fs') const parseTorrent = require('parse-torrent') @@ -26,9 +24,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' ]