]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/webtorrent.ts
Translated using Weblate (Swedish)
[github/Chocobozzz/PeerTube.git] / server / helpers / webtorrent.ts
index b350c9718784f12c20cb2b282e118c2382d392b0..68d532c48995a2f5efde250c233aec100f800594 100644 (file)
@@ -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 (