diff options
author | kontrollanten <6680299+kontrollanten@users.noreply.github.com> | 2021-11-09 11:05:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-09 11:05:35 +0100 |
commit | e1ab52d7ec7370a6f9f5937192d6003206af1ac0 (patch) | |
tree | aecc8b696b0021e073fd205dd6e126fb4f178e8f /server/lib/hls.ts | |
parent | c49c366ac320fe5ac3dc08f5891fe5898c1b34e3 (diff) | |
download | PeerTube-e1ab52d7ec7370a6f9f5937192d6003206af1ac0.tar.gz PeerTube-e1ab52d7ec7370a6f9f5937192d6003206af1ac0.tar.zst PeerTube-e1ab52d7ec7370a6f9f5937192d6003206af1ac0.zip |
Add migrate-to-object-storage script (#4481)
* add migrate-to-object-storage-script
closes #4467
* add migrate-to-unique-playlist-filenames script
* fix(migrate-to-unique-playlist-filenames): update master/segments256
run updateMasterHLSPlaylist and updateSha256VODSegments after
file rename.
* Improve move to object storage scripts
* PR remarks
Co-authored-by: Chocobozzz <me@florianbigard.com>
Diffstat (limited to 'server/lib/hls.ts')
-rw-r--r-- | server/lib/hls.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/hls.ts b/server/lib/hls.ts index 0828a2d0f..8160e7949 100644 --- a/server/lib/hls.ts +++ b/server/lib/hls.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { close, ensureDir, move, open, outputJSON, read, readFile, remove, stat, writeFile } from 'fs-extra' | 1 | import { close, ensureDir, move, open, outputJSON, read, readFile, remove, stat, writeFile } from 'fs-extra' |
2 | import { flatten, uniq } from 'lodash' | 2 | import { flatten, uniq } from 'lodash' |
3 | import { basename, dirname, join } from 'path' | 3 | import { basename, dirname, join } from 'path' |
4 | import { MStreamingPlaylistFilesVideo, MVideoWithFile } from '@server/types/models' | 4 | import { MStreamingPlaylistFilesVideo, MVideo, MVideoUUID } from '@server/types/models' |
5 | import { sha256 } from '../helpers/core-utils' | 5 | import { sha256 } from '../helpers/core-utils' |
6 | import { getAudioStreamCodec, getVideoStreamCodec, getVideoStreamSize } from '../helpers/ffprobe-utils' | 6 | import { getAudioStreamCodec, getVideoStreamCodec, getVideoStreamSize } from '../helpers/ffprobe-utils' |
7 | import { logger } from '../helpers/logger' | 7 | import { logger } from '../helpers/logger' |
@@ -31,7 +31,7 @@ async function updateStreamingPlaylistsInfohashesIfNeeded () { | |||
31 | } | 31 | } |
32 | } | 32 | } |
33 | 33 | ||
34 | async function updateMasterHLSPlaylist (video: MVideoWithFile, playlist: MStreamingPlaylistFilesVideo) { | 34 | async function updateMasterHLSPlaylist (video: MVideo, playlist: MStreamingPlaylistFilesVideo) { |
35 | const masterPlaylists: string[] = [ '#EXTM3U', '#EXT-X-VERSION:3' ] | 35 | const masterPlaylists: string[] = [ '#EXTM3U', '#EXT-X-VERSION:3' ] |
36 | 36 | ||
37 | for (const file of playlist.VideoFiles) { | 37 | for (const file of playlist.VideoFiles) { |
@@ -63,7 +63,7 @@ async function updateMasterHLSPlaylist (video: MVideoWithFile, playlist: MStream | |||
63 | }) | 63 | }) |
64 | } | 64 | } |
65 | 65 | ||
66 | async function updateSha256VODSegments (video: MVideoWithFile, playlist: MStreamingPlaylistFilesVideo) { | 66 | async function updateSha256VODSegments (video: MVideoUUID, playlist: MStreamingPlaylistFilesVideo) { |
67 | const json: { [filename: string]: { [range: string]: string } } = {} | 67 | const json: { [filename: string]: { [range: string]: string } } = {} |
68 | 68 | ||
69 | // For all the resolutions available for this video | 69 | // For all the resolutions available for this video |