Fix lint
[oweals/peertube.git] / server / lib / activitypub / videos.ts
index 5b429709f7bff2ecb20a870b72119fb7cd45e59f..50e7e5cde4a3536cbb995c85264f9019315a5084 100644 (file)
@@ -1,4 +1,3 @@
-import * as Bluebird from 'bluebird'
 import * as magnetUtil from 'magnet-uri'
 import { join } from 'path'
 import * as request from 'request'
@@ -20,17 +19,16 @@ import { VideoShareModel } from '../../models/video/video-share'
 import { getOrCreateActorAndServerAndModel } from './actor'
 
 function fetchRemoteVideoPreview (video: VideoModel, reject: Function) {
-  // FIXME: use url
   const host = video.VideoChannel.Account.Actor.Server.host
   const path = join(STATIC_PATHS.PREVIEWS, video.getPreviewName())
 
+  // We need to provide a callback, if no we could have an uncaught exception
   return request.get(REMOTE_SCHEME.HTTP + '://' + host + path, err => {
     if (err) reject(err)
   })
 }
 
 async function fetchRemoteVideoDescription (video: VideoModel) {
-  // FIXME: use url
   const host = video.VideoChannel.Account.Actor.Server.host
   const path = video.getDescriptionPath()
   const options = {
@@ -164,7 +162,7 @@ async function getOrCreateVideo (videoObject: VideoTorrentObject, channelActor:
       throw new Error('Cannot find valid files for video %s ' + videoObject.url)
     }
 
-    const tasks: Bluebird<any>[] = videoFileAttributes.map(f => VideoFileModel.create(f, { transaction: t }))
+    const tasks = videoFileAttributes.map(f => VideoFileModel.create(f, { transaction: t }))
     await Promise.all(tasks)
 
     const tags = videoObject.tag.map(t => t.name)