From f645af439669b084dc7ea360751a0e4c1980c81b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 18 Aug 2021 09:33:48 +0200 Subject: [PATCH] Remove useless condition --- server/helpers/webtorrent.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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 }