aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-17 14:52:23 +0200
committerChocobozzz <me@florianbigard.com>2022-08-17 14:54:01 +0200
commit2ec349aa857b0bd8f26de5cd78981d60c9b98a69 (patch)
treec48e4957d0abb778ee5eaa2474c24a9c88f69260
parent396f6f0140b0f76162e2378fd5a61e2f888673ed (diff)
downloadPeerTube-2ec349aa857b0bd8f26de5cd78981d60c9b98a69.tar.gz
PeerTube-2ec349aa857b0bd8f26de5cd78981d60c9b98a69.tar.zst
PeerTube-2ec349aa857b0bd8f26de5cd78981d60c9b98a69.zip
Prefer using our pick function
-rw-r--r--server/helpers/ffmpeg/ffmpeg-presets.ts2
-rw-r--r--server/lib/activitypub/playlists/shared/url-to-object.ts2
-rw-r--r--server/lib/emailer.ts7
-rw-r--r--server/models/video/sql/video/video-model-get-query-builder.ts2
-rw-r--r--server/models/video/sql/video/videos-id-list-query-builder.ts5
-rw-r--r--server/models/video/sql/video/videos-model-list-query-builder.ts2
-rw-r--r--shared/server-commands/videos/comments-command.ts2
7 files changed, 12 insertions, 10 deletions
diff --git a/server/helpers/ffmpeg/ffmpeg-presets.ts b/server/helpers/ffmpeg/ffmpeg-presets.ts
index 99b39f79a..d1160a4a2 100644
--- a/server/helpers/ffmpeg/ffmpeg-presets.ts
+++ b/server/helpers/ffmpeg/ffmpeg-presets.ts
@@ -1,6 +1,6 @@
1import { FfmpegCommand } from 'fluent-ffmpeg' 1import { FfmpegCommand } from 'fluent-ffmpeg'
2import { pick } from 'lodash'
3import { logger, loggerTagsFactory } from '@server/helpers/logger' 2import { logger, loggerTagsFactory } from '@server/helpers/logger'
3import { pick } from '@shared/core-utils'
4import { AvailableEncoders, EncoderOptions } from '@shared/models' 4import { AvailableEncoders, EncoderOptions } from '@shared/models'
5import { buildStreamSuffix, getScaleFilter, StreamType } from './ffmpeg-commons' 5import { buildStreamSuffix, getScaleFilter, StreamType } from './ffmpeg-commons'
6import { getEncoderBuilderResult } from './ffmpeg-encoders' 6import { getEncoderBuilderResult } from './ffmpeg-encoders'
diff --git a/server/lib/activitypub/playlists/shared/url-to-object.ts b/server/lib/activitypub/playlists/shared/url-to-object.ts
index f895db587..41bee3752 100644
--- a/server/lib/activitypub/playlists/shared/url-to-object.ts
+++ b/server/lib/activitypub/playlists/shared/url-to-object.ts
@@ -1,5 +1,5 @@
1import { isArray } from 'lodash'
2import { isPlaylistElementObjectValid, isPlaylistObjectValid } from '@server/helpers/custom-validators/activitypub/playlist' 1import { isPlaylistElementObjectValid, isPlaylistObjectValid } from '@server/helpers/custom-validators/activitypub/playlist'
2import { isArray } from '@server/helpers/custom-validators/misc'
3import { logger, loggerTagsFactory } from '@server/helpers/logger' 3import { logger, loggerTagsFactory } from '@server/helpers/logger'
4import { doJSONRequest } from '@server/helpers/requests' 4import { doJSONRequest } from '@server/helpers/requests'
5import { PlaylistElementObject, PlaylistObject } from '@shared/models' 5import { PlaylistElementObject, PlaylistObject } from '@shared/models'
diff --git a/server/lib/emailer.ts b/server/lib/emailer.ts
index 9e546de7f..3cdba5c76 100644
--- a/server/lib/emailer.ts
+++ b/server/lib/emailer.ts
@@ -1,7 +1,8 @@
1import { readFileSync } from 'fs-extra' 1import { readFileSync } from 'fs-extra'
2import { isArray, merge } from 'lodash' 2import { merge } from 'lodash'
3import { createTransport, Transporter } from 'nodemailer' 3import { createTransport, Transporter } from 'nodemailer'
4import { join } from 'path' 4import { join } from 'path'
5import { toArray } from '@server/helpers/custom-validators/misc'
5import { root } from '@shared/core-utils' 6import { root } from '@shared/core-utils'
6import { EmailPayload } from '@shared/models' 7import { EmailPayload } from '@shared/models'
7import { SendEmailDefaultOptions } from '../../shared/models/server/emailer.model' 8import { SendEmailDefaultOptions } from '../../shared/models/server/emailer.model'
@@ -158,9 +159,7 @@ class Emailer {
158 subjectPrefix: CONFIG.EMAIL.SUBJECT.PREFIX 159 subjectPrefix: CONFIG.EMAIL.SUBJECT.PREFIX
159 }) 160 })
160 161
161 const toEmails = isArray(options.to) 162 const toEmails = toArray(options.to)
162 ? options.to
163 : [ options.to ]
164 163
165 for (const to of toEmails) { 164 for (const to of toEmails) {
166 const baseOptions: SendEmailDefaultOptions = { 165 const baseOptions: SendEmailDefaultOptions = {
diff --git a/server/models/video/sql/video/video-model-get-query-builder.ts b/server/models/video/sql/video/video-model-get-query-builder.ts
index 29e59c8be..8e90ff641 100644
--- a/server/models/video/sql/video/video-model-get-query-builder.ts
+++ b/server/models/video/sql/video/video-model-get-query-builder.ts
@@ -1,5 +1,5 @@
1import { pick } from 'lodash'
2import { Sequelize, Transaction } from 'sequelize' 1import { Sequelize, Transaction } from 'sequelize'
2import { pick } from '@shared/core-utils'
3import { AbstractVideoQueryBuilder } from './shared/abstract-video-query-builder' 3import { AbstractVideoQueryBuilder } from './shared/abstract-video-query-builder'
4import { VideoFileQueryBuilder } from './shared/video-file-query-builder' 4import { VideoFileQueryBuilder } from './shared/video-file-query-builder'
5import { VideoModelBuilder } from './shared/video-model-builder' 5import { VideoModelBuilder } from './shared/video-model-builder'
diff --git a/server/models/video/sql/video/videos-id-list-query-builder.ts b/server/models/video/sql/video/videos-id-list-query-builder.ts
index 8692a436a..14f903851 100644
--- a/server/models/video/sql/video/videos-id-list-query-builder.ts
+++ b/server/models/video/sql/video/videos-id-list-query-builder.ts
@@ -1,4 +1,4 @@
1import { Sequelize } from 'sequelize' 1import { Sequelize, Transaction } from 'sequelize'
2import validator from 'validator' 2import validator from 'validator'
3import { exists } from '@server/helpers/custom-validators/misc' 3import { exists } from '@server/helpers/custom-validators/misc'
4import { WEBSERVER } from '@server/initializers/constants' 4import { WEBSERVER } from '@server/initializers/constants'
@@ -73,6 +73,9 @@ export type BuildVideosListQueryOptions = {
73 73
74 group?: string 74 group?: string
75 having?: string 75 having?: string
76
77 transaction?: Transaction
78 logging?: boolean
76} 79}
77 80
78export class VideosIdListQueryBuilder extends AbstractRunQuery { 81export class VideosIdListQueryBuilder extends AbstractRunQuery {
diff --git a/server/models/video/sql/video/videos-model-list-query-builder.ts b/server/models/video/sql/video/videos-model-list-query-builder.ts
index 4fe6bc321..3fdac4ed3 100644
--- a/server/models/video/sql/video/videos-model-list-query-builder.ts
+++ b/server/models/video/sql/video/videos-model-list-query-builder.ts
@@ -1,5 +1,5 @@
1import { pick } from 'lodash'
2import { Sequelize } from 'sequelize' 1import { Sequelize } from 'sequelize'
2import { pick } from '@shared/core-utils'
3import { VideoInclude } from '@shared/models' 3import { VideoInclude } from '@shared/models'
4import { AbstractVideoQueryBuilder } from './shared/abstract-video-query-builder' 4import { AbstractVideoQueryBuilder } from './shared/abstract-video-query-builder'
5import { VideoFileQueryBuilder } from './shared/video-file-query-builder' 5import { VideoFileQueryBuilder } from './shared/video-file-query-builder'
diff --git a/shared/server-commands/videos/comments-command.ts b/shared/server-commands/videos/comments-command.ts
index 156cf452f..154ec0c24 100644
--- a/shared/server-commands/videos/comments-command.ts
+++ b/shared/server-commands/videos/comments-command.ts
@@ -1,4 +1,4 @@
1import { pick } from 'lodash' 1import { pick } from '@shared/core-utils'
2import { HttpStatusCode, ResultList, VideoComment, VideoCommentThreads, VideoCommentThreadTree } from '@shared/models' 2import { HttpStatusCode, ResultList, VideoComment, VideoCommentThreads, VideoCommentThreadTree } from '@shared/models'
3import { unwrapBody } from '../requests' 3import { unwrapBody } from '../requests'
4import { AbstractCommand, OverrideCommandOptions } from '../shared' 4import { AbstractCommand, OverrideCommandOptions } from '../shared'