diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-08 15:54:39 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | e6346d59e63135cf012ed18c102d3b0179ef565f (patch) | |
tree | e65259adb50daa6376c9878abeef051d99191328 /shared/extra-utils/videos/playlists.ts | |
parent | 72cbfc5695ec5ebdb9721d3648218f63feeaeac5 (diff) | |
download | PeerTube-e6346d59e63135cf012ed18c102d3b0179ef565f.tar.gz PeerTube-e6346d59e63135cf012ed18c102d3b0179ef565f.tar.zst PeerTube-e6346d59e63135cf012ed18c102d3b0179ef565f.zip |
Introduce playlist command
Diffstat (limited to 'shared/extra-utils/videos/playlists.ts')
-rw-r--r-- | shared/extra-utils/videos/playlists.ts | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/shared/extra-utils/videos/playlists.ts b/shared/extra-utils/videos/playlists.ts new file mode 100644 index 000000000..023333c87 --- /dev/null +++ b/shared/extra-utils/videos/playlists.ts | |||
@@ -0,0 +1,25 @@ | |||
1 | import { expect } from 'chai' | ||
2 | import { readdir } from 'fs-extra' | ||
3 | import { join } from 'path' | ||
4 | import { root } from '../' | ||
5 | |||
6 | async function checkPlaylistFilesWereRemoved ( | ||
7 | playlistUUID: string, | ||
8 | internalServerNumber: number, | ||
9 | directories = [ 'thumbnails' ] | ||
10 | ) { | ||
11 | const testDirectory = 'test' + internalServerNumber | ||
12 | |||
13 | for (const directory of directories) { | ||
14 | const directoryPath = join(root(), testDirectory, directory) | ||
15 | |||
16 | const files = await readdir(directoryPath) | ||
17 | for (const file of files) { | ||
18 | expect(file).to.not.contain(playlistUUID) | ||
19 | } | ||
20 | } | ||
21 | } | ||
22 | |||
23 | export { | ||
24 | checkPlaylistFilesWereRemoved | ||
25 | } | ||