mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-06 03:50:26 +02:00
store uploaded video filename (#4885)
* store uploaded video filename closes #4731 * dont crash if videos channel exist * migration: use raw query * video source: fixes after code review * cleanup * bump migration * updates after code review * refactor: use checkUserCanManageVideo * videoSource: add openapi doc * test(check-params/video-source): fix timeout * Styling * Correctly set original filename as source Co-authored-by: Chocobozzz <me@florianbigard.com>
This commit is contained in:
parent
dec4952155
commit
2e401e8575
25 changed files with 339 additions and 11 deletions
|
@ -26,6 +26,7 @@ import {
|
|||
setDefaultVideosSort,
|
||||
videosCustomGetValidator,
|
||||
videosGetValidator,
|
||||
videoSourceGetValidator,
|
||||
videosRemoveValidator,
|
||||
videosSortValidator
|
||||
} from '../../../middlewares'
|
||||
|
@ -96,6 +97,14 @@ videosRouter.get('/:id/description',
|
|||
asyncMiddleware(videosGetValidator),
|
||||
asyncMiddleware(getVideoDescription)
|
||||
)
|
||||
|
||||
videosRouter.get('/:id/source',
|
||||
openapiOperationDoc({ operationId: 'getVideoSource' }),
|
||||
authenticate,
|
||||
asyncMiddleware(videoSourceGetValidator),
|
||||
getVideoSource
|
||||
)
|
||||
|
||||
videosRouter.get('/:id',
|
||||
openapiOperationDoc({ operationId: 'getVideo' }),
|
||||
optionalAuthenticate,
|
||||
|
@ -155,6 +164,10 @@ async function getVideoDescription (req: express.Request, res: express.Response)
|
|||
return res.json({ description })
|
||||
}
|
||||
|
||||
function getVideoSource (req: express.Request, res: express.Response) {
|
||||
return res.json(res.locals.videoSource.toFormattedJSON())
|
||||
}
|
||||
|
||||
async function listVideos (req: express.Request, res: express.Response) {
|
||||
const serverActor = await getServerActor()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue