From e6d4b0ff2404dcf0b3a755c3fcc415ffeb6e754d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 Jul 2017 10:59:13 +0200 Subject: Remove any typing from server --- server/models/video/tag.ts | 2 +- server/models/video/video.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'server/models') diff --git a/server/models/video/tag.ts b/server/models/video/tag.ts index d0d8353d7..2992da56d 100644 --- a/server/models/video/tag.ts +++ b/server/models/video/tag.ts @@ -54,7 +54,7 @@ function associate (models) { findOrCreateTags = function (tags: string[], transaction: Sequelize.Transaction) { const tasks: Promise[] = [] tags.forEach(tag => { - const query: any = { + const query: Sequelize.FindOrInitializeOptions = { where: { name: tag }, diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 47d3cad1d..496385b35 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -696,23 +696,23 @@ loadAndPopulateAuthorAndPodAndTags = function (id: string) { } searchAndPopulateAuthorAndPodAndTags = function (value: string, field: string, start: number, count: number, sort: string) { - const podInclude: any = { + const podInclude: Sequelize.IncludeOptions = { model: Video['sequelize'].models.Pod, required: false } - const authorInclude: any = { + const authorInclude: Sequelize.IncludeOptions = { model: Video['sequelize'].models.Author, include: [ podInclude ] } - const tagInclude: any = { + const tagInclude: Sequelize.IncludeOptions = { model: Video['sequelize'].models.Tag } - const query: any = { + const query: Sequelize.FindOptions = { distinct: true, where: createBaseVideosWhere(), offset: start, @@ -723,10 +723,10 @@ searchAndPopulateAuthorAndPodAndTags = function (value: string, field: string, s // Make an exact search with the magnet if (field === 'magnetUri') { const infoHash = magnetUtil.decode(value).infoHash - query.where.infoHash = infoHash + query.where['infoHash'] = infoHash } else if (field === 'tags') { const escapedValue = Video['sequelize'].escape('%' + value + '%') - query.where.id.$in = Video['sequelize'].literal( + query.where['id'].$in = Video['sequelize'].literal( `(SELECT "VideoTags"."videoId" FROM "Tags" INNER JOIN "VideoTags" ON "Tags"."id" = "VideoTags"."tagId" @@ -830,14 +830,14 @@ function createThumbnail (video: VideoInstance, videoPath: string) { } function generateImage (video: VideoInstance, videoPath: string, folder: string, imageName: string, size: string) { - const options: any = { + const options = { filename: imageName, count: 1, folder } if (size) { - options.size = size + options['size'] = size } return new Promise((res, rej) => { -- cgit v1.2.3