From b32b78271856ee12fdce5fadc7ed0fe81ecaeff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bertron?= Date: Sat, 24 Mar 2018 19:40:48 +0100 Subject: Limit comment length to 1 character, fixes #394 (#399) --- server/initializers/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'server') diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 705d9b520..481b21bbb 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -226,7 +226,7 @@ const CONSTRAINTS_FIELDS = { COUNT: { min: 0 } }, VIDEO_COMMENTS: { - TEXT: { min: 2, max: 3000 }, // Length + TEXT: { min: 1, max: 3000 }, // Length URL: { min: 3, max: 2000 } // Length }, VIDEO_SHARE: { -- cgit v1.2.3 From f5b611f9ee8b6cb6236cf01c4963eb01bdadb7c9 Mon Sep 17 00:00:00 2001 From: Okhin Date: Sat, 24 Mar 2018 20:11:37 +0100 Subject: Replacing the err being thrown by a gracefull exit.process(1) --- server/tools/import-videos.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'server') diff --git a/server/tools/import-videos.ts b/server/tools/import-videos.ts index 433cee652..72223a01a 100644 --- a/server/tools/import-videos.ts +++ b/server/tools/import-videos.ts @@ -53,7 +53,10 @@ async function run () { const options = [ '-j', '--flat-playlist', '--playlist-reverse' ] youtubeDL.getInfo(program['targetUrl'], options, processOptions, async (err, info) => { - if (err) throw err + if (err) { + console.log(err.message); + process.exit(1); + } let infoArray: any[] @@ -157,7 +160,8 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, languag await uploadVideo(program['url'], accessToken, videoAttributes) } else { - throw err + console.log(err.message); + process.exit(1); } } -- cgit v1.2.3 From 5c5638a062d90a0f0cd5f6e8ccb3589099668e79 Mon Sep 17 00:00:00 2001 From: Okhin Date: Sat, 24 Mar 2018 20:47:42 +0100 Subject: Removing unnecessary semicolons --- server/tools/import-videos.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'server') diff --git a/server/tools/import-videos.ts b/server/tools/import-videos.ts index 72223a01a..baaedd329 100644 --- a/server/tools/import-videos.ts +++ b/server/tools/import-videos.ts @@ -54,8 +54,8 @@ async function run () { const options = [ '-j', '--flat-playlist', '--playlist-reverse' ] youtubeDL.getInfo(program['targetUrl'], options, processOptions, async (err, info) => { if (err) { - console.log(err.message); - process.exit(1); + console.log(err.message) + process.exit(1) } let infoArray: any[] @@ -160,8 +160,8 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, languag await uploadVideo(program['url'], accessToken, videoAttributes) } else { - console.log(err.message); - process.exit(1); + console.log(err.message) + process.exit(1) } } -- cgit v1.2.3