1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Optimize torrent URL update

This commit is contained in:
Chocobozzz 2021-08-18 09:14:51 +02:00
parent 9df52d660f
commit 1f6125be8b
No known key found for this signature in database
GPG key ID: 583A612D890159BE
8 changed files with 74 additions and 20 deletions

View file

@ -2,7 +2,7 @@ import * as Bull from 'bull'
import { remove } from 'fs-extra'
import { join } from 'path'
import { logger } from '@server/helpers/logger'
import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent'
import { updateTorrentUrls } from '@server/helpers/webtorrent'
import { CONFIG } from '@server/initializers/config'
import { storeHLSFile, storeWebTorrentFile } from '@server/lib/object-storage'
import { getHLSDirectory, getHlsResolutionPlaylistFilename } from '@server/lib/paths'
@ -106,7 +106,7 @@ async function onFileMoved (options: {
file.fileUrl = fileUrl
file.storage = VideoStorage.OBJECT_STORAGE
await createTorrentAndSetInfoHash(videoOrPlaylist, file)
await updateTorrentUrls(videoOrPlaylist, file)
await file.save()
logger.debug('Removing %s because it\'s now on object storage', oldPath)