X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fwebtorrent.ts;h=becad533e22d0e04cedffd2c6659a886c45c5e2b;hb=f645af439669b084dc7ea360751a0e4c1980c81b;hp=0129184687eb6993e09b20a67fa466661f988504;hpb=0d4a3c62ab3036508ba1f38653580af80a4b631e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/webtorrent.ts b/server/helpers/webtorrent.ts index 012918468..becad533e 100644 --- a/server/helpers/webtorrent.ts +++ b/server/helpers/webtorrent.ts @@ -127,14 +127,10 @@ async function updateTorrentUrls (videoOrPlaylist: MVideo | MStreamingPlaylistVi const newTorrentFilename = generateTorrentFileName(videoOrPlaylist, videoFile.resolution) const newTorrentPath = join(CONFIG.STORAGE.TORRENTS_DIR, newTorrentFilename) - logger.info('Updating torrent URLs %s.', newTorrentPath) + logger.info('Updating torrent URLs %s -> %s.', oldTorrentPath, newTorrentPath) await writeFile(newTorrentPath, bencode.encode(decoded)) - - // Remove old torrent file if it existed - if (videoFile.hasTorrent()) { - await remove(join(CONFIG.STORAGE.TORRENTS_DIR, videoFile.torrentFilename)) - } + await remove(join(CONFIG.STORAGE.TORRENTS_DIR, videoFile.torrentFilename)) videoFile.torrentFilename = newTorrentFilename }