X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fwebtorrent.ts;h=68d532c48995a2f5efde250c233aec100f800594;hb=75eb27a5da5e5d4fdad3c1dfe04e68fdee3b0e49;hp=b350c9718784f12c20cb2b282e118c2382d392b0;hpb=9b293cd6a2ce9ed1e1ccd41adbf7f2dbe2da8231;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/webtorrent.ts b/server/helpers/webtorrent.ts index b350c9718..68d532c48 100644 --- a/server/helpers/webtorrent.ts +++ b/server/helpers/webtorrent.ts @@ -13,6 +13,7 @@ import { VideoPathManager } from '@server/lib/video-path-manager' 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 { sha1 } from '@shared/extra-utils' import { CONFIG } from '../initializers/config' import { promisify2 } from './core-utils' import { logger } from './logger' @@ -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 (