diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-17 14:52:23 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-17 14:54:01 +0200 |
commit | 2ec349aa857b0bd8f26de5cd78981d60c9b98a69 (patch) | |
tree | c48e4957d0abb778ee5eaa2474c24a9c88f69260 | |
parent | 396f6f0140b0f76162e2378fd5a61e2f888673ed (diff) | |
download | PeerTube-2ec349aa857b0bd8f26de5cd78981d60c9b98a69.tar.gz PeerTube-2ec349aa857b0bd8f26de5cd78981d60c9b98a69.tar.zst PeerTube-2ec349aa857b0bd8f26de5cd78981d60c9b98a69.zip |
Prefer using our pick function
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 @@ | |||
1 | import { FfmpegCommand } from 'fluent-ffmpeg' | 1 | import { FfmpegCommand } from 'fluent-ffmpeg' |
2 | import { pick } from 'lodash' | ||
3 | import { logger, loggerTagsFactory } from '@server/helpers/logger' | 2 | import { logger, loggerTagsFactory } from '@server/helpers/logger' |
3 | import { pick } from '@shared/core-utils' | ||
4 | import { AvailableEncoders, EncoderOptions } from '@shared/models' | 4 | import { AvailableEncoders, EncoderOptions } from '@shared/models' |
5 | import { buildStreamSuffix, getScaleFilter, StreamType } from './ffmpeg-commons' | 5 | import { buildStreamSuffix, getScaleFilter, StreamType } from './ffmpeg-commons' |
6 | import { getEncoderBuilderResult } from './ffmpeg-encoders' | 6 | import { 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 @@ | |||
1 | import { isArray } from 'lodash' | ||
2 | import { isPlaylistElementObjectValid, isPlaylistObjectValid } from '@server/helpers/custom-validators/activitypub/playlist' | 1 | import { isPlaylistElementObjectValid, isPlaylistObjectValid } from '@server/helpers/custom-validators/activitypub/playlist' |
2 | import { isArray } from '@server/helpers/custom-validators/misc' | ||
3 | import { logger, loggerTagsFactory } from '@server/helpers/logger' | 3 | import { logger, loggerTagsFactory } from '@server/helpers/logger' |
4 | import { doJSONRequest } from '@server/helpers/requests' | 4 | import { doJSONRequest } from '@server/helpers/requests' |
5 | import { PlaylistElementObject, PlaylistObject } from '@shared/models' | 5 | import { 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 @@ | |||
1 | import { readFileSync } from 'fs-extra' | 1 | import { readFileSync } from 'fs-extra' |
2 | import { isArray, merge } from 'lodash' | 2 | import { merge } from 'lodash' |
3 | import { createTransport, Transporter } from 'nodemailer' | 3 | import { createTransport, Transporter } from 'nodemailer' |
4 | import { join } from 'path' | 4 | import { join } from 'path' |
5 | import { toArray } from '@server/helpers/custom-validators/misc' | ||
5 | import { root } from '@shared/core-utils' | 6 | import { root } from '@shared/core-utils' |
6 | import { EmailPayload } from '@shared/models' | 7 | import { EmailPayload } from '@shared/models' |
7 | import { SendEmailDefaultOptions } from '../../shared/models/server/emailer.model' | 8 | import { 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 @@ | |||
1 | import { pick } from 'lodash' | ||
2 | import { Sequelize, Transaction } from 'sequelize' | 1 | import { Sequelize, Transaction } from 'sequelize' |
2 | import { pick } from '@shared/core-utils' | ||
3 | import { AbstractVideoQueryBuilder } from './shared/abstract-video-query-builder' | 3 | import { AbstractVideoQueryBuilder } from './shared/abstract-video-query-builder' |
4 | import { VideoFileQueryBuilder } from './shared/video-file-query-builder' | 4 | import { VideoFileQueryBuilder } from './shared/video-file-query-builder' |
5 | import { VideoModelBuilder } from './shared/video-model-builder' | 5 | import { 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 @@ | |||
1 | import { Sequelize } from 'sequelize' | 1 | import { Sequelize, Transaction } from 'sequelize' |
2 | import validator from 'validator' | 2 | import validator from 'validator' |
3 | import { exists } from '@server/helpers/custom-validators/misc' | 3 | import { exists } from '@server/helpers/custom-validators/misc' |
4 | import { WEBSERVER } from '@server/initializers/constants' | 4 | import { 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 | ||
78 | export class VideosIdListQueryBuilder extends AbstractRunQuery { | 81 | export 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 @@ | |||
1 | import { pick } from 'lodash' | ||
2 | import { Sequelize } from 'sequelize' | 1 | import { Sequelize } from 'sequelize' |
2 | import { pick } from '@shared/core-utils' | ||
3 | import { VideoInclude } from '@shared/models' | 3 | import { VideoInclude } from '@shared/models' |
4 | import { AbstractVideoQueryBuilder } from './shared/abstract-video-query-builder' | 4 | import { AbstractVideoQueryBuilder } from './shared/abstract-video-query-builder' |
5 | import { VideoFileQueryBuilder } from './shared/video-file-query-builder' | 5 | import { 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 @@ | |||
1 | import { pick } from 'lodash' | 1 | import { pick } from '@shared/core-utils' |
2 | import { HttpStatusCode, ResultList, VideoComment, VideoCommentThreads, VideoCommentThreadTree } from '@shared/models' | 2 | import { HttpStatusCode, ResultList, VideoComment, VideoCommentThreads, VideoCommentThreadTree } from '@shared/models' |
3 | import { unwrapBody } from '../requests' | 3 | import { unwrapBody } from '../requests' |
4 | import { AbstractCommand, OverrideCommandOptions } from '../shared' | 4 | import { AbstractCommand, OverrideCommandOptions } from '../shared' |