+function syncComments (video: MVideo, fetchedVideo: VideoObject, isSync: boolean) {
+ if (!isSync) {
+ return createJob({ uri: fetchedVideo.comments, videoId: video.id, type: 'video-comments' })
+ }
+
+ const handler = items => addVideoComments(items)
+ const cleaner = crawlStartDate => VideoCommentModel.cleanOldCommentsOf(video.id, crawlStartDate)
+
+ return crawlCollectionPage<string>(fetchedVideo.comments, handler, cleaner)
+ .catch(err => logger.error('Cannot add comments of video %s.', video.uuid, { err, rootUrl: fetchedVideo.comments }))