From e2600d8b261994abbbeb1ff921edaefd267fc122 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 9 Aug 2019 15:04:36 +0200 Subject: Add avatar to prune script --- shared/extra-utils/miscs/miscs.ts | 5 +++++ shared/extra-utils/videos/videos.ts | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'shared') diff --git a/shared/extra-utils/miscs/miscs.ts b/shared/extra-utils/miscs/miscs.ts index ae8a26c98..6b0f6d990 100644 --- a/shared/extra-utils/miscs/miscs.ts +++ b/shared/extra-utils/miscs/miscs.ts @@ -44,6 +44,10 @@ function root () { return root } +function buildServerDirectory (internalServerNumber: number, directory: string) { + return join(root(), 'test' + internalServerNumber, directory) +} + async function testImage (url: string, imageName: string, imagePath: string, extension = '.jpg') { const res = await request(url) .get(imagePath) @@ -105,6 +109,7 @@ async function generateHighBitrateVideo () { export { dateIsValid, wait, + buildServerDirectory, webtorrentAdd, immutableAssign, testImage, diff --git a/shared/extra-utils/videos/videos.ts b/shared/extra-utils/videos/videos.ts index 1533f37ab..75f7d58d7 100644 --- a/shared/extra-utils/videos/videos.ts +++ b/shared/extra-utils/videos/videos.ts @@ -19,7 +19,7 @@ import { import * as validator from 'validator' import { VideoDetails, VideoPrivacy } from '../../models/videos' import { VIDEO_CATEGORIES, VIDEO_LANGUAGES, loadLanguages, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../server/initializers/constants' -import { dateIsValid, webtorrentAdd } from '../miscs/miscs' +import { dateIsValid, webtorrentAdd, buildServerDirectory } from '../miscs/miscs' loadLanguages() @@ -308,10 +308,8 @@ async function checkVideoFilesWereRemoved ( join('redundancy', 'hls') ] ) { - const testDirectory = 'test' + serverNumber - for (const directory of directories) { - const directoryPath = join(root(), testDirectory, directory) + const directoryPath = buildServerDirectory(serverNumber, directory) const directoryExists = await pathExists(directoryPath) if (directoryExists === false) continue -- cgit v1.2.3