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:
parent
9df52d660f
commit
1f6125be8b
8 changed files with 74 additions and 20 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue