From 38d69d65012c8bf01bceb672be99f94fe414f275 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 8 Dec 2021 11:32:45 +0100 Subject: Update torrents info name on video update --- server/helpers/webtorrent.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server/helpers/webtorrent.ts') 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' import { MVideoFile, MVideoFileRedundanciesOpt } from '@server/types/models/video/video-file' import { MStreamingPlaylistVideo } from '@server/types/models/video/video-streaming-playlist' import { CONFIG } from '../initializers/config' -import { promisify2 } from './core-utils' +import { promisify2, sha1 } from './core-utils' import { logger } from './logger' import { generateVideoImportTmpPath } from './utils' import { extractVideo } from './video' @@ -145,6 +145,7 @@ async function updateTorrentMetadata (videoOrPlaylist: MVideo | MStreamingPlayli await remove(join(CONFIG.STORAGE.TORRENTS_DIR, videoFile.torrentFilename)) videoFile.torrentFilename = newTorrentFilename + videoFile.infoHash = sha1(encode(decoded.info)) } function generateMagnetUri ( -- cgit v1.2.3