From df98563e2104b82b119c00a3cd83cd0dc1242d25 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Jun 2017 14:32:15 +0200 Subject: Use typescript standard and lint all files --- server/controllers/index.ts | 6 +++--- server/helpers/utils.ts | 1 - server/initializers/database.ts | 2 +- server/initializers/migrator.ts | 1 - server/lib/friends.ts | 6 +++++- server/lib/jobs/handlers/video-transcoder.ts | 4 ++-- 6 files changed, 11 insertions(+), 9 deletions(-) (limited to 'server') diff --git a/server/controllers/index.ts b/server/controllers/index.ts index bb56fd7cf..0223a98f1 100644 --- a/server/controllers/index.ts +++ b/server/controllers/index.ts @@ -1,3 +1,3 @@ -export * from './static'; -export * from './client'; -export * from './api'; +export * from './static' +export * from './client' +export * from './api' diff --git a/server/helpers/utils.ts b/server/helpers/utils.ts index 8e489de96..07c1b3f51 100644 --- a/server/helpers/utils.ts +++ b/server/helpers/utils.ts @@ -1,7 +1,6 @@ import * as express from 'express' import { pseudoRandomBytes } from 'crypto' -import { join } from 'path' import { logger } from './logger' diff --git a/server/initializers/database.ts b/server/initializers/database.ts index 1662c1968..47604c6b0 100644 --- a/server/initializers/database.ts +++ b/server/initializers/database.ts @@ -144,7 +144,7 @@ function getModelFiles (modelDirectory: string, callback: (err: Error, filePaths return eachCallback(null) }) - }, function(err: Error) { + }, function (err: Error) { return callback(err, modelFilePaths) }) }) diff --git a/server/initializers/migrator.ts b/server/initializers/migrator.ts index d72c60638..d8faaebc6 100644 --- a/server/initializers/migrator.ts +++ b/server/initializers/migrator.ts @@ -6,7 +6,6 @@ import * as Sequelize from 'sequelize' import { database as db } from './database' import { LAST_MIGRATION_VERSION } from './constants' import { logger } from '../helpers' -import { ApplicationInstance } from '../models' function migrate (finalCallback: (err: Error) => void) { waterfall([ diff --git a/server/lib/friends.ts b/server/lib/friends.ts index d07433a5d..522cb82b3 100644 --- a/server/lib/friends.ts +++ b/server/lib/friends.ts @@ -103,7 +103,11 @@ function quickAndDirtyUpdateVideoToFriends (qaduParam: QaduParam, transaction?: return createVideoQaduRequest(options, callback) } -function quickAndDirtyUpdatesVideoToFriends (qadusParams: QaduParam[], transaction: Sequelize.Transaction, finalCallback: (err: Error) => void) { +function quickAndDirtyUpdatesVideoToFriends ( + qadusParams: QaduParam[], + transaction: Sequelize.Transaction, + finalCallback: (err: Error) => void +) { const tasks = [] qadusParams.forEach(function (qaduParams) { diff --git a/server/lib/jobs/handlers/video-transcoder.ts b/server/lib/jobs/handlers/video-transcoder.ts index efa18ef2d..6f606a7d3 100644 --- a/server/lib/jobs/handlers/video-transcoder.ts +++ b/server/lib/jobs/handlers/video-transcoder.ts @@ -13,9 +13,9 @@ function process (data: { id: string }, callback: (err: Error, videoInstance?: V }) } -function onError (err: Error, jobId: number, video: VideoInstance, callback: () => void) { +function onError (err: Error, jobId: number, video: VideoInstance, callback: (err: Error) => void) { logger.error('Error when transcoding video file in job %d.', jobId, { error: err }) - return callback() + return callback(null) } function onSuccess (data: any, jobId: number, video: VideoInstance, callback: (err: Error) => void) { -- cgit v1.2.3