aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
authorAndrés Maldonado <amaldona@etu.utc.fr>2019-01-05 19:55:40 +0100
committerChocobozzz <me@florianbigard.com>2019-02-12 11:19:19 +0100
commit84929846e743f4b5f3971b386ea2c447db8c416f (patch)
treebc774e50d0607137071b6aa23fef88e18dbc9f8c /shared
parent4e553a41fdc67c4da186502522ac99a5ba230453 (diff)
downloadPeerTube-84929846e743f4b5f3971b386ea2c447db8c416f.tar.gz
PeerTube-84929846e743f4b5f3971b386ea2c447db8c416f.tar.zst
PeerTube-84929846e743f4b5f3971b386ea2c447db8c416f.zip
Import original publication date (CLI)
* Import original publication date when importing a video from YouTube using the CLI * Fix lint issues
Diffstat (limited to 'shared')
-rw-r--r--shared/utils/videos/videos.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/shared/utils/videos/videos.ts b/shared/utils/videos/videos.ts
index 16ecbfe84..92dadfb69 100644
--- a/shared/utils/videos/videos.ts
+++ b/shared/utils/videos/videos.ts
@@ -42,6 +42,7 @@ type VideoAttributes = {
42 updateAt: string 42 updateAt: string
43 privacy?: VideoPrivacy 43 privacy?: VideoPrivacy
44 } 44 }
45 originallyPublishedAt?: string
45} 46}
46 47
47function getVideoCategories (url: string) { 48function getVideoCategories (url: string) {
@@ -373,6 +374,10 @@ async function uploadVideo (url: string, accessToken: string, videoAttributesArg
373 } 374 }
374 } 375 }
375 376
377 if (attributes.originallyPublishedAt !== undefined) {
378 req.field('originallyPublishedAt', attributes.originallyPublishedAt)
379 }
380
376 return req.attach('videofile', buildAbsoluteFixturePath(attributes.fixture)) 381 return req.attach('videofile', buildAbsoluteFixturePath(attributes.fixture))
377 .expect(specialStatus) 382 .expect(specialStatus)
378} 383}