aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r--server/models/video/video.ts16
1 files changed, 8 insertions, 8 deletions
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) {
696} 696}
697 697
698searchAndPopulateAuthorAndPodAndTags = function (value: string, field: string, start: number, count: number, sort: string) { 698searchAndPopulateAuthorAndPodAndTags = function (value: string, field: string, start: number, count: number, sort: string) {
699 const podInclude: any = { 699 const podInclude: Sequelize.IncludeOptions = {
700 model: Video['sequelize'].models.Pod, 700 model: Video['sequelize'].models.Pod,
701 required: false 701 required: false
702 } 702 }
703 703
704 const authorInclude: any = { 704 const authorInclude: Sequelize.IncludeOptions = {
705 model: Video['sequelize'].models.Author, 705 model: Video['sequelize'].models.Author,
706 include: [ 706 include: [
707 podInclude 707 podInclude
708 ] 708 ]
709 } 709 }
710 710
711 const tagInclude: any = { 711 const tagInclude: Sequelize.IncludeOptions = {
712 model: Video['sequelize'].models.Tag 712 model: Video['sequelize'].models.Tag
713 } 713 }
714 714
715 const query: any = { 715 const query: Sequelize.FindOptions = {
716 distinct: true, 716 distinct: true,
717 where: createBaseVideosWhere(), 717 where: createBaseVideosWhere(),
718 offset: start, 718 offset: start,
@@ -723,10 +723,10 @@ searchAndPopulateAuthorAndPodAndTags = function (value: string, field: string, s
723 // Make an exact search with the magnet 723 // Make an exact search with the magnet
724 if (field === 'magnetUri') { 724 if (field === 'magnetUri') {
725 const infoHash = magnetUtil.decode(value).infoHash 725 const infoHash = magnetUtil.decode(value).infoHash
726 query.where.infoHash = infoHash 726 query.where['infoHash'] = infoHash
727 } else if (field === 'tags') { 727 } else if (field === 'tags') {
728 const escapedValue = Video['sequelize'].escape('%' + value + '%') 728 const escapedValue = Video['sequelize'].escape('%' + value + '%')
729 query.where.id.$in = Video['sequelize'].literal( 729 query.where['id'].$in = Video['sequelize'].literal(
730 `(SELECT "VideoTags"."videoId" 730 `(SELECT "VideoTags"."videoId"
731 FROM "Tags" 731 FROM "Tags"
732 INNER JOIN "VideoTags" ON "Tags"."id" = "VideoTags"."tagId" 732 INNER JOIN "VideoTags" ON "Tags"."id" = "VideoTags"."tagId"
@@ -830,14 +830,14 @@ function createThumbnail (video: VideoInstance, videoPath: string) {
830} 830}
831 831
832function generateImage (video: VideoInstance, videoPath: string, folder: string, imageName: string, size: string) { 832function generateImage (video: VideoInstance, videoPath: string, folder: string, imageName: string, size: string) {
833 const options: any = { 833 const options = {
834 filename: imageName, 834 filename: imageName,
835 count: 1, 835 count: 1,
836 folder 836 folder
837 } 837 }
838 838
839 if (size) { 839 if (size) {
840 options.size = size 840 options['size'] = size
841 } 841 }
842 842
843 return new Promise<string>((res, rej) => { 843 return new Promise<string>((res, rej) => {