Fix HLS generation after import script
This commit is contained in:
parent
d1a2ce5ef3
commit
69eddafb17
|
@ -23,10 +23,21 @@ async function processVideoFileImport (job: Bull.Job) {
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const data = await getVideoFileResolution(payload.filePath)
|
||||||
|
|
||||||
await updateVideoFile(video, payload.filePath)
|
await updateVideoFile(video, payload.filePath)
|
||||||
|
|
||||||
const user = await UserModel.loadByChannelActorId(video.VideoChannel.actorId)
|
const user = await UserModel.loadByChannelActorId(video.VideoChannel.actorId)
|
||||||
await onNewWebTorrentFileResolution(video, user)
|
|
||||||
|
const newResolutionPayload = {
|
||||||
|
type: 'new-resolution-to-webtorrent' as 'new-resolution-to-webtorrent',
|
||||||
|
videoUUID: video.uuid,
|
||||||
|
resolution: data.videoFileResolution,
|
||||||
|
isPortraitMode: data.isPortraitMode,
|
||||||
|
copyCodecs: false,
|
||||||
|
isNewVideo: false
|
||||||
|
}
|
||||||
|
await onNewWebTorrentFileResolution(video, user, newResolutionPayload)
|
||||||
|
|
||||||
return video
|
return video
|
||||||
}
|
}
|
||||||
|
|
|
@ -189,7 +189,7 @@ async function onVideoFileOptimizer (
|
||||||
async function onNewWebTorrentFileResolution (
|
async function onNewWebTorrentFileResolution (
|
||||||
video: MVideoUUID,
|
video: MVideoUUID,
|
||||||
user: MUserId,
|
user: MUserId,
|
||||||
payload?: NewResolutionTranscodingPayload | MergeAudioTranscodingPayload
|
payload: NewResolutionTranscodingPayload | MergeAudioTranscodingPayload
|
||||||
) {
|
) {
|
||||||
await publishAndFederateIfNeeded(video)
|
await publishAndFederateIfNeeded(video)
|
||||||
|
|
||||||
|
|
|
@ -334,9 +334,9 @@ async function generateHlsPlaylistCommon (options: {
|
||||||
|
|
||||||
// Move playlist file
|
// Move playlist file
|
||||||
const playlistPath = join(baseHlsDirectory, playlistFilename)
|
const playlistPath = join(baseHlsDirectory, playlistFilename)
|
||||||
await move(playlistFileTranscodePath, playlistPath)
|
await move(playlistFileTranscodePath, playlistPath, { overwrite: true })
|
||||||
// Move video file
|
// Move video file
|
||||||
await move(join(videoTranscodedBasePath, videoFilename), videoFilePath)
|
await move(join(videoTranscodedBasePath, videoFilename), videoFilePath, { overwrite: true })
|
||||||
// Cleanup directory
|
// Cleanup directory
|
||||||
await remove(videoTranscodedBasePath)
|
await remove(videoTranscodedBasePath)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue