]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix video import with URL with small titles
authorChocobozzz <me@florianbigard.com>
Tue, 4 Sep 2018 09:34:46 +0000 (11:34 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 4 Sep 2018 09:34:46 +0000 (11:34 +0200)
server/helpers/youtube-dl.ts

index 0afc54fd24d5e22823c882b51f48a345e12ac09c..b0990ff68f1995f71b6514516a9c5f2b5cba3bc5 100644 (file)
@@ -22,9 +22,10 @@ function getYoutubeDLInfo (url: string): Promise<YoutubeDLInfo> {
     youtubeDL.getInfo(url, options, (err, info) => {
       if (err) return rej(err)
 
-      const obj = normalizeObject(info)
+      const obj = buildVideoInfo(normalizeObject(info))
+      if (obj.name && obj.name.length < CONSTRAINTS_FIELDS.VIDEOS.NAME.min) obj.name += ' video'
 
-      return res(buildVideoInfo(obj))
+      return res(obj)
     })
   })
 }