From 980246ea8f1c51a137eaf0c441ef7e3b6fb88810 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 4 Sep 2017 21:45:05 +0200 Subject: Make tslint happy --- server/controllers/api/remote/videos.ts | 34 +++++++++++----------- server/initializers/constants.ts | 4 +-- server/lib/request/request-video-qadu-scheduler.ts | 30 +++++++++---------- server/middlewares/validators/videos.ts | 2 +- server/models/video/video.ts | 1 - 5 files changed, 35 insertions(+), 36 deletions(-) (limited to 'server') diff --git a/server/controllers/api/remote/videos.ts b/server/controllers/api/remote/videos.ts index 0a90549af..f7ee0356a 100644 --- a/server/controllers/api/remote/videos.ts +++ b/server/controllers/api/remote/videos.ts @@ -141,23 +141,23 @@ function processVideosEvents (eventData: RemoteVideoEventData, fromPod: PodInsta let qaduType switch (eventData.eventType) { - case REQUEST_VIDEO_EVENT_TYPES.VIEWS: - columnToUpdate = 'views' - qaduType = REQUEST_VIDEO_QADU_TYPES.VIEWS - break - - case REQUEST_VIDEO_EVENT_TYPES.LIKES: - columnToUpdate = 'likes' - qaduType = REQUEST_VIDEO_QADU_TYPES.LIKES - break - - case REQUEST_VIDEO_EVENT_TYPES.DISLIKES: - columnToUpdate = 'dislikes' - qaduType = REQUEST_VIDEO_QADU_TYPES.DISLIKES - break - - default: - throw new Error('Unknown video event type.') + case REQUEST_VIDEO_EVENT_TYPES.VIEWS: + columnToUpdate = 'views' + qaduType = REQUEST_VIDEO_QADU_TYPES.VIEWS + break + + case REQUEST_VIDEO_EVENT_TYPES.LIKES: + columnToUpdate = 'likes' + qaduType = REQUEST_VIDEO_QADU_TYPES.LIKES + break + + case REQUEST_VIDEO_EVENT_TYPES.DISLIKES: + columnToUpdate = 'dislikes' + qaduType = REQUEST_VIDEO_QADU_TYPES.DISLIKES + break + + default: + throw new Error('Unknown video event type.') } const query = {} diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 2e3472d1e..e6af406e3 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -77,7 +77,7 @@ const CONFIG = { }, SIGNUP: { ENABLED: config.get('signup.enabled'), - LIMIT: config.get('signup.limit'), + LIMIT: config.get('signup.limit') }, USER: { VIDEO_QUOTA: config.get('user.video_quota') @@ -298,7 +298,7 @@ let STATIC_MAX_AGE = '30d' const THUMBNAILS_SIZE = '200x110' const PREVIEWS_SIZE = '640x480' -// Subfolders of cache directory +// Sub folders of cache directory const CACHE = { DIRECTORIES: { PREVIEWS: join(CONFIG.STORAGE.CACHE_DIR, 'previews') diff --git a/server/lib/request/request-video-qadu-scheduler.ts b/server/lib/request/request-video-qadu-scheduler.ts index afb9d5c23..d7e1d5e31 100644 --- a/server/lib/request/request-video-qadu-scheduler.ts +++ b/server/lib/request/request-video-qadu-scheduler.ts @@ -81,21 +81,21 @@ class RequestVideoQaduScheduler extends AbstractRequestScheduler { Object.keys(requestsToMakeGrouped[hashKey].videos).forEach(videoUUID => { const videoData = requestsToMakeGrouped[hashKey].videos[videoUUID] @@ -118,7 +118,7 @@ class RequestVideoQaduScheduler extends AbstractRequestScheduler { // Previous test failed, abort - if (duration === undefined) return + if (duration === undefined) return undefined if (!isVideoDurationValid('' + duration)) { return res.status(400).send('Duration of the video file is too big (max: ' + CONSTRAINTS_FIELDS.VIDEOS.DURATION.max + 's).') diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 4fb4485d8..8c69fe189 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -9,7 +9,6 @@ import * as Sequelize from 'sequelize' import * as Promise from 'bluebird' import { TagInstance } from './tag-interface' -import { UserInstance } from '../user/user-interface' import { logger, isVideoNameValid, -- cgit v1.2.3