diff options
Diffstat (limited to 'server/tests')
21 files changed, 177 insertions, 189 deletions
diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts index 3c752cc3e..7f825f79e 100644 --- a/server/tests/api/check-params/config.ts +++ b/server/tests/api/check-params/config.ts | |||
@@ -345,7 +345,7 @@ describe('Test config API validators', function () { | |||
345 | }) | 345 | }) |
346 | }) | 346 | }) |
347 | 347 | ||
348 | it('Should fail with a disabled webtorrent & hls transcoding', async function () { | 348 | it('Should fail with a disabled web videos & hls transcoding', async function () { |
349 | const newUpdateParams = { | 349 | const newUpdateParams = { |
350 | ...updateParams, | 350 | ...updateParams, |
351 | 351 | ||
diff --git a/server/tests/api/check-params/transcoding.ts b/server/tests/api/check-params/transcoding.ts index 9846ac182..4bebcb528 100644 --- a/server/tests/api/check-params/transcoding.ts +++ b/server/tests/api/check-params/transcoding.ts | |||
@@ -49,21 +49,21 @@ describe('Test transcoding API validators', function () { | |||
49 | 49 | ||
50 | it('Should not run transcoding of a unknown video', async function () { | 50 | it('Should not run transcoding of a unknown video', async function () { |
51 | await servers[0].videos.runTranscoding({ videoId: 404, transcodingType: 'hls', expectedStatus: HttpStatusCode.NOT_FOUND_404 }) | 51 | await servers[0].videos.runTranscoding({ videoId: 404, transcodingType: 'hls', expectedStatus: HttpStatusCode.NOT_FOUND_404 }) |
52 | await servers[0].videos.runTranscoding({ videoId: 404, transcodingType: 'webtorrent', expectedStatus: HttpStatusCode.NOT_FOUND_404 }) | 52 | await servers[0].videos.runTranscoding({ videoId: 404, transcodingType: 'web-video', expectedStatus: HttpStatusCode.NOT_FOUND_404 }) |
53 | }) | 53 | }) |
54 | 54 | ||
55 | it('Should not run transcoding of a remote video', async function () { | 55 | it('Should not run transcoding of a remote video', async function () { |
56 | const expectedStatus = HttpStatusCode.BAD_REQUEST_400 | 56 | const expectedStatus = HttpStatusCode.BAD_REQUEST_400 |
57 | 57 | ||
58 | await servers[0].videos.runTranscoding({ videoId: remoteId, transcodingType: 'hls', expectedStatus }) | 58 | await servers[0].videos.runTranscoding({ videoId: remoteId, transcodingType: 'hls', expectedStatus }) |
59 | await servers[0].videos.runTranscoding({ videoId: remoteId, transcodingType: 'webtorrent', expectedStatus }) | 59 | await servers[0].videos.runTranscoding({ videoId: remoteId, transcodingType: 'web-video', expectedStatus }) |
60 | }) | 60 | }) |
61 | 61 | ||
62 | it('Should not run transcoding by a non admin user', async function () { | 62 | it('Should not run transcoding by a non admin user', async function () { |
63 | const expectedStatus = HttpStatusCode.FORBIDDEN_403 | 63 | const expectedStatus = HttpStatusCode.FORBIDDEN_403 |
64 | 64 | ||
65 | await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'hls', token: userToken, expectedStatus }) | 65 | await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'hls', token: userToken, expectedStatus }) |
66 | await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'webtorrent', token: moderatorToken, expectedStatus }) | 66 | await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'web-video', token: moderatorToken, expectedStatus }) |
67 | }) | 67 | }) |
68 | 68 | ||
69 | it('Should not run transcoding without transcoding type', async function () { | 69 | it('Should not run transcoding without transcoding type', async function () { |
@@ -82,7 +82,7 @@ describe('Test transcoding API validators', function () { | |||
82 | await servers[0].config.disableTranscoding() | 82 | await servers[0].config.disableTranscoding() |
83 | 83 | ||
84 | await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'hls', expectedStatus }) | 84 | await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'hls', expectedStatus }) |
85 | await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'webtorrent', expectedStatus }) | 85 | await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'web-video', expectedStatus }) |
86 | }) | 86 | }) |
87 | 87 | ||
88 | it('Should run transcoding', async function () { | 88 | it('Should run transcoding', async function () { |
@@ -93,15 +93,15 @@ describe('Test transcoding API validators', function () { | |||
93 | await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'hls' }) | 93 | await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'hls' }) |
94 | await waitJobs(servers) | 94 | await waitJobs(servers) |
95 | 95 | ||
96 | await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'webtorrent' }) | 96 | await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'web-video' }) |
97 | await waitJobs(servers) | 97 | await waitJobs(servers) |
98 | }) | 98 | }) |
99 | 99 | ||
100 | it('Should not run transcoding on a video that is already being transcoded', async function () { | 100 | it('Should not run transcoding on a video that is already being transcoded', async function () { |
101 | await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'webtorrent' }) | 101 | await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'web-video' }) |
102 | 102 | ||
103 | const expectedStatus = HttpStatusCode.CONFLICT_409 | 103 | const expectedStatus = HttpStatusCode.CONFLICT_409 |
104 | await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'webtorrent', expectedStatus }) | 104 | await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'web-video', expectedStatus }) |
105 | }) | 105 | }) |
106 | 106 | ||
107 | after(async function () { | 107 | after(async function () { |
diff --git a/server/tests/api/check-params/video-files.ts b/server/tests/api/check-params/video-files.ts index 9dc59a1b5..4d43ab6f8 100644 --- a/server/tests/api/check-params/video-files.ts +++ b/server/tests/api/check-params/video-files.ts | |||
@@ -60,7 +60,7 @@ describe('Test videos files', function () { | |||
60 | }) | 60 | }) |
61 | 61 | ||
62 | describe('Deleting files', function () { | 62 | describe('Deleting files', function () { |
63 | let webtorrentId: string | 63 | let webVideoId: string |
64 | let hlsId: string | 64 | let hlsId: string |
65 | let remoteId: string | 65 | let remoteId: string |
66 | 66 | ||
@@ -68,10 +68,10 @@ describe('Test videos files', function () { | |||
68 | let validId2: string | 68 | let validId2: string |
69 | 69 | ||
70 | let hlsFileId: number | 70 | let hlsFileId: number |
71 | let webtorrentFileId: number | 71 | let webVideoFileId: number |
72 | 72 | ||
73 | let remoteHLSFileId: number | 73 | let remoteHLSFileId: number |
74 | let remoteWebtorrentFileId: number | 74 | let remoteWebVideoFileId: number |
75 | 75 | ||
76 | before(async function () { | 76 | before(async function () { |
77 | this.timeout(300_000) | 77 | this.timeout(300_000) |
@@ -83,7 +83,7 @@ describe('Test videos files', function () { | |||
83 | const video = await servers[1].videos.get({ id: uuid }) | 83 | const video = await servers[1].videos.get({ id: uuid }) |
84 | remoteId = video.uuid | 84 | remoteId = video.uuid |
85 | remoteHLSFileId = video.streamingPlaylists[0].files[0].id | 85 | remoteHLSFileId = video.streamingPlaylists[0].files[0].id |
86 | remoteWebtorrentFileId = video.files[0].id | 86 | remoteWebVideoFileId = video.files[0].id |
87 | } | 87 | } |
88 | 88 | ||
89 | { | 89 | { |
@@ -96,7 +96,7 @@ describe('Test videos files', function () { | |||
96 | const video = await servers[0].videos.get({ id: uuid }) | 96 | const video = await servers[0].videos.get({ id: uuid }) |
97 | validId1 = video.uuid | 97 | validId1 = video.uuid |
98 | hlsFileId = video.streamingPlaylists[0].files[0].id | 98 | hlsFileId = video.streamingPlaylists[0].files[0].id |
99 | webtorrentFileId = video.files[0].id | 99 | webVideoFileId = video.files[0].id |
100 | } | 100 | } |
101 | 101 | ||
102 | { | 102 | { |
@@ -117,8 +117,8 @@ describe('Test videos files', function () { | |||
117 | 117 | ||
118 | { | 118 | { |
119 | await servers[0].config.enableTranscoding(false, true) | 119 | await servers[0].config.enableTranscoding(false, true) |
120 | const { uuid } = await servers[0].videos.quickUpload({ name: 'webtorrent' }) | 120 | const { uuid } = await servers[0].videos.quickUpload({ name: 'web-video' }) |
121 | webtorrentId = uuid | 121 | webVideoId = uuid |
122 | } | 122 | } |
123 | 123 | ||
124 | await waitJobs(servers) | 124 | await waitJobs(servers) |
@@ -128,27 +128,27 @@ describe('Test videos files', function () { | |||
128 | const expectedStatus = HttpStatusCode.NOT_FOUND_404 | 128 | const expectedStatus = HttpStatusCode.NOT_FOUND_404 |
129 | 129 | ||
130 | await servers[0].videos.removeHLSPlaylist({ videoId: 404, expectedStatus }) | 130 | await servers[0].videos.removeHLSPlaylist({ videoId: 404, expectedStatus }) |
131 | await servers[0].videos.removeAllWebTorrentFiles({ videoId: 404, expectedStatus }) | 131 | await servers[0].videos.removeAllWebVideoFiles({ videoId: 404, expectedStatus }) |
132 | 132 | ||
133 | await servers[0].videos.removeHLSFile({ videoId: 404, fileId: hlsFileId, expectedStatus }) | 133 | await servers[0].videos.removeHLSFile({ videoId: 404, fileId: hlsFileId, expectedStatus }) |
134 | await servers[0].videos.removeWebTorrentFile({ videoId: 404, fileId: webtorrentFileId, expectedStatus }) | 134 | await servers[0].videos.removeWebVideoFile({ videoId: 404, fileId: webVideoFileId, expectedStatus }) |
135 | }) | 135 | }) |
136 | 136 | ||
137 | it('Should not delete unknown files', async function () { | 137 | it('Should not delete unknown files', async function () { |
138 | const expectedStatus = HttpStatusCode.NOT_FOUND_404 | 138 | const expectedStatus = HttpStatusCode.NOT_FOUND_404 |
139 | 139 | ||
140 | await servers[0].videos.removeHLSFile({ videoId: validId1, fileId: webtorrentFileId, expectedStatus }) | 140 | await servers[0].videos.removeHLSFile({ videoId: validId1, fileId: webVideoFileId, expectedStatus }) |
141 | await servers[0].videos.removeWebTorrentFile({ videoId: validId1, fileId: hlsFileId, expectedStatus }) | 141 | await servers[0].videos.removeWebVideoFile({ videoId: validId1, fileId: hlsFileId, expectedStatus }) |
142 | }) | 142 | }) |
143 | 143 | ||
144 | it('Should not delete files of a remote video', async function () { | 144 | it('Should not delete files of a remote video', async function () { |
145 | const expectedStatus = HttpStatusCode.BAD_REQUEST_400 | 145 | const expectedStatus = HttpStatusCode.BAD_REQUEST_400 |
146 | 146 | ||
147 | await servers[0].videos.removeHLSPlaylist({ videoId: remoteId, expectedStatus }) | 147 | await servers[0].videos.removeHLSPlaylist({ videoId: remoteId, expectedStatus }) |
148 | await servers[0].videos.removeAllWebTorrentFiles({ videoId: remoteId, expectedStatus }) | 148 | await servers[0].videos.removeAllWebVideoFiles({ videoId: remoteId, expectedStatus }) |
149 | 149 | ||
150 | await servers[0].videos.removeHLSFile({ videoId: remoteId, fileId: remoteHLSFileId, expectedStatus }) | 150 | await servers[0].videos.removeHLSFile({ videoId: remoteId, fileId: remoteHLSFileId, expectedStatus }) |
151 | await servers[0].videos.removeWebTorrentFile({ videoId: remoteId, fileId: remoteWebtorrentFileId, expectedStatus }) | 151 | await servers[0].videos.removeWebVideoFile({ videoId: remoteId, fileId: remoteWebVideoFileId, expectedStatus }) |
152 | }) | 152 | }) |
153 | 153 | ||
154 | it('Should not delete files by a non admin user', async function () { | 154 | it('Should not delete files by a non admin user', async function () { |
@@ -157,35 +157,35 @@ describe('Test videos files', function () { | |||
157 | await servers[0].videos.removeHLSPlaylist({ videoId: validId1, token: userToken, expectedStatus }) | 157 | await servers[0].videos.removeHLSPlaylist({ videoId: validId1, token: userToken, expectedStatus }) |
158 | await servers[0].videos.removeHLSPlaylist({ videoId: validId1, token: moderatorToken, expectedStatus }) | 158 | await servers[0].videos.removeHLSPlaylist({ videoId: validId1, token: moderatorToken, expectedStatus }) |
159 | 159 | ||
160 | await servers[0].videos.removeAllWebTorrentFiles({ videoId: validId1, token: userToken, expectedStatus }) | 160 | await servers[0].videos.removeAllWebVideoFiles({ videoId: validId1, token: userToken, expectedStatus }) |
161 | await servers[0].videos.removeAllWebTorrentFiles({ videoId: validId1, token: moderatorToken, expectedStatus }) | 161 | await servers[0].videos.removeAllWebVideoFiles({ videoId: validId1, token: moderatorToken, expectedStatus }) |
162 | 162 | ||
163 | await servers[0].videos.removeHLSFile({ videoId: validId1, fileId: hlsFileId, token: userToken, expectedStatus }) | 163 | await servers[0].videos.removeHLSFile({ videoId: validId1, fileId: hlsFileId, token: userToken, expectedStatus }) |
164 | await servers[0].videos.removeHLSFile({ videoId: validId1, fileId: hlsFileId, token: moderatorToken, expectedStatus }) | 164 | await servers[0].videos.removeHLSFile({ videoId: validId1, fileId: hlsFileId, token: moderatorToken, expectedStatus }) |
165 | 165 | ||
166 | await servers[0].videos.removeWebTorrentFile({ videoId: validId1, fileId: webtorrentFileId, token: userToken, expectedStatus }) | 166 | await servers[0].videos.removeWebVideoFile({ videoId: validId1, fileId: webVideoFileId, token: userToken, expectedStatus }) |
167 | await servers[0].videos.removeWebTorrentFile({ videoId: validId1, fileId: webtorrentFileId, token: moderatorToken, expectedStatus }) | 167 | await servers[0].videos.removeWebVideoFile({ videoId: validId1, fileId: webVideoFileId, token: moderatorToken, expectedStatus }) |
168 | }) | 168 | }) |
169 | 169 | ||
170 | it('Should not delete files if the files are not available', async function () { | 170 | it('Should not delete files if the files are not available', async function () { |
171 | await servers[0].videos.removeHLSPlaylist({ videoId: hlsId, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) | 171 | await servers[0].videos.removeHLSPlaylist({ videoId: hlsId, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) |
172 | await servers[0].videos.removeAllWebTorrentFiles({ videoId: webtorrentId, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) | 172 | await servers[0].videos.removeAllWebVideoFiles({ videoId: webVideoId, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) |
173 | 173 | ||
174 | await servers[0].videos.removeHLSFile({ videoId: hlsId, fileId: 404, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) | 174 | await servers[0].videos.removeHLSFile({ videoId: hlsId, fileId: 404, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) |
175 | await servers[0].videos.removeWebTorrentFile({ videoId: webtorrentId, fileId: 404, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) | 175 | await servers[0].videos.removeWebVideoFile({ videoId: webVideoId, fileId: 404, expectedStatus: HttpStatusCode.NOT_FOUND_404 }) |
176 | }) | 176 | }) |
177 | 177 | ||
178 | it('Should not delete files if no both versions are available', async function () { | 178 | it('Should not delete files if no both versions are available', async function () { |
179 | await servers[0].videos.removeHLSPlaylist({ videoId: hlsId, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) | 179 | await servers[0].videos.removeHLSPlaylist({ videoId: hlsId, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) |
180 | await servers[0].videos.removeAllWebTorrentFiles({ videoId: webtorrentId, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) | 180 | await servers[0].videos.removeAllWebVideoFiles({ videoId: webVideoId, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) |
181 | }) | 181 | }) |
182 | 182 | ||
183 | it('Should delete files if both versions are available', async function () { | 183 | it('Should delete files if both versions are available', async function () { |
184 | await servers[0].videos.removeHLSFile({ videoId: validId1, fileId: hlsFileId }) | 184 | await servers[0].videos.removeHLSFile({ videoId: validId1, fileId: hlsFileId }) |
185 | await servers[0].videos.removeWebTorrentFile({ videoId: validId1, fileId: webtorrentFileId }) | 185 | await servers[0].videos.removeWebVideoFile({ videoId: validId1, fileId: webVideoFileId }) |
186 | 186 | ||
187 | await servers[0].videos.removeHLSPlaylist({ videoId: validId1 }) | 187 | await servers[0].videos.removeHLSPlaylist({ videoId: validId1 }) |
188 | await servers[0].videos.removeAllWebTorrentFiles({ videoId: validId2 }) | 188 | await servers[0].videos.removeAllWebVideoFiles({ videoId: validId2 }) |
189 | }) | 189 | }) |
190 | }) | 190 | }) |
191 | 191 | ||
diff --git a/server/tests/api/object-storage/video-static-file-privacy.ts b/server/tests/api/object-storage/video-static-file-privacy.ts index 2a7c3381d..18d30a2f5 100644 --- a/server/tests/api/object-storage/video-static-file-privacy.ts +++ b/server/tests/api/object-storage/video-static-file-privacy.ts | |||
@@ -120,7 +120,7 @@ describe('Object storage for video static file privacy', function () { | |||
120 | const video = await server.videos.getWithToken({ id: videoId }) | 120 | const video = await server.videos.getWithToken({ id: videoId }) |
121 | 121 | ||
122 | return { | 122 | return { |
123 | webTorrentFile: video.files[0].fileUrl, | 123 | webVideoFile: video.files[0].fileUrl, |
124 | hlsFile: getHLS(video).files[0].fileUrl | 124 | hlsFile: getHLS(video).files[0].fileUrl |
125 | } | 125 | } |
126 | } | 126 | } |
@@ -175,10 +175,10 @@ describe('Object storage for video static file privacy', function () { | |||
175 | it('Should not get files without appropriate OAuth token', async function () { | 175 | it('Should not get files without appropriate OAuth token', async function () { |
176 | this.timeout(60000) | 176 | this.timeout(60000) |
177 | 177 | ||
178 | const { webTorrentFile, hlsFile } = await getSampleFileUrls(privateVideoUUID) | 178 | const { webVideoFile, hlsFile } = await getSampleFileUrls(privateVideoUUID) |
179 | 179 | ||
180 | await makeRawRequest({ url: webTorrentFile, token: userToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) | 180 | await makeRawRequest({ url: webVideoFile, token: userToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) |
181 | await makeRawRequest({ url: webTorrentFile, token: server.accessToken, expectedStatus: HttpStatusCode.OK_200 }) | 181 | await makeRawRequest({ url: webVideoFile, token: server.accessToken, expectedStatus: HttpStatusCode.OK_200 }) |
182 | 182 | ||
183 | await makeRawRequest({ url: hlsFile, token: userToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) | 183 | await makeRawRequest({ url: hlsFile, token: userToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) |
184 | await makeRawRequest({ url: hlsFile, token: server.accessToken, expectedStatus: HttpStatusCode.OK_200 }) | 184 | await makeRawRequest({ url: hlsFile, token: server.accessToken, expectedStatus: HttpStatusCode.OK_200 }) |
@@ -187,18 +187,18 @@ describe('Object storage for video static file privacy', function () { | |||
187 | it('Should not get files without appropriate password or appropriate OAuth token', async function () { | 187 | it('Should not get files without appropriate password or appropriate OAuth token', async function () { |
188 | this.timeout(60000) | 188 | this.timeout(60000) |
189 | 189 | ||
190 | const { webTorrentFile, hlsFile } = await getSampleFileUrls(passwordProtectedVideoUUID) | 190 | const { webVideoFile, hlsFile } = await getSampleFileUrls(passwordProtectedVideoUUID) |
191 | 191 | ||
192 | await makeRawRequest({ url: webTorrentFile, token: userToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) | 192 | await makeRawRequest({ url: webVideoFile, token: userToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) |
193 | await makeRawRequest({ | 193 | await makeRawRequest({ |
194 | url: webTorrentFile, | 194 | url: webVideoFile, |
195 | token: null, | 195 | token: null, |
196 | headers: incorrectPasswordHeader, | 196 | headers: incorrectPasswordHeader, |
197 | expectedStatus: HttpStatusCode.FORBIDDEN_403 | 197 | expectedStatus: HttpStatusCode.FORBIDDEN_403 |
198 | }) | 198 | }) |
199 | await makeRawRequest({ url: webTorrentFile, token: server.accessToken, expectedStatus: HttpStatusCode.OK_200 }) | 199 | await makeRawRequest({ url: webVideoFile, token: server.accessToken, expectedStatus: HttpStatusCode.OK_200 }) |
200 | await makeRawRequest({ | 200 | await makeRawRequest({ |
201 | url: webTorrentFile, | 201 | url: webVideoFile, |
202 | token: null, | 202 | token: null, |
203 | headers: correctPasswordHeader, | 203 | headers: correctPasswordHeader, |
204 | expectedStatus: HttpStatusCode.OK_200 | 204 | expectedStatus: HttpStatusCode.OK_200 |
@@ -239,9 +239,9 @@ describe('Object storage for video static file privacy', function () { | |||
239 | const badVideoFileToken = await server.videoToken.getVideoFileToken({ token: userToken, videoId: userPrivateVideoUUID }) | 239 | const badVideoFileToken = await server.videoToken.getVideoFileToken({ token: userToken, videoId: userPrivateVideoUUID }) |
240 | const goodVideoFileToken = await server.videoToken.getVideoFileToken({ videoId: privateVideoUUID }) | 240 | const goodVideoFileToken = await server.videoToken.getVideoFileToken({ videoId: privateVideoUUID }) |
241 | 241 | ||
242 | const { webTorrentFile, hlsFile } = await getSampleFileUrls(privateVideoUUID) | 242 | const { webVideoFile, hlsFile } = await getSampleFileUrls(privateVideoUUID) |
243 | 243 | ||
244 | for (const url of [ webTorrentFile, hlsFile ]) { | 244 | for (const url of [ webVideoFile, hlsFile ]) { |
245 | await makeRawRequest({ url, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) | 245 | await makeRawRequest({ url, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) |
246 | await makeRawRequest({ url, token: userToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) | 246 | await makeRawRequest({ url, token: userToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) |
247 | await makeRawRequest({ url, token: server.accessToken, expectedStatus: HttpStatusCode.OK_200 }) | 247 | await makeRawRequest({ url, token: server.accessToken, expectedStatus: HttpStatusCode.OK_200 }) |
@@ -261,9 +261,9 @@ describe('Object storage for video static file privacy', function () { | |||
261 | videoPassword: correctPassword | 261 | videoPassword: correctPassword |
262 | }) | 262 | }) |
263 | 263 | ||
264 | const { webTorrentFile, hlsFile } = await getSampleFileUrls(passwordProtectedVideoUUID) | 264 | const { webVideoFile, hlsFile } = await getSampleFileUrls(passwordProtectedVideoUUID) |
265 | 265 | ||
266 | for (const url of [ hlsFile, webTorrentFile ]) { | 266 | for (const url of [ hlsFile, webVideoFile ]) { |
267 | await makeRawRequest({ url, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) | 267 | await makeRawRequest({ url, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) |
268 | await makeRawRequest({ url, token: userToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) | 268 | await makeRawRequest({ url, token: userToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) |
269 | await makeRawRequest({ url, token: server.accessToken, expectedStatus: HttpStatusCode.OK_200 }) | 269 | await makeRawRequest({ url, token: server.accessToken, expectedStatus: HttpStatusCode.OK_200 }) |
@@ -534,11 +534,11 @@ describe('Object storage for video static file privacy', function () { | |||
534 | 534 | ||
535 | it('Should not be able to access object storage proxy', async function () { | 535 | it('Should not be able to access object storage proxy', async function () { |
536 | const privateVideo = await server.videos.getWithToken({ id: videoUUID }) | 536 | const privateVideo = await server.videos.getWithToken({ id: videoUUID }) |
537 | const webtorrentFilename = extractFilenameFromUrl(privateVideo.files[0].fileUrl) | 537 | const webVideoFilename = extractFilenameFromUrl(privateVideo.files[0].fileUrl) |
538 | const hlsFilename = extractFilenameFromUrl(getHLS(privateVideo).files[0].fileUrl) | 538 | const hlsFilename = extractFilenameFromUrl(getHLS(privateVideo).files[0].fileUrl) |
539 | 539 | ||
540 | await makeRawRequest({ | 540 | await makeRawRequest({ |
541 | url: server.url + '/object-storage-proxy/webseed/private/' + webtorrentFilename, | 541 | url: server.url + '/object-storage-proxy/webseed/private/' + webVideoFilename, |
542 | token: server.accessToken, | 542 | token: server.accessToken, |
543 | expectedStatus: HttpStatusCode.BAD_REQUEST_400 | 543 | expectedStatus: HttpStatusCode.BAD_REQUEST_400 |
544 | }) | 544 | }) |
diff --git a/server/tests/api/object-storage/videos.ts b/server/tests/api/object-storage/videos.ts index f837d9966..c4f72bbe4 100644 --- a/server/tests/api/object-storage/videos.ts +++ b/server/tests/api/object-storage/videos.ts | |||
@@ -41,8 +41,8 @@ async function checkFiles (options: { | |||
41 | playlistBucket: string | 41 | playlistBucket: string |
42 | playlistPrefix?: string | 42 | playlistPrefix?: string |
43 | 43 | ||
44 | webtorrentBucket: string | 44 | webVideoBucket: string |
45 | webtorrentPrefix?: string | 45 | webVideoPrefix?: string |
46 | }) { | 46 | }) { |
47 | const { | 47 | const { |
48 | server, | 48 | server, |
@@ -50,20 +50,20 @@ async function checkFiles (options: { | |||
50 | originSQLCommand, | 50 | originSQLCommand, |
51 | video, | 51 | video, |
52 | playlistBucket, | 52 | playlistBucket, |
53 | webtorrentBucket, | 53 | webVideoBucket, |
54 | baseMockUrl, | 54 | baseMockUrl, |
55 | playlistPrefix, | 55 | playlistPrefix, |
56 | webtorrentPrefix | 56 | webVideoPrefix |
57 | } = options | 57 | } = options |
58 | 58 | ||
59 | let allFiles = video.files | 59 | let allFiles = video.files |
60 | 60 | ||
61 | for (const file of video.files) { | 61 | for (const file of video.files) { |
62 | const baseUrl = baseMockUrl | 62 | const baseUrl = baseMockUrl |
63 | ? `${baseMockUrl}/${webtorrentBucket}/` | 63 | ? `${baseMockUrl}/${webVideoBucket}/` |
64 | : `http://${webtorrentBucket}.${ObjectStorageCommand.getMockEndpointHost()}/` | 64 | : `http://${webVideoBucket}.${ObjectStorageCommand.getMockEndpointHost()}/` |
65 | 65 | ||
66 | const prefix = webtorrentPrefix || '' | 66 | const prefix = webVideoPrefix || '' |
67 | const start = baseUrl + prefix | 67 | const start = baseUrl + prefix |
68 | 68 | ||
69 | expectStartWith(file.fileUrl, start) | 69 | expectStartWith(file.fileUrl, start) |
@@ -134,8 +134,8 @@ function runTestSuite (options: { | |||
134 | playlistBucket: string | 134 | playlistBucket: string |
135 | playlistPrefix?: string | 135 | playlistPrefix?: string |
136 | 136 | ||
137 | webtorrentBucket: string | 137 | webVideoBucket: string |
138 | webtorrentPrefix?: string | 138 | webVideoPrefix?: string |
139 | 139 | ||
140 | useMockBaseUrl?: boolean | 140 | useMockBaseUrl?: boolean |
141 | }) { | 141 | }) { |
@@ -161,7 +161,7 @@ function runTestSuite (options: { | |||
161 | : undefined | 161 | : undefined |
162 | 162 | ||
163 | await objectStorage.createMockBucket(options.playlistBucket) | 163 | await objectStorage.createMockBucket(options.playlistBucket) |
164 | await objectStorage.createMockBucket(options.webtorrentBucket) | 164 | await objectStorage.createMockBucket(options.webVideoBucket) |
165 | 165 | ||
166 | const config = { | 166 | const config = { |
167 | object_storage: { | 167 | object_storage: { |
@@ -182,10 +182,10 @@ function runTestSuite (options: { | |||
182 | }, | 182 | }, |
183 | 183 | ||
184 | videos: { | 184 | videos: { |
185 | bucket_name: options.webtorrentBucket, | 185 | bucket_name: options.webVideoBucket, |
186 | prefix: options.webtorrentPrefix, | 186 | prefix: options.webVideoPrefix, |
187 | base_url: baseMockUrl | 187 | base_url: baseMockUrl |
188 | ? `${baseMockUrl}/${options.webtorrentBucket}` | 188 | ? `${baseMockUrl}/${options.webVideoBucket}` |
189 | : undefined | 189 | : undefined |
190 | } | 190 | } |
191 | } | 191 | } |
@@ -386,27 +386,27 @@ describe('Object storage for videos', function () { | |||
386 | describe('Test simple object storage', function () { | 386 | describe('Test simple object storage', function () { |
387 | runTestSuite({ | 387 | runTestSuite({ |
388 | playlistBucket: objectStorage.getMockBucketName('streaming-playlists'), | 388 | playlistBucket: objectStorage.getMockBucketName('streaming-playlists'), |
389 | webtorrentBucket: objectStorage.getMockBucketName('videos') | 389 | webVideoBucket: objectStorage.getMockBucketName('videos') |
390 | }) | 390 | }) |
391 | }) | 391 | }) |
392 | 392 | ||
393 | describe('Test object storage with prefix', function () { | 393 | describe('Test object storage with prefix', function () { |
394 | runTestSuite({ | 394 | runTestSuite({ |
395 | playlistBucket: objectStorage.getMockBucketName('mybucket'), | 395 | playlistBucket: objectStorage.getMockBucketName('mybucket'), |
396 | webtorrentBucket: objectStorage.getMockBucketName('mybucket'), | 396 | webVideoBucket: objectStorage.getMockBucketName('mybucket'), |
397 | 397 | ||
398 | playlistPrefix: 'streaming-playlists_', | 398 | playlistPrefix: 'streaming-playlists_', |
399 | webtorrentPrefix: 'webtorrent_' | 399 | webVideoPrefix: 'webvideo_' |
400 | }) | 400 | }) |
401 | }) | 401 | }) |
402 | 402 | ||
403 | describe('Test object storage with prefix and base URL', function () { | 403 | describe('Test object storage with prefix and base URL', function () { |
404 | runTestSuite({ | 404 | runTestSuite({ |
405 | playlistBucket: objectStorage.getMockBucketName('mybucket'), | 405 | playlistBucket: objectStorage.getMockBucketName('mybucket'), |
406 | webtorrentBucket: objectStorage.getMockBucketName('mybucket'), | 406 | webVideoBucket: objectStorage.getMockBucketName('mybucket'), |
407 | 407 | ||
408 | playlistPrefix: 'streaming-playlists/', | 408 | playlistPrefix: 'streaming-playlists/', |
409 | webtorrentPrefix: 'webtorrent/', | 409 | webVideoPrefix: 'webvideo/', |
410 | 410 | ||
411 | useMockBaseUrl: true | 411 | useMockBaseUrl: true |
412 | }) | 412 | }) |
@@ -431,7 +431,7 @@ describe('Object storage for videos', function () { | |||
431 | runTestSuite({ | 431 | runTestSuite({ |
432 | maxUploadPart, | 432 | maxUploadPart, |
433 | playlistBucket: objectStorage.getMockBucketName('streaming-playlists'), | 433 | playlistBucket: objectStorage.getMockBucketName('streaming-playlists'), |
434 | webtorrentBucket: objectStorage.getMockBucketName('videos'), | 434 | webVideoBucket: objectStorage.getMockBucketName('videos'), |
435 | fixture | 435 | fixture |
436 | }) | 436 | }) |
437 | }) | 437 | }) |
diff --git a/server/tests/api/redundancy/redundancy.ts b/server/tests/api/redundancy/redundancy.ts index 5262c503f..b35059c29 100644 --- a/server/tests/api/redundancy/redundancy.ts +++ b/server/tests/api/redundancy/redundancy.ts | |||
@@ -43,7 +43,7 @@ async function checkMagnetWebseeds (file: VideoFile, baseWebseeds: string[], ser | |||
43 | } | 43 | } |
44 | } | 44 | } |
45 | 45 | ||
46 | async function createServers (strategy: VideoRedundancyStrategy | null, additionalParams: any = {}, withWebtorrent = true) { | 46 | async function createServers (strategy: VideoRedundancyStrategy | null, additionalParams: any = {}, withWebVideo = true) { |
47 | const strategies: any[] = [] | 47 | const strategies: any[] = [] |
48 | 48 | ||
49 | if (strategy !== null) { | 49 | if (strategy !== null) { |
@@ -61,7 +61,7 @@ async function createServers (strategy: VideoRedundancyStrategy | null, addition | |||
61 | const config = { | 61 | const config = { |
62 | transcoding: { | 62 | transcoding: { |
63 | webtorrent: { | 63 | webtorrent: { |
64 | enabled: withWebtorrent | 64 | enabled: withWebVideo |
65 | }, | 65 | }, |
66 | hls: { | 66 | hls: { |
67 | enabled: true | 67 | enabled: true |
@@ -100,7 +100,7 @@ async function createServers (strategy: VideoRedundancyStrategy | null, addition | |||
100 | } | 100 | } |
101 | 101 | ||
102 | async function ensureSameFilenames (videoUUID: string) { | 102 | async function ensureSameFilenames (videoUUID: string) { |
103 | let webtorrentFilenames: string[] | 103 | let webVideoFilenames: string[] |
104 | let hlsFilenames: string[] | 104 | let hlsFilenames: string[] |
105 | 105 | ||
106 | for (const server of servers) { | 106 | for (const server of servers) { |
@@ -108,17 +108,17 @@ async function ensureSameFilenames (videoUUID: string) { | |||
108 | 108 | ||
109 | // Ensure we use the same filenames that the origin | 109 | // Ensure we use the same filenames that the origin |
110 | 110 | ||
111 | const localWebtorrentFilenames = video.files.map(f => basename(f.fileUrl)).sort() | 111 | const localWebVideoFilenames = video.files.map(f => basename(f.fileUrl)).sort() |
112 | const localHLSFilenames = video.streamingPlaylists[0].files.map(f => basename(f.fileUrl)).sort() | 112 | const localHLSFilenames = video.streamingPlaylists[0].files.map(f => basename(f.fileUrl)).sort() |
113 | 113 | ||
114 | if (webtorrentFilenames) expect(webtorrentFilenames).to.deep.equal(localWebtorrentFilenames) | 114 | if (webVideoFilenames) expect(webVideoFilenames).to.deep.equal(localWebVideoFilenames) |
115 | else webtorrentFilenames = localWebtorrentFilenames | 115 | else webVideoFilenames = localWebVideoFilenames |
116 | 116 | ||
117 | if (hlsFilenames) expect(hlsFilenames).to.deep.equal(localHLSFilenames) | 117 | if (hlsFilenames) expect(hlsFilenames).to.deep.equal(localHLSFilenames) |
118 | else hlsFilenames = localHLSFilenames | 118 | else hlsFilenames = localHLSFilenames |
119 | } | 119 | } |
120 | 120 | ||
121 | return { webtorrentFilenames, hlsFilenames } | 121 | return { webVideoFilenames, hlsFilenames } |
122 | } | 122 | } |
123 | 123 | ||
124 | async function check1WebSeed (videoUUID?: string) { | 124 | async function check1WebSeed (videoUUID?: string) { |
@@ -156,7 +156,7 @@ async function check2Webseeds (videoUUID?: string) { | |||
156 | } | 156 | } |
157 | } | 157 | } |
158 | 158 | ||
159 | const { webtorrentFilenames } = await ensureSameFilenames(videoUUID) | 159 | const { webVideoFilenames } = await ensureSameFilenames(videoUUID) |
160 | 160 | ||
161 | const directories = [ | 161 | const directories = [ |
162 | servers[0].getDirectoryPath('redundancy'), | 162 | servers[0].getDirectoryPath('redundancy'), |
@@ -168,7 +168,7 @@ async function check2Webseeds (videoUUID?: string) { | |||
168 | expect(files).to.have.length.at.least(4) | 168 | expect(files).to.have.length.at.least(4) |
169 | 169 | ||
170 | // Ensure we files exist on disk | 170 | // Ensure we files exist on disk |
171 | expect(files.find(f => webtorrentFilenames.includes(f))).to.exist | 171 | expect(files.find(f => webVideoFilenames.includes(f))).to.exist |
172 | } | 172 | } |
173 | } | 173 | } |
174 | 174 | ||
diff --git a/server/tests/api/transcoding/audio-only.ts b/server/tests/api/transcoding/audio-only.ts index 1e31418e7..aa1113fc1 100644 --- a/server/tests/api/transcoding/audio-only.ts +++ b/server/tests/api/transcoding/audio-only.ts | |||
@@ -14,7 +14,7 @@ import { | |||
14 | describe('Test audio only video transcoding', function () { | 14 | describe('Test audio only video transcoding', function () { |
15 | let servers: PeerTubeServer[] = [] | 15 | let servers: PeerTubeServer[] = [] |
16 | let videoUUID: string | 16 | let videoUUID: string |
17 | let webtorrentAudioFileUrl: string | 17 | let webVideoAudioFileUrl: string |
18 | let fragmentedAudioFileUrl: string | 18 | let fragmentedAudioFileUrl: string |
19 | 19 | ||
20 | before(async function () { | 20 | before(async function () { |
@@ -71,7 +71,7 @@ describe('Test audio only video transcoding', function () { | |||
71 | } | 71 | } |
72 | 72 | ||
73 | if (server.serverNumber === 1) { | 73 | if (server.serverNumber === 1) { |
74 | webtorrentAudioFileUrl = video.files[2].fileUrl | 74 | webVideoAudioFileUrl = video.files[2].fileUrl |
75 | fragmentedAudioFileUrl = video.streamingPlaylists[0].files[2].fileUrl | 75 | fragmentedAudioFileUrl = video.streamingPlaylists[0].files[2].fileUrl |
76 | } | 76 | } |
77 | } | 77 | } |
@@ -79,7 +79,7 @@ describe('Test audio only video transcoding', function () { | |||
79 | 79 | ||
80 | it('0p transcoded video should not have video', async function () { | 80 | it('0p transcoded video should not have video', async function () { |
81 | const paths = [ | 81 | const paths = [ |
82 | servers[0].servers.buildWebTorrentFilePath(webtorrentAudioFileUrl), | 82 | servers[0].servers.buildWebVideoFilePath(webVideoAudioFileUrl), |
83 | servers[0].servers.buildFragmentedFilePath(videoUUID, fragmentedAudioFileUrl) | 83 | servers[0].servers.buildFragmentedFilePath(videoUUID, fragmentedAudioFileUrl) |
84 | ] | 84 | ] |
85 | 85 | ||
diff --git a/server/tests/api/transcoding/create-transcoding.ts b/server/tests/api/transcoding/create-transcoding.ts index d6f5b01dc..21a63f547 100644 --- a/server/tests/api/transcoding/create-transcoding.ts +++ b/server/tests/api/transcoding/create-transcoding.ts | |||
@@ -96,12 +96,12 @@ function runTests (enableObjectStorage: boolean) { | |||
96 | } | 96 | } |
97 | }) | 97 | }) |
98 | 98 | ||
99 | it('Should generate WebTorrent', async function () { | 99 | it('Should generate Web Video', async function () { |
100 | this.timeout(60000) | 100 | this.timeout(60000) |
101 | 101 | ||
102 | await servers[0].videos.runTranscoding({ | 102 | await servers[0].videos.runTranscoding({ |
103 | videoId: videoUUID, | 103 | videoId: videoUUID, |
104 | transcodingType: 'webtorrent' | 104 | transcodingType: 'web-video' |
105 | }) | 105 | }) |
106 | 106 | ||
107 | await waitJobs(servers) | 107 | await waitJobs(servers) |
@@ -117,13 +117,13 @@ function runTests (enableObjectStorage: boolean) { | |||
117 | } | 117 | } |
118 | }) | 118 | }) |
119 | 119 | ||
120 | it('Should generate WebTorrent from HLS only video', async function () { | 120 | it('Should generate Web Video from HLS only video', async function () { |
121 | this.timeout(60000) | 121 | this.timeout(60000) |
122 | 122 | ||
123 | await servers[0].videos.removeAllWebTorrentFiles({ videoId: videoUUID }) | 123 | await servers[0].videos.removeAllWebVideoFiles({ videoId: videoUUID }) |
124 | await waitJobs(servers) | 124 | await waitJobs(servers) |
125 | 125 | ||
126 | await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'webtorrent' }) | 126 | await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'web-video' }) |
127 | await waitJobs(servers) | 127 | await waitJobs(servers) |
128 | 128 | ||
129 | for (const server of servers) { | 129 | for (const server of servers) { |
@@ -137,13 +137,13 @@ function runTests (enableObjectStorage: boolean) { | |||
137 | } | 137 | } |
138 | }) | 138 | }) |
139 | 139 | ||
140 | it('Should only generate WebTorrent', async function () { | 140 | it('Should only generate Web Video', async function () { |
141 | this.timeout(60000) | 141 | this.timeout(60000) |
142 | 142 | ||
143 | await servers[0].videos.removeHLSPlaylist({ videoId: videoUUID }) | 143 | await servers[0].videos.removeHLSPlaylist({ videoId: videoUUID }) |
144 | await waitJobs(servers) | 144 | await waitJobs(servers) |
145 | 145 | ||
146 | await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'webtorrent' }) | 146 | await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'web-video' }) |
147 | await waitJobs(servers) | 147 | await waitJobs(servers) |
148 | 148 | ||
149 | for (const server of servers) { | 149 | for (const server of servers) { |
diff --git a/server/tests/api/transcoding/hls.ts b/server/tests/api/transcoding/hls.ts index c668d7e0b..ba889e718 100644 --- a/server/tests/api/transcoding/hls.ts +++ b/server/tests/api/transcoding/hls.ts | |||
@@ -111,7 +111,7 @@ describe('Test HLS videos', function () { | |||
111 | await doubleFollow(servers[0], servers[1]) | 111 | await doubleFollow(servers[0], servers[1]) |
112 | }) | 112 | }) |
113 | 113 | ||
114 | describe('With WebTorrent & HLS enabled', function () { | 114 | describe('With Web Video & HLS enabled', function () { |
115 | runTestSuite(false) | 115 | runTestSuite(false) |
116 | }) | 116 | }) |
117 | 117 | ||
diff --git a/server/tests/api/transcoding/transcoder.ts b/server/tests/api/transcoding/transcoder.ts index 3cd247a24..36e1d90f4 100644 --- a/server/tests/api/transcoding/transcoder.ts +++ b/server/tests/api/transcoding/transcoder.ts | |||
@@ -251,7 +251,7 @@ describe('Test video transcoding', function () { | |||
251 | expect(videoDetails.files).to.have.lengthOf(5) | 251 | expect(videoDetails.files).to.have.lengthOf(5) |
252 | 252 | ||
253 | const file = videoDetails.files.find(f => f.resolution.id === 240) | 253 | const file = videoDetails.files.find(f => f.resolution.id === 240) |
254 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 254 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
255 | const probe = await getAudioStream(path) | 255 | const probe = await getAudioStream(path) |
256 | 256 | ||
257 | if (probe.audioStream) { | 257 | if (probe.audioStream) { |
@@ -281,7 +281,7 @@ describe('Test video transcoding', function () { | |||
281 | const videoDetails = await server.videos.get({ id: video.id }) | 281 | const videoDetails = await server.videos.get({ id: video.id }) |
282 | 282 | ||
283 | const file = videoDetails.files.find(f => f.resolution.id === 240) | 283 | const file = videoDetails.files.find(f => f.resolution.id === 240) |
284 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 284 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
285 | 285 | ||
286 | expect(await hasAudioStream(path)).to.be.false | 286 | expect(await hasAudioStream(path)).to.be.false |
287 | } | 287 | } |
@@ -310,7 +310,7 @@ describe('Test video transcoding', function () { | |||
310 | const fixtureVideoProbe = await getAudioStream(fixturePath) | 310 | const fixtureVideoProbe = await getAudioStream(fixturePath) |
311 | 311 | ||
312 | const file = videoDetails.files.find(f => f.resolution.id === 240) | 312 | const file = videoDetails.files.find(f => f.resolution.id === 240) |
313 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 313 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
314 | 314 | ||
315 | const videoProbe = await getAudioStream(path) | 315 | const videoProbe = await getAudioStream(path) |
316 | 316 | ||
@@ -472,14 +472,14 @@ describe('Test video transcoding', function () { | |||
472 | 472 | ||
473 | for (const resolution of [ 144, 240, 360, 480 ]) { | 473 | for (const resolution of [ 144, 240, 360, 480 ]) { |
474 | const file = videoDetails.files.find(f => f.resolution.id === resolution) | 474 | const file = videoDetails.files.find(f => f.resolution.id === resolution) |
475 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 475 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
476 | const fps = await getVideoStreamFPS(path) | 476 | const fps = await getVideoStreamFPS(path) |
477 | 477 | ||
478 | expect(fps).to.be.below(31) | 478 | expect(fps).to.be.below(31) |
479 | } | 479 | } |
480 | 480 | ||
481 | const file = videoDetails.files.find(f => f.resolution.id === 720) | 481 | const file = videoDetails.files.find(f => f.resolution.id === 720) |
482 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 482 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
483 | const fps = await getVideoStreamFPS(path) | 483 | const fps = await getVideoStreamFPS(path) |
484 | 484 | ||
485 | expect(fps).to.be.above(58).and.below(62) | 485 | expect(fps).to.be.above(58).and.below(62) |
@@ -516,14 +516,14 @@ describe('Test video transcoding', function () { | |||
516 | 516 | ||
517 | { | 517 | { |
518 | const file = video.files.find(f => f.resolution.id === 240) | 518 | const file = video.files.find(f => f.resolution.id === 240) |
519 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 519 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
520 | const fps = await getVideoStreamFPS(path) | 520 | const fps = await getVideoStreamFPS(path) |
521 | expect(fps).to.be.equal(25) | 521 | expect(fps).to.be.equal(25) |
522 | } | 522 | } |
523 | 523 | ||
524 | { | 524 | { |
525 | const file = video.files.find(f => f.resolution.id === 720) | 525 | const file = video.files.find(f => f.resolution.id === 720) |
526 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 526 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
527 | const fps = await getVideoStreamFPS(path) | 527 | const fps = await getVideoStreamFPS(path) |
528 | expect(fps).to.be.equal(59) | 528 | expect(fps).to.be.equal(59) |
529 | } | 529 | } |
@@ -556,7 +556,7 @@ describe('Test video transcoding', function () { | |||
556 | 556 | ||
557 | for (const resolution of [ 240, 360, 480, 720, 1080 ]) { | 557 | for (const resolution of [ 240, 360, 480, 720, 1080 ]) { |
558 | const file = video.files.find(f => f.resolution.id === resolution) | 558 | const file = video.files.find(f => f.resolution.id === resolution) |
559 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 559 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
560 | 560 | ||
561 | const bitrate = await getVideoStreamBitrate(path) | 561 | const bitrate = await getVideoStreamBitrate(path) |
562 | const fps = await getVideoStreamFPS(path) | 562 | const fps = await getVideoStreamFPS(path) |
@@ -607,7 +607,7 @@ describe('Test video transcoding', function () { | |||
607 | for (const r of resolutions) { | 607 | for (const r of resolutions) { |
608 | const file = video.files.find(f => f.resolution.id === r) | 608 | const file = video.files.find(f => f.resolution.id === r) |
609 | 609 | ||
610 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 610 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
611 | const bitrate = await getVideoStreamBitrate(path) | 611 | const bitrate = await getVideoStreamBitrate(path) |
612 | 612 | ||
613 | const inputBitrate = 60_000 | 613 | const inputBitrate = 60_000 |
@@ -631,7 +631,7 @@ describe('Test video transcoding', function () { | |||
631 | { | 631 | { |
632 | const video = await servers[1].videos.get({ id: videoUUID }) | 632 | const video = await servers[1].videos.get({ id: videoUUID }) |
633 | const file = video.files.find(f => f.resolution.id === 240) | 633 | const file = video.files.find(f => f.resolution.id === 240) |
634 | const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl) | 634 | const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl) |
635 | 635 | ||
636 | const probe = await ffprobePromise(path) | 636 | const probe = await ffprobePromise(path) |
637 | const metadata = new VideoFileMetadata(probe) | 637 | const metadata = new VideoFileMetadata(probe) |
@@ -704,14 +704,14 @@ describe('Test video transcoding', function () { | |||
704 | expect(transcodingJobs).to.have.lengthOf(16) | 704 | expect(transcodingJobs).to.have.lengthOf(16) |
705 | 705 | ||
706 | const hlsJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-hls') | 706 | const hlsJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-hls') |
707 | const webtorrentJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-webtorrent') | 707 | const webVideoJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-web-video') |
708 | const optimizeJobs = transcodingJobs.filter(j => j.data.type === 'optimize-to-webtorrent') | 708 | const optimizeJobs = transcodingJobs.filter(j => j.data.type === 'optimize-to-web-video') |
709 | 709 | ||
710 | expect(hlsJobs).to.have.lengthOf(8) | 710 | expect(hlsJobs).to.have.lengthOf(8) |
711 | expect(webtorrentJobs).to.have.lengthOf(7) | 711 | expect(webVideoJobs).to.have.lengthOf(7) |
712 | expect(optimizeJobs).to.have.lengthOf(1) | 712 | expect(optimizeJobs).to.have.lengthOf(1) |
713 | 713 | ||
714 | for (const j of optimizeJobs.concat(hlsJobs.concat(webtorrentJobs))) { | 714 | for (const j of optimizeJobs.concat(hlsJobs.concat(webVideoJobs))) { |
715 | expect(j.priority).to.be.greaterThan(100) | 715 | expect(j.priority).to.be.greaterThan(100) |
716 | expect(j.priority).to.be.lessThan(150) | 716 | expect(j.priority).to.be.lessThan(150) |
717 | } | 717 | } |
diff --git a/server/tests/api/transcoding/update-while-transcoding.ts b/server/tests/api/transcoding/update-while-transcoding.ts index 61655f102..2e0edc770 100644 --- a/server/tests/api/transcoding/update-while-transcoding.ts +++ b/server/tests/api/transcoding/update-while-transcoding.ts | |||
@@ -96,7 +96,7 @@ describe('Test update video privacy while transcoding', function () { | |||
96 | await doubleFollow(servers[0], servers[1]) | 96 | await doubleFollow(servers[0], servers[1]) |
97 | }) | 97 | }) |
98 | 98 | ||
99 | describe('With WebTorrent & HLS enabled', function () { | 99 | describe('With Web Video & HLS enabled', function () { |
100 | runTestSuite(false) | 100 | runTestSuite(false) |
101 | }) | 101 | }) |
102 | 102 | ||
diff --git a/server/tests/api/transcoding/video-studio.ts b/server/tests/api/transcoding/video-studio.ts index e97f2b689..2595d3cdb 100644 --- a/server/tests/api/transcoding/video-studio.ts +++ b/server/tests/api/transcoding/video-studio.ts | |||
@@ -273,7 +273,7 @@ describe('Test video studio', function () { | |||
273 | describe('HLS only studio edition', function () { | 273 | describe('HLS only studio edition', function () { |
274 | 274 | ||
275 | before(async function () { | 275 | before(async function () { |
276 | // Disable webtorrent | 276 | // Disable Web Videos |
277 | await servers[0].config.updateExistingSubConfig({ | 277 | await servers[0].config.updateExistingSubConfig({ |
278 | newConfig: { | 278 | newConfig: { |
279 | transcoding: { | 279 | transcoding: { |
@@ -354,8 +354,8 @@ describe('Test video studio', function () { | |||
354 | expect(oldFileUrls).to.not.include(f.fileUrl) | 354 | expect(oldFileUrls).to.not.include(f.fileUrl) |
355 | } | 355 | } |
356 | 356 | ||
357 | for (const webtorrentFile of video.files) { | 357 | for (const webVideoFile of video.files) { |
358 | expectStartWith(webtorrentFile.fileUrl, objectStorage.getMockWebVideosBaseUrl()) | 358 | expectStartWith(webVideoFile.fileUrl, objectStorage.getMockWebVideosBaseUrl()) |
359 | } | 359 | } |
360 | 360 | ||
361 | for (const hlsFile of video.streamingPlaylists[0].files) { | 361 | for (const hlsFile of video.streamingPlaylists[0].files) { |
diff --git a/server/tests/api/users/user-videos.ts b/server/tests/api/users/user-videos.ts index 696949504..70f22e2eb 100644 --- a/server/tests/api/users/user-videos.ts +++ b/server/tests/api/users/user-videos.ts | |||
@@ -184,7 +184,7 @@ describe('Test user videos', function () { | |||
184 | } | 184 | } |
185 | }) | 185 | }) |
186 | 186 | ||
187 | it('Should disable webtorrent, enable HLS, and update my quota', async function () { | 187 | it('Should disable web videos, enable HLS, and update my quota', async function () { |
188 | this.timeout(160000) | 188 | this.timeout(160000) |
189 | 189 | ||
190 | { | 190 | { |
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index 1c00f9a93..67ade1d0d 100644 --- a/server/tests/api/users/users.ts +++ b/server/tests/api/users/users.ts | |||
@@ -229,25 +229,13 @@ describe('Test users', function () { | |||
229 | }) | 229 | }) |
230 | 230 | ||
231 | it('Should be able to change the p2p attribute', async function () { | 231 | it('Should be able to change the p2p attribute', async function () { |
232 | { | 232 | await server.users.updateMe({ |
233 | await server.users.updateMe({ | 233 | token: userToken, |
234 | token: userToken, | 234 | p2pEnabled: true |
235 | webTorrentEnabled: false | 235 | }) |
236 | }) | ||
237 | |||
238 | const user = await server.users.getMyInfo({ token: userToken }) | ||
239 | expect(user.p2pEnabled).to.be.false | ||
240 | } | ||
241 | |||
242 | { | ||
243 | await server.users.updateMe({ | ||
244 | token: userToken, | ||
245 | p2pEnabled: true | ||
246 | }) | ||
247 | 236 | ||
248 | const user = await server.users.getMyInfo({ token: userToken }) | 237 | const user = await server.users.getMyInfo({ token: userToken }) |
249 | expect(user.p2pEnabled).to.be.true | 238 | expect(user.p2pEnabled).to.be.true |
250 | } | ||
251 | }) | 239 | }) |
252 | 240 | ||
253 | it('Should be able to change the email attribute', async function () { | 241 | it('Should be able to change the email attribute', async function () { |
diff --git a/server/tests/api/videos/video-files.ts b/server/tests/api/videos/video-files.ts index 8c913bf31..0a183c44d 100644 --- a/server/tests/api/videos/video-files.ts +++ b/server/tests/api/videos/video-files.ts | |||
@@ -48,10 +48,10 @@ describe('Test videos files', function () { | |||
48 | await waitJobs(servers) | 48 | await waitJobs(servers) |
49 | }) | 49 | }) |
50 | 50 | ||
51 | it('Should delete webtorrent files', async function () { | 51 | it('Should delete web video files', async function () { |
52 | this.timeout(30_000) | 52 | this.timeout(30_000) |
53 | 53 | ||
54 | await servers[0].videos.removeAllWebTorrentFiles({ videoId: validId1 }) | 54 | await servers[0].videos.removeAllWebVideoFiles({ videoId: validId1 }) |
55 | 55 | ||
56 | await waitJobs(servers) | 56 | await waitJobs(servers) |
57 | 57 | ||
@@ -80,15 +80,15 @@ describe('Test videos files', function () { | |||
80 | }) | 80 | }) |
81 | 81 | ||
82 | describe('When deleting a specific file', function () { | 82 | describe('When deleting a specific file', function () { |
83 | let webtorrentId: string | 83 | let webVideoId: string |
84 | let hlsId: string | 84 | let hlsId: string |
85 | 85 | ||
86 | before(async function () { | 86 | before(async function () { |
87 | this.timeout(120_000) | 87 | this.timeout(120_000) |
88 | 88 | ||
89 | { | 89 | { |
90 | const { uuid } = await servers[0].videos.quickUpload({ name: 'webtorrent' }) | 90 | const { uuid } = await servers[0].videos.quickUpload({ name: 'web-video' }) |
91 | webtorrentId = uuid | 91 | webVideoId = uuid |
92 | } | 92 | } |
93 | 93 | ||
94 | { | 94 | { |
@@ -99,38 +99,38 @@ describe('Test videos files', function () { | |||
99 | await waitJobs(servers) | 99 | await waitJobs(servers) |
100 | }) | 100 | }) |
101 | 101 | ||
102 | it('Shoulde delete a webtorrent file', async function () { | 102 | it('Shoulde delete a web video file', async function () { |
103 | this.timeout(30_000) | 103 | this.timeout(30_000) |
104 | 104 | ||
105 | const video = await servers[0].videos.get({ id: webtorrentId }) | 105 | const video = await servers[0].videos.get({ id: webVideoId }) |
106 | const files = video.files | 106 | const files = video.files |
107 | 107 | ||
108 | await servers[0].videos.removeWebTorrentFile({ videoId: webtorrentId, fileId: files[0].id }) | 108 | await servers[0].videos.removeWebVideoFile({ videoId: webVideoId, fileId: files[0].id }) |
109 | 109 | ||
110 | await waitJobs(servers) | 110 | await waitJobs(servers) |
111 | 111 | ||
112 | for (const server of servers) { | 112 | for (const server of servers) { |
113 | const video = await server.videos.get({ id: webtorrentId }) | 113 | const video = await server.videos.get({ id: webVideoId }) |
114 | 114 | ||
115 | expect(video.files).to.have.lengthOf(files.length - 1) | 115 | expect(video.files).to.have.lengthOf(files.length - 1) |
116 | expect(video.files.find(f => f.id === files[0].id)).to.not.exist | 116 | expect(video.files.find(f => f.id === files[0].id)).to.not.exist |
117 | } | 117 | } |
118 | }) | 118 | }) |
119 | 119 | ||
120 | it('Should delete all webtorrent files', async function () { | 120 | it('Should delete all web video files', async function () { |
121 | this.timeout(30_000) | 121 | this.timeout(30_000) |
122 | 122 | ||
123 | const video = await servers[0].videos.get({ id: webtorrentId }) | 123 | const video = await servers[0].videos.get({ id: webVideoId }) |
124 | const files = video.files | 124 | const files = video.files |
125 | 125 | ||
126 | for (const file of files) { | 126 | for (const file of files) { |
127 | await servers[0].videos.removeWebTorrentFile({ videoId: webtorrentId, fileId: file.id }) | 127 | await servers[0].videos.removeWebVideoFile({ videoId: webVideoId, fileId: file.id }) |
128 | } | 128 | } |
129 | 129 | ||
130 | await waitJobs(servers) | 130 | await waitJobs(servers) |
131 | 131 | ||
132 | for (const server of servers) { | 132 | for (const server of servers) { |
133 | const video = await server.videos.get({ id: webtorrentId }) | 133 | const video = await server.videos.get({ id: webVideoId }) |
134 | 134 | ||
135 | expect(video.files).to.have.lengthOf(0) | 135 | expect(video.files).to.have.lengthOf(0) |
136 | } | 136 | } |
@@ -182,16 +182,16 @@ describe('Test videos files', function () { | |||
182 | it('Should not delete last file of a video', async function () { | 182 | it('Should not delete last file of a video', async function () { |
183 | this.timeout(60_000) | 183 | this.timeout(60_000) |
184 | 184 | ||
185 | const webtorrentOnly = await servers[0].videos.get({ id: hlsId }) | 185 | const webVideoOnly = await servers[0].videos.get({ id: hlsId }) |
186 | const hlsOnly = await servers[0].videos.get({ id: webtorrentId }) | 186 | const hlsOnly = await servers[0].videos.get({ id: webVideoId }) |
187 | 187 | ||
188 | for (let i = 0; i < 4; i++) { | 188 | for (let i = 0; i < 4; i++) { |
189 | await servers[0].videos.removeWebTorrentFile({ videoId: webtorrentOnly.id, fileId: webtorrentOnly.files[i].id }) | 189 | await servers[0].videos.removeWebVideoFile({ videoId: webVideoOnly.id, fileId: webVideoOnly.files[i].id }) |
190 | await servers[0].videos.removeHLSFile({ videoId: hlsOnly.id, fileId: hlsOnly.streamingPlaylists[0].files[i].id }) | 190 | await servers[0].videos.removeHLSFile({ videoId: hlsOnly.id, fileId: hlsOnly.streamingPlaylists[0].files[i].id }) |
191 | } | 191 | } |
192 | 192 | ||
193 | const expectedStatus = HttpStatusCode.BAD_REQUEST_400 | 193 | const expectedStatus = HttpStatusCode.BAD_REQUEST_400 |
194 | await servers[0].videos.removeWebTorrentFile({ videoId: webtorrentOnly.id, fileId: webtorrentOnly.files[4].id, expectedStatus }) | 194 | await servers[0].videos.removeWebVideoFile({ videoId: webVideoOnly.id, fileId: webVideoOnly.files[4].id, expectedStatus }) |
195 | await servers[0].videos.removeHLSFile({ videoId: hlsOnly.id, fileId: hlsOnly.streamingPlaylists[0].files[4].id, expectedStatus }) | 195 | await servers[0].videos.removeHLSFile({ videoId: hlsOnly.id, fileId: hlsOnly.streamingPlaylists[0].files[4].id, expectedStatus }) |
196 | }) | 196 | }) |
197 | }) | 197 | }) |
diff --git a/server/tests/api/videos/videos-common-filters.ts b/server/tests/api/videos/videos-common-filters.ts index 30251706b..73c066bfb 100644 --- a/server/tests/api/videos/videos-common-filters.ts +++ b/server/tests/api/videos/videos-common-filters.ts | |||
@@ -154,7 +154,7 @@ describe('Test videos filter', function () { | |||
154 | server: PeerTubeServer | 154 | server: PeerTubeServer |
155 | path: string | 155 | path: string |
156 | isLocal?: boolean | 156 | isLocal?: boolean |
157 | hasWebtorrentFiles?: boolean | 157 | hasWebVideoFiles?: boolean |
158 | hasHLSFiles?: boolean | 158 | hasHLSFiles?: boolean |
159 | include?: VideoInclude | 159 | include?: VideoInclude |
160 | privacyOneOf?: VideoPrivacy[] | 160 | privacyOneOf?: VideoPrivacy[] |
@@ -174,7 +174,7 @@ describe('Test videos filter', function () { | |||
174 | 'include', | 174 | 'include', |
175 | 'category', | 175 | 'category', |
176 | 'tagsAllOf', | 176 | 'tagsAllOf', |
177 | 'hasWebtorrentFiles', | 177 | 'hasWebVideoFiles', |
178 | 'hasHLSFiles', | 178 | 'hasHLSFiles', |
179 | 'privacyOneOf', | 179 | 'privacyOneOf', |
180 | 'excludeAlreadyWatched' | 180 | 'excludeAlreadyWatched' |
@@ -463,14 +463,14 @@ describe('Test videos filter', function () { | |||
463 | } | 463 | } |
464 | }) | 464 | }) |
465 | 465 | ||
466 | it('Should filter by HLS or WebTorrent files', async function () { | 466 | it('Should filter by HLS or Web Video files', async function () { |
467 | this.timeout(360000) | 467 | this.timeout(360000) |
468 | 468 | ||
469 | const finderFactory = (name: string) => (videos: Video[]) => videos.some(v => v.name === name) | 469 | const finderFactory = (name: string) => (videos: Video[]) => videos.some(v => v.name === name) |
470 | 470 | ||
471 | await servers[0].config.enableTranscoding(true, false) | 471 | await servers[0].config.enableTranscoding(true, false) |
472 | await servers[0].videos.upload({ attributes: { name: 'webtorrent video' } }) | 472 | await servers[0].videos.upload({ attributes: { name: 'web video video' } }) |
473 | const hasWebtorrent = finderFactory('webtorrent video') | 473 | const hasWebVideo = finderFactory('web video video') |
474 | 474 | ||
475 | await waitJobs(servers) | 475 | await waitJobs(servers) |
476 | 476 | ||
@@ -481,24 +481,24 @@ describe('Test videos filter', function () { | |||
481 | await waitJobs(servers) | 481 | await waitJobs(servers) |
482 | 482 | ||
483 | await servers[0].config.enableTranscoding(true, true) | 483 | await servers[0].config.enableTranscoding(true, true) |
484 | await servers[0].videos.upload({ attributes: { name: 'hls and webtorrent video' } }) | 484 | await servers[0].videos.upload({ attributes: { name: 'hls and web video video' } }) |
485 | const hasBoth = finderFactory('hls and webtorrent video') | 485 | const hasBoth = finderFactory('hls and web video video') |
486 | 486 | ||
487 | await waitJobs(servers) | 487 | await waitJobs(servers) |
488 | 488 | ||
489 | for (const path of paths) { | 489 | for (const path of paths) { |
490 | { | 490 | { |
491 | const videos = await listVideos({ server: servers[0], path, hasWebtorrentFiles: true }) | 491 | const videos = await listVideos({ server: servers[0], path, hasWebVideoFiles: true }) |
492 | 492 | ||
493 | expect(hasWebtorrent(videos)).to.be.true | 493 | expect(hasWebVideo(videos)).to.be.true |
494 | expect(hasHLS(videos)).to.be.false | 494 | expect(hasHLS(videos)).to.be.false |
495 | expect(hasBoth(videos)).to.be.true | 495 | expect(hasBoth(videos)).to.be.true |
496 | } | 496 | } |
497 | 497 | ||
498 | { | 498 | { |
499 | const videos = await listVideos({ server: servers[0], path, hasWebtorrentFiles: false }) | 499 | const videos = await listVideos({ server: servers[0], path, hasWebVideoFiles: false }) |
500 | 500 | ||
501 | expect(hasWebtorrent(videos)).to.be.false | 501 | expect(hasWebVideo(videos)).to.be.false |
502 | expect(hasHLS(videos)).to.be.true | 502 | expect(hasHLS(videos)).to.be.true |
503 | expect(hasBoth(videos)).to.be.false | 503 | expect(hasBoth(videos)).to.be.false |
504 | } | 504 | } |
@@ -506,7 +506,7 @@ describe('Test videos filter', function () { | |||
506 | { | 506 | { |
507 | const videos = await listVideos({ server: servers[0], path, hasHLSFiles: true }) | 507 | const videos = await listVideos({ server: servers[0], path, hasHLSFiles: true }) |
508 | 508 | ||
509 | expect(hasWebtorrent(videos)).to.be.false | 509 | expect(hasWebVideo(videos)).to.be.false |
510 | expect(hasHLS(videos)).to.be.true | 510 | expect(hasHLS(videos)).to.be.true |
511 | expect(hasBoth(videos)).to.be.true | 511 | expect(hasBoth(videos)).to.be.true |
512 | } | 512 | } |
@@ -514,23 +514,23 @@ describe('Test videos filter', function () { | |||
514 | { | 514 | { |
515 | const videos = await listVideos({ server: servers[0], path, hasHLSFiles: false }) | 515 | const videos = await listVideos({ server: servers[0], path, hasHLSFiles: false }) |
516 | 516 | ||
517 | expect(hasWebtorrent(videos)).to.be.true | 517 | expect(hasWebVideo(videos)).to.be.true |
518 | expect(hasHLS(videos)).to.be.false | 518 | expect(hasHLS(videos)).to.be.false |
519 | expect(hasBoth(videos)).to.be.false | 519 | expect(hasBoth(videos)).to.be.false |
520 | } | 520 | } |
521 | 521 | ||
522 | { | 522 | { |
523 | const videos = await listVideos({ server: servers[0], path, hasHLSFiles: false, hasWebtorrentFiles: false }) | 523 | const videos = await listVideos({ server: servers[0], path, hasHLSFiles: false, hasWebVideoFiles: false }) |
524 | 524 | ||
525 | expect(hasWebtorrent(videos)).to.be.false | 525 | expect(hasWebVideo(videos)).to.be.false |
526 | expect(hasHLS(videos)).to.be.false | 526 | expect(hasHLS(videos)).to.be.false |
527 | expect(hasBoth(videos)).to.be.false | 527 | expect(hasBoth(videos)).to.be.false |
528 | } | 528 | } |
529 | 529 | ||
530 | { | 530 | { |
531 | const videos = await listVideos({ server: servers[0], path, hasHLSFiles: true, hasWebtorrentFiles: true }) | 531 | const videos = await listVideos({ server: servers[0], path, hasHLSFiles: true, hasWebVideoFiles: true }) |
532 | 532 | ||
533 | expect(hasWebtorrent(videos)).to.be.false | 533 | expect(hasWebVideo(videos)).to.be.false |
534 | expect(hasHLS(videos)).to.be.false | 534 | expect(hasHLS(videos)).to.be.false |
535 | expect(hasBoth(videos)).to.be.true | 535 | expect(hasBoth(videos)).to.be.true |
536 | } | 536 | } |
diff --git a/server/tests/peertube-runner/studio-transcoding.ts b/server/tests/peertube-runner/studio-transcoding.ts index 988201947..c265d7934 100644 --- a/server/tests/peertube-runner/studio-transcoding.ts +++ b/server/tests/peertube-runner/studio-transcoding.ts | |||
@@ -44,8 +44,8 @@ describe('Test studio transcoding in peertube-runner program', function () { | |||
44 | } | 44 | } |
45 | 45 | ||
46 | if (objectStorage) { | 46 | if (objectStorage) { |
47 | for (const webtorrentFile of video.files) { | 47 | for (const webVideoFile of video.files) { |
48 | expectStartWith(webtorrentFile.fileUrl, objectStorage.getMockWebVideosBaseUrl()) | 48 | expectStartWith(webVideoFile.fileUrl, objectStorage.getMockWebVideosBaseUrl()) |
49 | } | 49 | } |
50 | 50 | ||
51 | for (const hlsFile of video.streamingPlaylists[0].files) { | 51 | for (const hlsFile of video.streamingPlaylists[0].files) { |
diff --git a/server/tests/peertube-runner/vod-transcoding.ts b/server/tests/peertube-runner/vod-transcoding.ts index c3f41c097..eef6faf4e 100644 --- a/server/tests/peertube-runner/vod-transcoding.ts +++ b/server/tests/peertube-runner/vod-transcoding.ts | |||
@@ -24,13 +24,13 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
24 | let peertubeRunner: PeerTubeRunnerProcess | 24 | let peertubeRunner: PeerTubeRunnerProcess |
25 | 25 | ||
26 | function runSuite (options: { | 26 | function runSuite (options: { |
27 | webtorrentEnabled: boolean | 27 | webVideoEnabled: boolean |
28 | hlsEnabled: boolean | 28 | hlsEnabled: boolean |
29 | objectStorage?: ObjectStorageCommand | 29 | objectStorage?: ObjectStorageCommand |
30 | }) { | 30 | }) { |
31 | const { webtorrentEnabled, hlsEnabled, objectStorage } = options | 31 | const { webVideoEnabled, hlsEnabled, objectStorage } = options |
32 | 32 | ||
33 | const objectStorageBaseUrlWebTorrent = objectStorage | 33 | const objectStorageBaseUrlWebVideo = objectStorage |
34 | ? objectStorage.getMockWebVideosBaseUrl() | 34 | ? objectStorage.getMockWebVideosBaseUrl() |
35 | : undefined | 35 | : undefined |
36 | 36 | ||
@@ -46,13 +46,13 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
46 | await waitJobs(servers, { runnerJobs: true }) | 46 | await waitJobs(servers, { runnerJobs: true }) |
47 | 47 | ||
48 | for (const server of servers) { | 48 | for (const server of servers) { |
49 | if (webtorrentEnabled) { | 49 | if (webVideoEnabled) { |
50 | await completeWebVideoFilesCheck({ | 50 | await completeWebVideoFilesCheck({ |
51 | server, | 51 | server, |
52 | originServer: servers[0], | 52 | originServer: servers[0], |
53 | fixture: 'video_short.mp4', | 53 | fixture: 'video_short.mp4', |
54 | videoUUID: uuid, | 54 | videoUUID: uuid, |
55 | objectStorageBaseUrl: objectStorageBaseUrlWebTorrent, | 55 | objectStorageBaseUrl: objectStorageBaseUrlWebVideo, |
56 | files: [ | 56 | files: [ |
57 | { resolution: 0 }, | 57 | { resolution: 0 }, |
58 | { resolution: 144 }, | 58 | { resolution: 144 }, |
@@ -66,7 +66,7 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
66 | 66 | ||
67 | if (hlsEnabled) { | 67 | if (hlsEnabled) { |
68 | await completeCheckHlsPlaylist({ | 68 | await completeCheckHlsPlaylist({ |
69 | hlsOnly: !webtorrentEnabled, | 69 | hlsOnly: !webVideoEnabled, |
70 | servers, | 70 | servers, |
71 | videoUUID: uuid, | 71 | videoUUID: uuid, |
72 | objectStorageBaseUrl: objectStorageBaseUrlHLS, | 72 | objectStorageBaseUrl: objectStorageBaseUrlHLS, |
@@ -84,13 +84,13 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
84 | await waitJobs(servers, { runnerJobs: true }) | 84 | await waitJobs(servers, { runnerJobs: true }) |
85 | 85 | ||
86 | for (const server of servers) { | 86 | for (const server of servers) { |
87 | if (webtorrentEnabled) { | 87 | if (webVideoEnabled) { |
88 | await completeWebVideoFilesCheck({ | 88 | await completeWebVideoFilesCheck({ |
89 | server, | 89 | server, |
90 | originServer: servers[0], | 90 | originServer: servers[0], |
91 | fixture: 'video_short.webm', | 91 | fixture: 'video_short.webm', |
92 | videoUUID: uuid, | 92 | videoUUID: uuid, |
93 | objectStorageBaseUrl: objectStorageBaseUrlWebTorrent, | 93 | objectStorageBaseUrl: objectStorageBaseUrlWebVideo, |
94 | files: [ | 94 | files: [ |
95 | { resolution: 0 }, | 95 | { resolution: 0 }, |
96 | { resolution: 144 }, | 96 | { resolution: 144 }, |
@@ -104,7 +104,7 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
104 | 104 | ||
105 | if (hlsEnabled) { | 105 | if (hlsEnabled) { |
106 | await completeCheckHlsPlaylist({ | 106 | await completeCheckHlsPlaylist({ |
107 | hlsOnly: !webtorrentEnabled, | 107 | hlsOnly: !webVideoEnabled, |
108 | servers, | 108 | servers, |
109 | videoUUID: uuid, | 109 | videoUUID: uuid, |
110 | objectStorageBaseUrl: objectStorageBaseUrlHLS, | 110 | objectStorageBaseUrl: objectStorageBaseUrlHLS, |
@@ -123,13 +123,13 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
123 | await waitJobs(servers, { runnerJobs: true }) | 123 | await waitJobs(servers, { runnerJobs: true }) |
124 | 124 | ||
125 | for (const server of servers) { | 125 | for (const server of servers) { |
126 | if (webtorrentEnabled) { | 126 | if (webVideoEnabled) { |
127 | await completeWebVideoFilesCheck({ | 127 | await completeWebVideoFilesCheck({ |
128 | server, | 128 | server, |
129 | originServer: servers[0], | 129 | originServer: servers[0], |
130 | fixture: 'sample.ogg', | 130 | fixture: 'sample.ogg', |
131 | videoUUID: uuid, | 131 | videoUUID: uuid, |
132 | objectStorageBaseUrl: objectStorageBaseUrlWebTorrent, | 132 | objectStorageBaseUrl: objectStorageBaseUrlWebVideo, |
133 | files: [ | 133 | files: [ |
134 | { resolution: 0 }, | 134 | { resolution: 0 }, |
135 | { resolution: 144 }, | 135 | { resolution: 144 }, |
@@ -142,7 +142,7 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
142 | 142 | ||
143 | if (hlsEnabled) { | 143 | if (hlsEnabled) { |
144 | await completeCheckHlsPlaylist({ | 144 | await completeCheckHlsPlaylist({ |
145 | hlsOnly: !webtorrentEnabled, | 145 | hlsOnly: !webVideoEnabled, |
146 | servers, | 146 | servers, |
147 | videoUUID: uuid, | 147 | videoUUID: uuid, |
148 | objectStorageBaseUrl: objectStorageBaseUrlHLS, | 148 | objectStorageBaseUrl: objectStorageBaseUrlHLS, |
@@ -159,13 +159,13 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
159 | 159 | ||
160 | await waitJobs(servers, { runnerJobs: true }) | 160 | await waitJobs(servers, { runnerJobs: true }) |
161 | 161 | ||
162 | if (webtorrentEnabled) { | 162 | if (webVideoEnabled) { |
163 | await completeWebVideoFilesCheck({ | 163 | await completeWebVideoFilesCheck({ |
164 | server: servers[0], | 164 | server: servers[0], |
165 | originServer: servers[0], | 165 | originServer: servers[0], |
166 | fixture: 'video_short.mp4', | 166 | fixture: 'video_short.mp4', |
167 | videoUUID: uuid, | 167 | videoUUID: uuid, |
168 | objectStorageBaseUrl: objectStorageBaseUrlWebTorrent, | 168 | objectStorageBaseUrl: objectStorageBaseUrlWebVideo, |
169 | files: [ | 169 | files: [ |
170 | { resolution: 0 }, | 170 | { resolution: 0 }, |
171 | { resolution: 144 }, | 171 | { resolution: 144 }, |
@@ -179,7 +179,7 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
179 | 179 | ||
180 | if (hlsEnabled) { | 180 | if (hlsEnabled) { |
181 | await completeCheckHlsPlaylist({ | 181 | await completeCheckHlsPlaylist({ |
182 | hlsOnly: !webtorrentEnabled, | 182 | hlsOnly: !webVideoEnabled, |
183 | servers: [ servers[0] ], | 183 | servers: [ servers[0] ], |
184 | videoUUID: uuid, | 184 | videoUUID: uuid, |
185 | objectStorageBaseUrl: objectStorageBaseUrlHLS, | 185 | objectStorageBaseUrl: objectStorageBaseUrlHLS, |
@@ -203,7 +203,7 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
203 | 203 | ||
204 | await servers[0].config.enableTranscoding(true, true, true) | 204 | await servers[0].config.enableTranscoding(true, true, true) |
205 | 205 | ||
206 | await servers[0].videos.runTranscoding({ transcodingType: 'webtorrent', videoId: uuid }) | 206 | await servers[0].videos.runTranscoding({ transcodingType: 'web-video', videoId: uuid }) |
207 | await waitJobs(servers, { runnerJobs: true }) | 207 | await waitJobs(servers, { runnerJobs: true }) |
208 | 208 | ||
209 | await completeWebVideoFilesCheck({ | 209 | await completeWebVideoFilesCheck({ |
@@ -211,7 +211,7 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
211 | originServer: servers[0], | 211 | originServer: servers[0], |
212 | fixture: 'video_short.mp4', | 212 | fixture: 'video_short.mp4', |
213 | videoUUID: uuid, | 213 | videoUUID: uuid, |
214 | objectStorageBaseUrl: objectStorageBaseUrlWebTorrent, | 214 | objectStorageBaseUrl: objectStorageBaseUrlWebVideo, |
215 | files: [ | 215 | files: [ |
216 | { resolution: 0 }, | 216 | { resolution: 0 }, |
217 | { resolution: 144 }, | 217 | { resolution: 144 }, |
@@ -262,7 +262,7 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
262 | await servers[0].config.enableTranscoding(true, false, true) | 262 | await servers[0].config.enableTranscoding(true, false, true) |
263 | }) | 263 | }) |
264 | 264 | ||
265 | runSuite({ webtorrentEnabled: true, hlsEnabled: false }) | 265 | runSuite({ webVideoEnabled: true, hlsEnabled: false }) |
266 | }) | 266 | }) |
267 | 267 | ||
268 | describe('HLS videos only enabled', function () { | 268 | describe('HLS videos only enabled', function () { |
@@ -271,7 +271,7 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
271 | await servers[0].config.enableTranscoding(false, true, true) | 271 | await servers[0].config.enableTranscoding(false, true, true) |
272 | }) | 272 | }) |
273 | 273 | ||
274 | runSuite({ webtorrentEnabled: false, hlsEnabled: true }) | 274 | runSuite({ webVideoEnabled: false, hlsEnabled: true }) |
275 | }) | 275 | }) |
276 | 276 | ||
277 | describe('Web video & HLS enabled', function () { | 277 | describe('Web video & HLS enabled', function () { |
@@ -280,7 +280,7 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
280 | await servers[0].config.enableTranscoding(true, true, true) | 280 | await servers[0].config.enableTranscoding(true, true, true) |
281 | }) | 281 | }) |
282 | 282 | ||
283 | runSuite({ webtorrentEnabled: true, hlsEnabled: true }) | 283 | runSuite({ webVideoEnabled: true, hlsEnabled: true }) |
284 | }) | 284 | }) |
285 | }) | 285 | }) |
286 | 286 | ||
@@ -306,7 +306,7 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
306 | await servers[0].config.enableTranscoding(true, false, true) | 306 | await servers[0].config.enableTranscoding(true, false, true) |
307 | }) | 307 | }) |
308 | 308 | ||
309 | runSuite({ webtorrentEnabled: true, hlsEnabled: false, objectStorage }) | 309 | runSuite({ webVideoEnabled: true, hlsEnabled: false, objectStorage }) |
310 | }) | 310 | }) |
311 | 311 | ||
312 | describe('HLS videos only enabled', function () { | 312 | describe('HLS videos only enabled', function () { |
@@ -315,7 +315,7 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
315 | await servers[0].config.enableTranscoding(false, true, true) | 315 | await servers[0].config.enableTranscoding(false, true, true) |
316 | }) | 316 | }) |
317 | 317 | ||
318 | runSuite({ webtorrentEnabled: false, hlsEnabled: true, objectStorage }) | 318 | runSuite({ webVideoEnabled: false, hlsEnabled: true, objectStorage }) |
319 | }) | 319 | }) |
320 | 320 | ||
321 | describe('Web video & HLS enabled', function () { | 321 | describe('Web video & HLS enabled', function () { |
@@ -324,7 +324,7 @@ describe('Test VOD transcoding in peertube-runner program', function () { | |||
324 | await servers[0].config.enableTranscoding(true, true, true) | 324 | await servers[0].config.enableTranscoding(true, true, true) |
325 | }) | 325 | }) |
326 | 326 | ||
327 | runSuite({ webtorrentEnabled: true, hlsEnabled: true, objectStorage }) | 327 | runSuite({ webVideoEnabled: true, hlsEnabled: true, objectStorage }) |
328 | }) | 328 | }) |
329 | 329 | ||
330 | after(async function () { | 330 | after(async function () { |
diff --git a/server/tests/plugins/plugin-helpers.ts b/server/tests/plugins/plugin-helpers.ts index e951a1299..f5a0cbe85 100644 --- a/server/tests/plugins/plugin-helpers.ts +++ b/server/tests/plugins/plugin-helpers.ts | |||
@@ -302,11 +302,11 @@ describe('Test plugin helpers', function () { | |||
302 | 302 | ||
303 | // Video files check | 303 | // Video files check |
304 | { | 304 | { |
305 | expect(body.webtorrent.videoFiles).to.be.an('array') | 305 | expect(body.webVideo.videoFiles).to.be.an('array') |
306 | expect(body.hls.videoFiles).to.be.an('array') | 306 | expect(body.hls.videoFiles).to.be.an('array') |
307 | 307 | ||
308 | for (const resolution of [ 144, 240, 360, 480, 720 ]) { | 308 | for (const resolution of [ 144, 240, 360, 480, 720 ]) { |
309 | for (const files of [ body.webtorrent.videoFiles, body.hls.videoFiles ]) { | 309 | for (const files of [ body.webVideo.videoFiles, body.hls.videoFiles ]) { |
310 | const file = files.find(f => f.resolution === resolution) | 310 | const file = files.find(f => f.resolution === resolution) |
311 | expect(file).to.exist | 311 | expect(file).to.exist |
312 | 312 | ||
@@ -318,7 +318,7 @@ describe('Test plugin helpers', function () { | |||
318 | } | 318 | } |
319 | } | 319 | } |
320 | 320 | ||
321 | videoPath = body.webtorrent.videoFiles[0].path | 321 | videoPath = body.webVideo.videoFiles[0].path |
322 | } | 322 | } |
323 | 323 | ||
324 | // Thumbnails check | 324 | // Thumbnails check |
diff --git a/server/tests/plugins/plugin-transcoding.ts b/server/tests/plugins/plugin-transcoding.ts index 689eec5ac..f3d929426 100644 --- a/server/tests/plugins/plugin-transcoding.ts +++ b/server/tests/plugins/plugin-transcoding.ts | |||
@@ -247,7 +247,7 @@ describe('Test transcoding plugins', function () { | |||
247 | 247 | ||
248 | const video = await server.videos.get({ id: videoUUID }) | 248 | const video = await server.videos.get({ id: videoUUID }) |
249 | 249 | ||
250 | const path = server.servers.buildWebTorrentFilePath(video.files[0].fileUrl) | 250 | const path = server.servers.buildWebVideoFilePath(video.files[0].fileUrl) |
251 | const audioProbe = await getAudioStream(path) | 251 | const audioProbe = await getAudioStream(path) |
252 | expect(audioProbe.audioStream.codec_name).to.equal('opus') | 252 | expect(audioProbe.audioStream.codec_name).to.equal('opus') |
253 | 253 | ||
diff --git a/server/tests/shared/videos.ts b/server/tests/shared/videos.ts index 0bd161820..6cba5b14c 100644 --- a/server/tests/shared/videos.ts +++ b/server/tests/shared/videos.ts | |||
@@ -215,22 +215,22 @@ async function checkVideoFilesWereRemoved (options: { | |||
215 | }) { | 215 | }) { |
216 | const { video, server, captions = [], onlyVideoFiles = false } = options | 216 | const { video, server, captions = [], onlyVideoFiles = false } = options |
217 | 217 | ||
218 | const webtorrentFiles = video.files || [] | 218 | const webVideoFiles = video.files || [] |
219 | const hlsFiles = video.streamingPlaylists[0]?.files || [] | 219 | const hlsFiles = video.streamingPlaylists[0]?.files || [] |
220 | 220 | ||
221 | const thumbnailName = basename(video.thumbnailPath) | 221 | const thumbnailName = basename(video.thumbnailPath) |
222 | const previewName = basename(video.previewPath) | 222 | const previewName = basename(video.previewPath) |
223 | 223 | ||
224 | const torrentNames = webtorrentFiles.concat(hlsFiles).map(f => basename(f.torrentUrl)) | 224 | const torrentNames = webVideoFiles.concat(hlsFiles).map(f => basename(f.torrentUrl)) |
225 | 225 | ||
226 | const captionNames = captions.map(c => basename(c.captionPath)) | 226 | const captionNames = captions.map(c => basename(c.captionPath)) |
227 | 227 | ||
228 | const webtorrentFilenames = webtorrentFiles.map(f => basename(f.fileUrl)) | 228 | const webVideoFilenames = webVideoFiles.map(f => basename(f.fileUrl)) |
229 | const hlsFilenames = hlsFiles.map(f => basename(f.fileUrl)) | 229 | const hlsFilenames = hlsFiles.map(f => basename(f.fileUrl)) |
230 | 230 | ||
231 | let directories: { [ directory: string ]: string[] } = { | 231 | let directories: { [ directory: string ]: string[] } = { |
232 | videos: webtorrentFilenames, | 232 | videos: webVideoFilenames, |
233 | redundancy: webtorrentFilenames, | 233 | redundancy: webVideoFilenames, |
234 | [join('playlists', 'hls')]: hlsFilenames, | 234 | [join('playlists', 'hls')]: hlsFilenames, |
235 | [join('redundancy', 'hls')]: hlsFilenames | 235 | [join('redundancy', 'hls')]: hlsFilenames |
236 | } | 236 | } |