mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 10:49:28 +02:00
Implement video file replacement in client
This commit is contained in:
parent
12dc3a942a
commit
f42fcb4b58
26 changed files with 603 additions and 278 deletions
|
@ -14,7 +14,7 @@ import { openapiOperationDoc } from '@server/middlewares/doc'
|
|||
import { VideoModel } from '@server/models/video/video'
|
||||
import { VideoSourceModel } from '@server/models/video/video-source'
|
||||
import { MStreamingPlaylistFiles, MVideo, MVideoFile, MVideoFullLight } from '@server/types/models'
|
||||
import { HttpStatusCode, VideoState } from '@shared/models'
|
||||
import { VideoState } from '@shared/models'
|
||||
import { logger, loggerTagsFactory } from '../../../helpers/logger'
|
||||
import {
|
||||
asyncMiddleware,
|
||||
|
@ -121,7 +121,7 @@ async function replaceVideoSourceResumable (req: express.Request, res: express.R
|
|||
|
||||
await removeOldFiles({ video, files: oldWebVideoFiles, playlists: oldStreamingPlaylists })
|
||||
|
||||
await VideoSourceModel.create({
|
||||
const source = await VideoSourceModel.create({
|
||||
filename: originalFilename,
|
||||
videoId: video.id,
|
||||
createdAt: inputFileUpdatedAt
|
||||
|
@ -135,7 +135,7 @@ async function replaceVideoSourceResumable (req: express.Request, res: express.R
|
|||
|
||||
Hooks.runAction('action:api.video.file-updated', { video, req, res })
|
||||
|
||||
return res.sendStatus(HttpStatusCode.NO_CONTENT_204)
|
||||
return res.json(source.toFormattedJSON())
|
||||
} finally {
|
||||
videoFileMutexReleaser()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue