aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-18 09:33:48 +0200
committerChocobozzz <me@florianbigard.com>2021-08-18 09:33:48 +0200
commitf645af439669b084dc7ea360751a0e4c1980c81b (patch)
tree5c6da7363f2563a79f430754f56367a74cda481e
parent0d4a3c62ab3036508ba1f38653580af80a4b631e (diff)
downloadPeerTube-f645af439669b084dc7ea360751a0e4c1980c81b.tar.gz
PeerTube-f645af439669b084dc7ea360751a0e4c1980c81b.tar.zst
PeerTube-f645af439669b084dc7ea360751a0e4c1980c81b.zip
Remove useless condition
-rw-r--r--server/helpers/webtorrent.ts8
1 files 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
127 const newTorrentFilename = generateTorrentFileName(videoOrPlaylist, videoFile.resolution) 127 const newTorrentFilename = generateTorrentFileName(videoOrPlaylist, videoFile.resolution)
128 const newTorrentPath = join(CONFIG.STORAGE.TORRENTS_DIR, newTorrentFilename) 128 const newTorrentPath = join(CONFIG.STORAGE.TORRENTS_DIR, newTorrentFilename)
129 129
130 logger.info('Updating torrent URLs %s.', newTorrentPath) 130 logger.info('Updating torrent URLs %s -> %s.', oldTorrentPath, newTorrentPath)
131 131
132 await writeFile(newTorrentPath, bencode.encode(decoded)) 132 await writeFile(newTorrentPath, bencode.encode(decoded))
133 133 await remove(join(CONFIG.STORAGE.TORRENTS_DIR, videoFile.torrentFilename))
134 // Remove old torrent file if it existed
135 if (videoFile.hasTorrent()) {
136 await remove(join(CONFIG.STORAGE.TORRENTS_DIR, videoFile.torrentFilename))
137 }
138 134
139 videoFile.torrentFilename = newTorrentFilename 135 videoFile.torrentFilename = newTorrentFilename
140} 136}