Remove useless condition

This commit is contained in:
Chocobozzz 2021-08-18 09:33:48 +02:00
parent 0d4a3c62ab
commit f645af4396
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 2 additions and 6 deletions

View File

@ -127,14 +127,10 @@ async function updateTorrentUrls (videoOrPlaylist: MVideo | MStreamingPlaylistVi
const newTorrentFilename = generateTorrentFileName(videoOrPlaylist, videoFile.resolution) const newTorrentFilename = generateTorrentFileName(videoOrPlaylist, videoFile.resolution)
const newTorrentPath = join(CONFIG.STORAGE.TORRENTS_DIR, newTorrentFilename) 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)) await writeFile(newTorrentPath, bencode.encode(decoded))
await remove(join(CONFIG.STORAGE.TORRENTS_DIR, videoFile.torrentFilename))
// Remove old torrent file if it existed
if (videoFile.hasTorrent()) {
await remove(join(CONFIG.STORAGE.TORRENTS_DIR, videoFile.torrentFilename))
}
videoFile.torrentFilename = newTorrentFilename videoFile.torrentFilename = newTorrentFilename
} }