Make tslint happy
authorChocobozzz <florian.bigard@gmail.com>
Mon, 4 Sep 2017 19:45:05 +0000 (21:45 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Mon, 4 Sep 2017 19:45:05 +0000 (21:45 +0200)
client/src/app/shared/forms/form-validators/user.ts
server/controllers/api/remote/videos.ts
server/initializers/constants.ts
server/lib/request/request-video-qadu-scheduler.ts
server/middlewares/validators/videos.ts
server/models/video/video.ts

index 087a9976092ca06ffd596e0fed4438f507806bb5..d4c4c1d33a905f0d8e07d90e49d64836f4aeb5e9 100644 (file)
@@ -28,4 +28,4 @@ export const USER_VIDEO_QUOTA = {
     'required': 'Video quota is required.',
     'min': 'Quota must be greater than -1.'
   }
-}
\ No newline at end of file
+}
index 0a90549af43179174b79cc22b4b3052c24737fd8..f7ee0356a362fce71aa46a20cc37c12b5fdfce30 100644 (file)
@@ -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 = {}
index 2e3472d1e1c4697426055a9ef0259b7bead5724f..e6af406e386bab2f8f7cd5827f5235d5cdceb029 100644 (file)
@@ -77,7 +77,7 @@ const CONFIG = {
   },
   SIGNUP: {
     ENABLED: config.get<boolean>('signup.enabled'),
-    LIMIT: config.get<number>('signup.limit'),
+    LIMIT: config.get<number>('signup.limit')
   },
   USER: {
     VIDEO_QUOTA: config.get<number>('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')
index afb9d5c23ba9cabb5e13e26bc1c4a425d27d1c0a..d7e1d5e318437ce48c3c50e9a6d38b1712b2c607 100644 (file)
@@ -81,21 +81,21 @@ class RequestVideoQaduScheduler extends AbstractRequestScheduler<RequestsVideoQa
         if (!videoData) videoData = { uuid: null }
 
         switch (request.type) {
-          case REQUEST_VIDEO_QADU_TYPES.LIKES:
-            videoData.likes = video.likes
-            break
+        case REQUEST_VIDEO_QADU_TYPES.LIKES:
+          videoData.likes = video.likes
+          break
 
-          case REQUEST_VIDEO_QADU_TYPES.DISLIKES:
-            videoData.dislikes = video.dislikes
-            break
+        case REQUEST_VIDEO_QADU_TYPES.DISLIKES:
+          videoData.dislikes = video.dislikes
+          break
 
-          case REQUEST_VIDEO_QADU_TYPES.VIEWS:
-            videoData.views = video.views
-            break
+        case REQUEST_VIDEO_QADU_TYPES.VIEWS:
+          videoData.views = video.views
+          break
 
-          default:
-            logger.error('Unknown request video QADU type %s.', request.type)
-            return
+        default:
+          logger.error('Unknown request video QADU type %s.', request.type)
+          return
         }
 
         // Do not forget the uuid so the remote pod can identify the video
@@ -103,12 +103,12 @@ class RequestVideoQaduScheduler extends AbstractRequestScheduler<RequestsVideoQa
         requestsToMakeGrouped[hashKey].ids.push(request.id)
 
         // Maybe there are multiple quick and dirty update for the same video
-        // We use this hashmap to dedupe them
+        // We use this hash map to dedupe them
         requestsToMakeGrouped[hashKey].videos[video.id] = videoData
       })
     })
 
-    // Now we deduped similar quick and dirty updates, we can build our requests datas
+    // Now we deduped similar quick and dirty updates, we can build our requests data
     Object.keys(requestsToMakeGrouped).forEach(hashKey => {
       Object.keys(requestsToMakeGrouped[hashKey].videos).forEach(videoUUID => {
         const videoData = requestsToMakeGrouped[hashKey].videos[videoUUID]
@@ -118,7 +118,7 @@ class RequestVideoQaduScheduler extends AbstractRequestScheduler<RequestsVideoQa
         })
       })
 
-      // We don't need it anymore, it was just to build our datas array
+      // We don't need it anymore, it was just to build our data array
       delete requestsToMakeGrouped[hashKey].videos
     })
 
index 1d19ebfd91681d1650cc04c842bfa4660e5ac7df..576814fcb21c297b7c04404cbceeac401db3653e 100644 (file)
@@ -39,7 +39,7 @@ function videosAddValidator (req: express.Request, res: express.Response, next:
       })
       .then(duration => {
         // 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).')
index 4fb4485d8ada89799b744f68fc104b2869f39cd8..8c69fe189e98e6992e4a008010e4978aec8e4b0c 100644 (file)
@@ -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,