aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/import-videos.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-04-23 14:39:52 +0200
committerChocobozzz <me@florianbigard.com>2018-04-23 14:39:52 +0200
commit9d3ef9fe052ed29bd67566754cb28662bd122234 (patch)
tree7b704dbc0b2c8b4ca18bef2409d640d0019c3d0a /server/tools/import-videos.ts
parent2a2c19dfef7a9aa313c6ca0798f271c9a63449a9 (diff)
downloadPeerTube-9d3ef9fe052ed29bd67566754cb28662bd122234.tar.gz
PeerTube-9d3ef9fe052ed29bd67566754cb28662bd122234.tar.zst
PeerTube-9d3ef9fe052ed29bd67566754cb28662bd122234.zip
Use ISO 639 for languages
Diffstat (limited to 'server/tools/import-videos.ts')
-rw-r--r--server/tools/import-videos.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/tools/import-videos.ts b/server/tools/import-videos.ts
index e6272a433..f773208ab 100644
--- a/server/tools/import-videos.ts
+++ b/server/tools/import-videos.ts
@@ -16,7 +16,7 @@ program
16 .option('-U, --username <username>', 'Username') 16 .option('-U, --username <username>', 'Username')
17 .option('-p, --password <token>', 'Password') 17 .option('-p, --password <token>', 'Password')
18 .option('-t, --target-url <targetUrl>', 'Video target URL') 18 .option('-t, --target-url <targetUrl>', 'Video target URL')
19 .option('-l, --language <languageCode>', 'Language code') 19 .option('-l, --language <languageCode>', 'Language ISO 639 code (fr or en...)')
20 .option('-v, --verbose', 'Verbose mode') 20 .option('-v, --verbose', 'Verbose mode')
21 .parse(process.argv) 21 .parse(process.argv)
22 22
@@ -82,7 +82,7 @@ async function run () {
82 }) 82 })
83} 83}
84 84
85function processVideo (info: any, languageCode: number) { 85function processVideo (info: any, languageCode: string) {
86 return new Promise(async res => { 86 return new Promise(async res => {
87 if (program['verbose']) console.log('Fetching object.', info) 87 if (program['verbose']) console.log('Fetching object.', info)
88 88
@@ -121,7 +121,7 @@ function processVideo (info: any, languageCode: number) {
121 }) 121 })
122} 122}
123 123
124async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, language?: number) { 124async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, language?: string) {
125 const category = await getCategory(videoInfo.categories) 125 const category = await getCategory(videoInfo.categories)
126 const licence = getLicence(videoInfo.license) 126 const licence = getLicence(videoInfo.license)
127 let tags = [] 127 let tags = []