+ it('Should import no HDR version on a HDR video', async function () {
+ this.timeout(120_000)
+
+ const config = {
+ transcoding: {
+ enabled: true,
+ resolutions: {
+ '240p': false,
+ '360p': false,
+ '480p': false,
+ '720p': false,
+ '1080p': true, // the resulting resolution shouldn't be higher than this, and not vp9.2/av01
+ '1440p': false,
+ '2160p': false
+ },
+ webtorrent: { enabled: true },
+ hls: { enabled: false }
+ },
+ import: {
+ videos: {
+ http: {
+ enabled: true
+ },
+ torrent: {
+ enabled: true
+ }
+ }
+ }
+ }
+ await updateCustomSubConfig(servers[0].url, servers[0].accessToken, config)
+
+ const attributes = {
+ name: 'hdr video',
+ targetUrl: getYoutubeHDRVideoUrl(),
+ channelId: channelIdServer1,
+ privacy: VideoPrivacy.PUBLIC
+ }
+ const res1 = await importVideo(servers[0].url, servers[0].accessToken, attributes)
+ const videoUUID = res1.body.video.uuid
+
+ await waitJobs(servers)
+
+ // test resolution
+ const res2 = await getVideo(servers[0].url, videoUUID)
+ const video: VideoDetails = res2.body
+ expect(video.name).to.equal('hdr video')
+ const maxResolution = Math.max.apply(Math, video.files.map(function (o) { return o.resolution.id }))
+ expect(maxResolution, 'expected max resolution not met').to.equals(VideoResolution.H_1080P)
+ })
+