aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos/playlists.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-08 15:54:39 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commite6346d59e63135cf012ed18c102d3b0179ef565f (patch)
treee65259adb50daa6376c9878abeef051d99191328 /shared/extra-utils/videos/playlists.ts
parent72cbfc5695ec5ebdb9721d3648218f63feeaeac5 (diff)
downloadPeerTube-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.ts25
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 @@
1import { expect } from 'chai'
2import { readdir } from 'fs-extra'
3import { join } from 'path'
4import { root } from '../'
5
6async 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
23export {
24 checkPlaylistFilesWereRemoved
25}