X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fwebtorrent.ts;h=67cb3971d4a685e3d910f584daa30dac71643f5e;hb=85302118227bad232afdebb84a5c245f862366bd;hp=b350c9718784f12c20cb2b282e118c2382d392b0;hpb=9b293cd6a2ce9ed1e1ccd41adbf7f2dbe2da8231;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/webtorrent.ts b/server/helpers/webtorrent.ts index b350c9718..67cb3971d 100644 --- a/server/helpers/webtorrent.ts +++ b/server/helpers/webtorrent.ts @@ -15,6 +15,7 @@ import { MVideoFile, MVideoFileRedundanciesOpt } from '@server/types/models/vide import { MStreamingPlaylistVideo } from '@server/types/models/video/video-streaming-playlist' import { CONFIG } from '../initializers/config' import { promisify2 } from './core-utils' +import { sha1 } from '@shared/core-utils/crypto' import { logger } from './logger' import { generateVideoImportTmpPath } from './utils' import { extractVideo } from './video' @@ -145,6 +146,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 (