diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-08 11:32:45 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-08 16:12:49 +0100 |
commit | 38d69d65012c8bf01bceb672be99f94fe414f275 (patch) | |
tree | 80ba6d43c4ce7ccff0c64d0c0817f43cc02a6531 /server/helpers/webtorrent.ts | |
parent | 9b293cd6a2ce9ed1e1ccd41adbf7f2dbe2da8231 (diff) | |
download | PeerTube-38d69d65012c8bf01bceb672be99f94fe414f275.tar.gz PeerTube-38d69d65012c8bf01bceb672be99f94fe414f275.tar.zst PeerTube-38d69d65012c8bf01bceb672be99f94fe414f275.zip |
Update torrents info name on video update
Diffstat (limited to 'server/helpers/webtorrent.ts')
-rw-r--r-- | server/helpers/webtorrent.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/helpers/webtorrent.ts b/server/helpers/webtorrent.ts index b350c9718..ecc703646 100644 --- a/server/helpers/webtorrent.ts +++ b/server/helpers/webtorrent.ts | |||
@@ -14,7 +14,7 @@ import { MVideo } from '@server/types/models/video/video' | |||
14 | import { MVideoFile, MVideoFileRedundanciesOpt } from '@server/types/models/video/video-file' | 14 | import { MVideoFile, MVideoFileRedundanciesOpt } from '@server/types/models/video/video-file' |
15 | import { MStreamingPlaylistVideo } from '@server/types/models/video/video-streaming-playlist' | 15 | import { MStreamingPlaylistVideo } from '@server/types/models/video/video-streaming-playlist' |
16 | import { CONFIG } from '../initializers/config' | 16 | import { CONFIG } from '../initializers/config' |
17 | import { promisify2 } from './core-utils' | 17 | import { promisify2, sha1 } from './core-utils' |
18 | import { logger } from './logger' | 18 | import { logger } from './logger' |
19 | import { generateVideoImportTmpPath } from './utils' | 19 | import { generateVideoImportTmpPath } from './utils' |
20 | import { extractVideo } from './video' | 20 | import { extractVideo } from './video' |
@@ -145,6 +145,7 @@ async function updateTorrentMetadata (videoOrPlaylist: MVideo | MStreamingPlayli | |||
145 | await remove(join(CONFIG.STORAGE.TORRENTS_DIR, videoFile.torrentFilename)) | 145 | await remove(join(CONFIG.STORAGE.TORRENTS_DIR, videoFile.torrentFilename)) |
146 | 146 | ||
147 | videoFile.torrentFilename = newTorrentFilename | 147 | videoFile.torrentFilename = newTorrentFilename |
148 | videoFile.infoHash = sha1(encode(decoded.info)) | ||
148 | } | 149 | } |
149 | 150 | ||
150 | function generateMagnetUri ( | 151 | function generateMagnetUri ( |