+async function ensureSameFilenames (videoUUID: string) {
+ let webtorrentFilenames: string[]
+ let hlsFilenames: string[]
+
+ for (const server of servers) {
+ const video = await server.videos.getWithToken({ id: videoUUID })
+
+ // Ensure we use the same filenames that the origin
+
+ const localWebtorrentFilenames = video.files.map(f => basename(f.fileUrl)).sort()
+ const localHLSFilenames = video.streamingPlaylists[0].files.map(f => basename(f.fileUrl)).sort()
+
+ if (webtorrentFilenames) expect(webtorrentFilenames).to.deep.equal(localWebtorrentFilenames)
+ else webtorrentFilenames = localWebtorrentFilenames
+
+ if (hlsFilenames) expect(hlsFilenames).to.deep.equal(localHLSFilenames)
+ else hlsFilenames = localHLSFilenames
+ }
+
+ return { webtorrentFilenames, hlsFilenames }
+}
+