diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-23 11:20:00 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-07-26 11:29:31 +0200 |
commit | 764b1a14fc494f2cfd7ea590d2f07b01df65c7ad (patch) | |
tree | 198ca5f242c63a205a05fa4cfd6d063277c541fd /server/helpers/webtorrent.ts | |
parent | 83903cb65d531a6b6b91715387493ba8312b264d (diff) | |
download | PeerTube-764b1a14fc494f2cfd7ea590d2f07b01df65c7ad.tar.gz PeerTube-764b1a14fc494f2cfd7ea590d2f07b01df65c7ad.tar.zst PeerTube-764b1a14fc494f2cfd7ea590d2f07b01df65c7ad.zip |
Use random names for VOD HLS playlists
Diffstat (limited to 'server/helpers/webtorrent.ts')
-rw-r--r-- | server/helpers/webtorrent.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/helpers/webtorrent.ts b/server/helpers/webtorrent.ts index d8220ba9c..ecf63e93e 100644 --- a/server/helpers/webtorrent.ts +++ b/server/helpers/webtorrent.ts | |||
@@ -103,6 +103,11 @@ async function createTorrentAndSetInfoHash ( | |||
103 | 103 | ||
104 | await writeFile(torrentPath, torrent) | 104 | await writeFile(torrentPath, torrent) |
105 | 105 | ||
106 | // Remove old torrent file if it existed | ||
107 | if (videoFile.hasTorrent()) { | ||
108 | await remove(join(CONFIG.STORAGE.TORRENTS_DIR, videoFile.torrentFilename)) | ||
109 | } | ||
110 | |||
106 | const parsedTorrent = parseTorrent(torrent) | 111 | const parsedTorrent = parseTorrent(torrent) |
107 | videoFile.infoHash = parsedTorrent.infoHash | 112 | videoFile.infoHash = parsedTorrent.infoHash |
108 | videoFile.torrentFilename = torrentFilename | 113 | videoFile.torrentFilename = torrentFilename |