From 8319d6ae72d4da6de51bd3d4b5c68040fc8dc3b4 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Tue, 10 Mar 2020 14:39:40 +0100 Subject: Add video file metadata to download modal, via ffprobe (#2411) * Add video file metadata via ffprobe * Federate video file metadata * Add tests for file metadata generation * Complete tests for videoFile metadata federation * Lint migration and video-file for metadata * Objectify metadata from getter in ffmpeg-utils * Add metadataUrl to all videoFiles * Simplify metadata API middleware * Load playlist in videoFile when requesting metadata --- shared/extra-utils/videos/videos.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'shared/extra-utils/videos') diff --git a/shared/extra-utils/videos/videos.ts b/shared/extra-utils/videos/videos.ts index 39a06b0d7..0d36a38a2 100644 --- a/shared/extra-utils/videos/videos.ts +++ b/shared/extra-utils/videos/videos.ts @@ -95,6 +95,14 @@ function getVideo (url: string, id: number | string, expectedStatus = 200) { .expect(expectedStatus) } +function getVideoFileMetadataUrl (url: string) { + return request(url) + .get('/') + .set('Accept', 'application/json') + .expect(200) + .expect('Content-Type', /json/) +} + function viewVideo (url: string, id: number | string, expectedStatus = 204, xForwardedFor?: string) { const path = '/api/v1/videos/' + id + '/views' @@ -643,6 +651,7 @@ export { getAccountVideos, getVideoChannelVideos, getVideo, + getVideoFileMetadataUrl, getVideoWithToken, getVideosList, getVideosListPagination, -- cgit v1.2.3