diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-11 09:21:13 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-11 09:21:13 +0200 |
commit | 784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428 (patch) | |
tree | 29c46cfd6344065eb805680ed080cb05592ee1d4 /server/lib/job-queue/handlers/move-to-object-storage.ts | |
parent | c3030e944ad03c7fd7b5d668a2d88ff03e4cdf19 (diff) | |
download | PeerTube-784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428.tar.gz PeerTube-784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428.tar.zst PeerTube-784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428.zip |
Prefer web videos in favour of webtorrent
Diffstat (limited to 'server/lib/job-queue/handlers/move-to-object-storage.ts')
-rw-r--r-- | server/lib/job-queue/handlers/move-to-object-storage.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/lib/job-queue/handlers/move-to-object-storage.ts b/server/lib/job-queue/handlers/move-to-object-storage.ts index 26752ff37..9a99b6722 100644 --- a/server/lib/job-queue/handlers/move-to-object-storage.ts +++ b/server/lib/job-queue/handlers/move-to-object-storage.ts | |||
@@ -4,7 +4,7 @@ import { join } from 'path' | |||
4 | import { logger, loggerTagsFactory } from '@server/helpers/logger' | 4 | import { logger, loggerTagsFactory } from '@server/helpers/logger' |
5 | import { updateTorrentMetadata } from '@server/helpers/webtorrent' | 5 | import { updateTorrentMetadata } from '@server/helpers/webtorrent' |
6 | import { P2P_MEDIA_LOADER_PEER_VERSION } from '@server/initializers/constants' | 6 | import { P2P_MEDIA_LOADER_PEER_VERSION } from '@server/initializers/constants' |
7 | import { storeHLSFileFromFilename, storeWebTorrentFile } from '@server/lib/object-storage' | 7 | import { storeHLSFileFromFilename, storeWebVideoFile } from '@server/lib/object-storage' |
8 | import { getHLSDirectory, getHlsResolutionPlaylistFilename } from '@server/lib/paths' | 8 | import { getHLSDirectory, getHlsResolutionPlaylistFilename } from '@server/lib/paths' |
9 | import { VideoPathManager } from '@server/lib/video-path-manager' | 9 | import { VideoPathManager } from '@server/lib/video-path-manager' |
10 | import { moveToFailedMoveToObjectStorageState, moveToNextState } from '@server/lib/video-state' | 10 | import { moveToFailedMoveToObjectStorageState, moveToNextState } from '@server/lib/video-state' |
@@ -33,9 +33,9 @@ export async function processMoveToObjectStorage (job: Job) { | |||
33 | 33 | ||
34 | try { | 34 | try { |
35 | if (video.VideoFiles) { | 35 | if (video.VideoFiles) { |
36 | logger.debug('Moving %d webtorrent files for video %s.', video.VideoFiles.length, video.uuid, lTags) | 36 | logger.debug('Moving %d web video files for video %s.', video.VideoFiles.length, video.uuid, lTags) |
37 | 37 | ||
38 | await moveWebTorrentFiles(video) | 38 | await moveWebVideoFiles(video) |
39 | } | 39 | } |
40 | 40 | ||
41 | if (video.VideoStreamingPlaylists) { | 41 | if (video.VideoStreamingPlaylists) { |
@@ -75,11 +75,11 @@ export async function onMoveToObjectStorageFailure (job: Job, err: any) { | |||
75 | 75 | ||
76 | // --------------------------------------------------------------------------- | 76 | // --------------------------------------------------------------------------- |
77 | 77 | ||
78 | async function moveWebTorrentFiles (video: MVideoWithAllFiles) { | 78 | async function moveWebVideoFiles (video: MVideoWithAllFiles) { |
79 | for (const file of video.VideoFiles) { | 79 | for (const file of video.VideoFiles) { |
80 | if (file.storage !== VideoStorage.FILE_SYSTEM) continue | 80 | if (file.storage !== VideoStorage.FILE_SYSTEM) continue |
81 | 81 | ||
82 | const fileUrl = await storeWebTorrentFile(video, file) | 82 | const fileUrl = await storeWebVideoFile(video, file) |
83 | 83 | ||
84 | const oldPath = VideoPathManager.Instance.getFSVideoFileOutputPath(video, file) | 84 | const oldPath = VideoPathManager.Instance.getFSVideoFileOutputPath(video, file) |
85 | await onFileMoved({ videoOrPlaylist: video, file, fileUrl, oldPath }) | 85 | await onFileMoved({ videoOrPlaylist: video, file, fileUrl, oldPath }) |