aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools
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
parent2a2c19dfef7a9aa313c6ca0798f271c9a63449a9 (diff)
downloadPeerTube-9d3ef9fe052ed29bd67566754cb28662bd122234.tar.gz
PeerTube-9d3ef9fe052ed29bd67566754cb28662bd122234.tar.zst
PeerTube-9d3ef9fe052ed29bd67566754cb28662bd122234.zip
Use ISO 639 for languages
Diffstat (limited to 'server/tools')
-rw-r--r--server/tools/import-videos.ts6
-rw-r--r--server/tools/upload.ts2
2 files changed, 4 insertions, 4 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 = []
diff --git a/server/tools/upload.ts b/server/tools/upload.ts
index 765e9618a..177d849f3 100644
--- a/server/tools/upload.ts
+++ b/server/tools/upload.ts
@@ -18,7 +18,7 @@ program
18 .option('-c, --category <category number>', 'Category number') 18 .option('-c, --category <category number>', 'Category number')
19 .option('-m, --comments-enabled', 'Enable comments') 19 .option('-m, --comments-enabled', 'Enable comments')
20 .option('-l, --licence <licence number>', 'Licence number') 20 .option('-l, --licence <licence number>', 'Licence number')
21 .option('-L, --language <language number>', 'Language number') 21 .option('-L, --language <language code>', 'Language ISO 639 code (fr or en...)')
22 .option('-d, --video-description <description>', 'Video description') 22 .option('-d, --video-description <description>', 'Video description')
23 .option('-t, --tags <tags>', 'Video tags', list) 23 .option('-t, --tags <tags>', 'Video tags', list)
24 .option('-b, --thumbnail <thumbnailPath>', 'Thumbnail path') 24 .option('-b, --thumbnail <thumbnailPath>', 'Thumbnail path')