diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-05-14 11:10:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 11:10:26 +0200 |
commit | 2158ac90341dc3fcae958540de65032da25c8d6e (patch) | |
tree | a780923d701f3daa130996768e38c1e1b6a0646c /shared/extra-utils/videos | |
parent | 7405b6ba897dbce1b4fd50c92174f1df5ac15adc (diff) | |
download | PeerTube-2158ac90341dc3fcae958540de65032da25c8d6e.tar.gz PeerTube-2158ac90341dc3fcae958540de65032da25c8d6e.tar.zst PeerTube-2158ac90341dc3fcae958540de65032da25c8d6e.zip |
Add server plugin filter hooks for import with torrent and url (#2621)
* Add server plugin filter hooks for import with torrent and url
* WIP: pre and post-import filter hooks
* Rebased
* Cleanup filters to accept imports
Co-authored-by: Chocobozzz <me@florianbigard.com>
Diffstat (limited to 'shared/extra-utils/videos')
-rw-r--r-- | shared/extra-utils/videos/video-imports.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/shared/extra-utils/videos/video-imports.ts b/shared/extra-utils/videos/video-imports.ts index 8e5abd2f5..d235181b0 100644 --- a/shared/extra-utils/videos/video-imports.ts +++ b/shared/extra-utils/videos/video-imports.ts | |||
@@ -15,7 +15,7 @@ function getBadVideoUrl () { | |||
15 | return 'https://download.cpy.re/peertube/bad_video.mp4' | 15 | return 'https://download.cpy.re/peertube/bad_video.mp4' |
16 | } | 16 | } |
17 | 17 | ||
18 | function importVideo (url: string, token: string, attributes: VideoImportCreate) { | 18 | function importVideo (url: string, token: string, attributes: VideoImportCreate & { torrentfile?: string }, statusCodeExpected = 200) { |
19 | const path = '/api/v1/videos/imports' | 19 | const path = '/api/v1/videos/imports' |
20 | 20 | ||
21 | let attaches: any = {} | 21 | let attaches: any = {} |
@@ -27,7 +27,7 @@ function importVideo (url: string, token: string, attributes: VideoImportCreate) | |||
27 | token, | 27 | token, |
28 | attaches, | 28 | attaches, |
29 | fields: attributes, | 29 | fields: attributes, |
30 | statusCodeExpected: 200 | 30 | statusCodeExpected |
31 | }) | 31 | }) |
32 | } | 32 | } |
33 | 33 | ||