aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos/video-imports.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-12-07 14:32:36 +0100
committerGitHub <noreply@github.com>2020-12-07 14:32:36 +0100
commit2d53be0267acc49cda46707b885096193a1f4e9c (patch)
tree887061a34bc67f40acbb96a6278f9544bf83caeb /shared/extra-utils/videos/video-imports.ts
parentadc1f09c0dbd997f34028c1c82d1c118dc8ead80 (diff)
downloadPeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.gz
PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.zst
PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.zip
replace numbers with typed http status codes (#3409)
Diffstat (limited to 'shared/extra-utils/videos/video-imports.ts')
-rw-r--r--shared/extra-utils/videos/video-imports.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/shared/extra-utils/videos/video-imports.ts b/shared/extra-utils/videos/video-imports.ts
index 6249e8a94..52e0075fb 100644
--- a/shared/extra-utils/videos/video-imports.ts
+++ b/shared/extra-utils/videos/video-imports.ts
@@ -1,6 +1,7 @@
1 1
2import { VideoImportCreate } from '../../models/videos' 2import { VideoImportCreate } from '../../models/videos'
3import { makeGetRequest, makeUploadRequest } from '../requests/requests' 3import { makeGetRequest, makeUploadRequest } from '../requests/requests'
4import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
4 5
5function getYoutubeVideoUrl () { 6function getYoutubeVideoUrl () {
6 return 'http://www.youtube.com/watch?v=msX3jv1XdvM' 7 return 'http://www.youtube.com/watch?v=msX3jv1XdvM'
@@ -19,7 +20,12 @@ function getGoodVideoUrl () {
19 return 'https://download.cpy.re/peertube/good_video.mp4' 20 return 'https://download.cpy.re/peertube/good_video.mp4'
20} 21}
21 22
22function importVideo (url: string, token: string, attributes: VideoImportCreate & { torrentfile?: string }, statusCodeExpected = 200) { 23function importVideo (
24 url: string,
25 token: string,
26 attributes: VideoImportCreate & { torrentfile?: string },
27 statusCodeExpected = HttpStatusCode.OK_200
28) {
23 const path = '/api/v1/videos/imports' 29 const path = '/api/v1/videos/imports'
24 30
25 let attaches: any = {} 31 let attaches: any = {}
@@ -46,7 +52,7 @@ function getMyVideoImports (url: string, token: string, sort?: string) {
46 query, 52 query,
47 path, 53 path,
48 token, 54 token,
49 statusCodeExpected: 200 55 statusCodeExpected: HttpStatusCode.OK_200
50 }) 56 })
51} 57}
52 58