import { sha1 } from '@shared/extra-utils'
import { LiveVideo, VideoStreamingPlaylistType } from '@shared/models'
import { ObjectStorageCommand, PeerTubeServer } from '@shared/server-commands'
+import { SQLCommand } from './sql-command'
import { checkLiveSegmentHash, checkResolutionsInMasterPlaylist } from './streaming-playlists'
async function checkLiveCleanup (options: {
// ---------------------------------------------------------------------------
-async function testVideoResolutions (options: {
+async function testLiveVideoResolutions (options: {
+ sqlCommand: SQLCommand
originServer: PeerTubeServer
+
servers: PeerTubeServer[]
liveVideoId: string
resolutions: number[]
}) {
const {
originServer,
+ sqlCommand,
servers,
liveVideoId,
resolutions,
if (originServer.internalServerNumber === server.internalServerNumber) {
const infohash = sha1(`${2 + hlsPlaylist.playlistUrl}+V${i}`)
- const dbInfohashes = await originServer.sql.getPlaylistInfohash(hlsPlaylist.id)
+ const dbInfohashes = await sqlCommand.getPlaylistInfohash(hlsPlaylist.id)
expect(dbInfohashes).to.include(infohash)
}
export {
checkLiveCleanup,
- testVideoResolutions
+ testLiveVideoResolutions
}
// ---------------------------------------------------------------------------