diff options
Diffstat (limited to 'server/tools/import-videos.ts')
-rw-r--r-- | server/tools/import-videos.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/tools/import-videos.ts b/server/tools/import-videos.ts index baaedd329..27d0732a6 100644 --- a/server/tools/import-videos.ts +++ b/server/tools/import-videos.ts | |||
@@ -6,6 +6,7 @@ import { unlinkPromise } from '../helpers/core-utils' | |||
6 | import { doRequestAndSaveToFile } from '../helpers/requests' | 6 | import { doRequestAndSaveToFile } from '../helpers/requests' |
7 | import { CONSTRAINTS_FIELDS } from '../initializers' | 7 | import { CONSTRAINTS_FIELDS } from '../initializers' |
8 | import { getClient, getVideoCategories, login, searchVideo, uploadVideo } from '../tests/utils' | 8 | import { getClient, getVideoCategories, login, searchVideo, uploadVideo } from '../tests/utils' |
9 | import { truncate } from 'lodash' | ||
9 | 10 | ||
10 | program | 11 | program |
11 | .option('-u, --url <url>', 'Server url') | 12 | .option('-u, --url <url>', 'Server url') |
@@ -133,7 +134,11 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, languag | |||
133 | } | 134 | } |
134 | 135 | ||
135 | const videoAttributes = { | 136 | const videoAttributes = { |
136 | name: videoInfo.title, | 137 | name: truncate(videoInfo.title, { |
138 | 'length': CONSTRAINTS_FIELDS.VIDEOS.NAME.max, | ||
139 | 'separator': /,? +/, | ||
140 | 'omission': ' […]' | ||
141 | }), | ||
137 | category, | 142 | category, |
138 | licence, | 143 | licence, |
139 | language, | 144 | language, |