From bbd5aa7ead5f1554a0872963f957effc26d8c630 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 17 Aug 2022 15:25:58 +0200 Subject: Reimplement a typed omit function --- shared/server-commands/videos/live-command.ts | 5 ++--- shared/server-commands/videos/playlists-command.ts | 7 +++---- shared/server-commands/videos/videos-command.ts | 5 ++--- 3 files changed, 7 insertions(+), 10 deletions(-) (limited to 'shared/server-commands/videos') diff --git a/shared/server-commands/videos/live-command.ts b/shared/server-commands/videos/live-command.ts index 3df47ed4d..d804fd883 100644 --- a/shared/server-commands/videos/live-command.ts +++ b/shared/server-commands/videos/live-command.ts @@ -1,9 +1,8 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import { readdir } from 'fs-extra' -import { omit } from 'lodash' import { join } from 'path' -import { wait } from '@shared/core-utils' +import { omit, wait } from '@shared/core-utils' import { HttpStatusCode, LiveVideo, @@ -103,7 +102,7 @@ export class LiveCommand extends AbstractCommand { path, attaches, - fields: omit(fields, 'thumbnailfile', 'previewfile'), + fields: omit(fields, [ 'thumbnailfile', 'previewfile' ]), implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 })) diff --git a/shared/server-commands/videos/playlists-command.ts b/shared/server-commands/videos/playlists-command.ts index ce23900d3..516da0bf7 100644 --- a/shared/server-commands/videos/playlists-command.ts +++ b/shared/server-commands/videos/playlists-command.ts @@ -1,5 +1,4 @@ -import { omit } from 'lodash' -import { pick } from '@shared/core-utils' +import { omit, pick } from '@shared/core-utils' import { BooleanBothQuery, HttpStatusCode, @@ -136,7 +135,7 @@ export class PlaylistsCommand extends AbstractCommand { }) { const path = '/api/v1/video-playlists' - const fields = omit(options.attributes, 'thumbnailfile') + const fields = omit(options.attributes, [ 'thumbnailfile' ]) const attaches = options.attributes.thumbnailfile ? { thumbnailfile: options.attributes.thumbnailfile } @@ -161,7 +160,7 @@ export class PlaylistsCommand extends AbstractCommand { }) { const path = '/api/v1/video-playlists/' + options.playlistId - const fields = omit(options.attributes, 'thumbnailfile') + const fields = omit(options.attributes, [ 'thumbnailfile' ]) const attaches = options.attributes.thumbnailfile ? { thumbnailfile: options.attributes.thumbnailfile } diff --git a/shared/server-commands/videos/videos-command.ts b/shared/server-commands/videos/videos-command.ts index c0b36d95b..168391523 100644 --- a/shared/server-commands/videos/videos-command.ts +++ b/shared/server-commands/videos/videos-command.ts @@ -3,9 +3,8 @@ import { expect } from 'chai' import { createReadStream, stat } from 'fs-extra' import got, { Response as GotResponse } from 'got' -import { omit } from 'lodash' import validator from 'validator' -import { buildAbsoluteFixturePath, pick, wait } from '@shared/core-utils' +import { buildAbsoluteFixturePath, omit, pick, wait } from '@shared/core-utils' import { buildUUID } from '@shared/extra-utils' import { HttpStatusCode, @@ -484,7 +483,7 @@ export class VideosCommand extends AbstractCommand { }, // Fixture will be sent later - attaches: this.buildUploadAttaches(omit(options.attributes, 'fixture')), + attaches: this.buildUploadAttaches(omit(options.attributes, [ 'fixture' ])), implicitToken: true, defaultExpectedStatus: null -- cgit v1.2.3