From 508c1b1e9f3b26752a961e945b7fa59b72b30827 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 25 Oct 2022 11:51:20 +0200 Subject: Correctly cleanup files from object storage --- shared/server-commands/videos/videos-command.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'shared/server-commands') diff --git a/shared/server-commands/videos/videos-command.ts b/shared/server-commands/videos/videos-command.ts index 1d6cad351..590244484 100644 --- a/shared/server-commands/videos/videos-command.ts +++ b/shared/server-commands/videos/videos-command.ts @@ -4,7 +4,7 @@ import { expect } from 'chai' import { createReadStream, stat } from 'fs-extra' import got, { Response as GotResponse } from 'got' import validator from 'validator' -import { buildAbsoluteFixturePath, omit, pick, wait } from '@shared/core-utils' +import { buildAbsoluteFixturePath, getAllPrivacies, omit, pick, wait } from '@shared/core-utils' import { buildUUID } from '@shared/extra-utils' import { HttpStatusCode, @@ -15,6 +15,7 @@ import { VideoCreateResult, VideoDetails, VideoFileMetadata, + VideoInclude, VideoPrivacy, VideosCommonQuery, VideoTranscodingCreate @@ -234,6 +235,22 @@ export class VideosCommand extends AbstractCommand { }) } + listAllForAdmin (options: OverrideCommandOptions & VideosCommonQuery = {}) { + const include = VideoInclude.NOT_PUBLISHED_STATE | VideoInclude.BLACKLISTED | VideoInclude.BLOCKED_OWNER + const nsfw = 'both' + const privacyOneOf = getAllPrivacies() + + return this.list({ + ...options, + + include, + nsfw, + privacyOneOf, + + token: this.buildCommonRequestToken({ ...options, implicitToken: true }) + }) + } + listByAccount (options: OverrideCommandOptions & VideosCommonQuery & { handle: string }) { -- cgit v1.2.3