diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-09 15:04:36 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-08-09 15:04:36 +0200 |
commit | e2600d8b261994abbbeb1ff921edaefd267fc122 (patch) | |
tree | fb19495cb4ba502324a2318c83cd4936b956fc1c /shared/extra-utils | |
parent | 5bb2eb5660c87700bc70fe82219c1a84e7c7b177 (diff) | |
download | PeerTube-e2600d8b261994abbbeb1ff921edaefd267fc122.tar.gz PeerTube-e2600d8b261994abbbeb1ff921edaefd267fc122.tar.zst PeerTube-e2600d8b261994abbbeb1ff921edaefd267fc122.zip |
Add avatar to prune script
Diffstat (limited to 'shared/extra-utils')
-rw-r--r-- | shared/extra-utils/miscs/miscs.ts | 5 | ||||
-rw-r--r-- | shared/extra-utils/videos/videos.ts | 6 |
2 files changed, 7 insertions, 4 deletions
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 () { | |||
44 | return root | 44 | return root |
45 | } | 45 | } |
46 | 46 | ||
47 | function buildServerDirectory (internalServerNumber: number, directory: string) { | ||
48 | return join(root(), 'test' + internalServerNumber, directory) | ||
49 | } | ||
50 | |||
47 | async function testImage (url: string, imageName: string, imagePath: string, extension = '.jpg') { | 51 | async function testImage (url: string, imageName: string, imagePath: string, extension = '.jpg') { |
48 | const res = await request(url) | 52 | const res = await request(url) |
49 | .get(imagePath) | 53 | .get(imagePath) |
@@ -105,6 +109,7 @@ async function generateHighBitrateVideo () { | |||
105 | export { | 109 | export { |
106 | dateIsValid, | 110 | dateIsValid, |
107 | wait, | 111 | wait, |
112 | buildServerDirectory, | ||
108 | webtorrentAdd, | 113 | webtorrentAdd, |
109 | immutableAssign, | 114 | immutableAssign, |
110 | testImage, | 115 | 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 { | |||
19 | import * as validator from 'validator' | 19 | import * as validator from 'validator' |
20 | import { VideoDetails, VideoPrivacy } from '../../models/videos' | 20 | import { VideoDetails, VideoPrivacy } from '../../models/videos' |
21 | import { VIDEO_CATEGORIES, VIDEO_LANGUAGES, loadLanguages, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../server/initializers/constants' | 21 | import { VIDEO_CATEGORIES, VIDEO_LANGUAGES, loadLanguages, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../server/initializers/constants' |
22 | import { dateIsValid, webtorrentAdd } from '../miscs/miscs' | 22 | import { dateIsValid, webtorrentAdd, buildServerDirectory } from '../miscs/miscs' |
23 | 23 | ||
24 | loadLanguages() | 24 | loadLanguages() |
25 | 25 | ||
@@ -308,10 +308,8 @@ async function checkVideoFilesWereRemoved ( | |||
308 | join('redundancy', 'hls') | 308 | join('redundancy', 'hls') |
309 | ] | 309 | ] |
310 | ) { | 310 | ) { |
311 | const testDirectory = 'test' + serverNumber | ||
312 | |||
313 | for (const directory of directories) { | 311 | for (const directory of directories) { |
314 | const directoryPath = join(root(), testDirectory, directory) | 312 | const directoryPath = buildServerDirectory(serverNumber, directory) |
315 | 313 | ||
316 | const directoryExists = await pathExists(directoryPath) | 314 | const directoryExists = await pathExists(directoryPath) |
317 | if (directoryExists === false) continue | 315 | if (directoryExists === false) continue |