Merge branch 'release/5.0.0' into develop
This commit is contained in:
commit
9972ace3a3
|
@ -455,7 +455,7 @@ p-table {
|
||||||
background-color: pvar(--mainBackgroundColor) !important;
|
background-color: pvar(--mainBackgroundColor) !important;
|
||||||
|
|
||||||
.caption {
|
.caption {
|
||||||
height: 40px;
|
min-height: 40px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -634,6 +634,11 @@ p-table {
|
||||||
right: 0;
|
right: 0;
|
||||||
color: pvar(--inputPlaceholderColor);
|
color: pvar(--inputPlaceholderColor);
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
|
|
||||||
|
@media screen and (max-width: $small-view) {
|
||||||
|
left: 0;
|
||||||
|
top: 40px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-paginator-first,
|
.p-paginator-first,
|
||||||
|
|
|
@ -483,12 +483,12 @@ class LiveManager {
|
||||||
playlist.p2pMediaLoaderPeerVersion = P2P_MEDIA_LOADER_PEER_VERSION
|
playlist.p2pMediaLoaderPeerVersion = P2P_MEDIA_LOADER_PEER_VERSION
|
||||||
playlist.type = VideoStreamingPlaylistType.HLS
|
playlist.type = VideoStreamingPlaylistType.HLS
|
||||||
|
|
||||||
playlist.assignP2PMediaLoaderInfoHashes(video, allResolutions)
|
|
||||||
|
|
||||||
playlist.storage = CONFIG.OBJECT_STORAGE.ENABLED
|
playlist.storage = CONFIG.OBJECT_STORAGE.ENABLED
|
||||||
? VideoStorage.OBJECT_STORAGE
|
? VideoStorage.OBJECT_STORAGE
|
||||||
: VideoStorage.FILE_SYSTEM
|
: VideoStorage.FILE_SYSTEM
|
||||||
|
|
||||||
|
playlist.assignP2PMediaLoaderInfoHashes(video, allResolutions)
|
||||||
|
|
||||||
return playlist.save()
|
return playlist.save()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -262,6 +262,8 @@ class MuxingSession extends EventEmitter {
|
||||||
const url = await storeHLSFileFromFilename(this.streamingPlaylist, this.streamingPlaylist.playlistFilename)
|
const url = await storeHLSFileFromFilename(this.streamingPlaylist, this.streamingPlaylist.playlistFilename)
|
||||||
|
|
||||||
this.streamingPlaylist.playlistUrl = url
|
this.streamingPlaylist.playlistUrl = url
|
||||||
|
this.streamingPlaylist.assignP2PMediaLoaderInfoHashes(this.videoLive.Video, this.allResolutions)
|
||||||
|
|
||||||
await this.streamingPlaylist.save()
|
await this.streamingPlaylist.save()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error('Cannot upload live master file to object storage.', { err, ...this.lTags() })
|
logger.error('Cannot upload live master file to object storage.', { err, ...this.lTags() })
|
||||||
|
|
|
@ -6,6 +6,7 @@ import { join } from 'path'
|
||||||
import { LiveVideo, VideoStreamingPlaylistType } from '@shared/models'
|
import { LiveVideo, VideoStreamingPlaylistType } from '@shared/models'
|
||||||
import { ObjectStorageCommand, PeerTubeServer } from '@shared/server-commands'
|
import { ObjectStorageCommand, PeerTubeServer } from '@shared/server-commands'
|
||||||
import { checkLiveSegmentHash, checkResolutionsInMasterPlaylist } from './streaming-playlists'
|
import { checkLiveSegmentHash, checkResolutionsInMasterPlaylist } from './streaming-playlists'
|
||||||
|
import { sha1 } from '@shared/extra-utils'
|
||||||
|
|
||||||
async function checkLiveCleanup (options: {
|
async function checkLiveCleanup (options: {
|
||||||
server: PeerTubeServer
|
server: PeerTubeServer
|
||||||
|
@ -101,6 +102,13 @@ async function testVideoResolutions (options: {
|
||||||
segmentName,
|
segmentName,
|
||||||
hlsPlaylist
|
hlsPlaylist
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (originServer.internalServerNumber === server.internalServerNumber) {
|
||||||
|
const infohash = sha1(`${2 + hlsPlaylist.playlistUrl}+V${i}`)
|
||||||
|
const dbInfohashes = await originServer.sql.getPlaylistInfohash(hlsPlaylist.id)
|
||||||
|
|
||||||
|
expect(dbInfohashes).to.include(infohash)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,8 @@ async function checkSegmentHash (options: {
|
||||||
expect(sha256(segmentBody)).to.equal(shaBody[videoName][range])
|
expect(sha256(segmentBody)).to.equal(shaBody[videoName][range])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
async function checkLiveSegmentHash (options: {
|
async function checkLiveSegmentHash (options: {
|
||||||
server: PeerTubeServer
|
server: PeerTubeServer
|
||||||
baseUrlSegment: string
|
baseUrlSegment: string
|
||||||
|
@ -56,6 +58,8 @@ async function checkLiveSegmentHash (options: {
|
||||||
expect(sha256(segmentBody)).to.equal(shaBody[segmentName])
|
expect(sha256(segmentBody)).to.equal(shaBody[segmentName])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
async function checkResolutionsInMasterPlaylist (options: {
|
async function checkResolutionsInMasterPlaylist (options: {
|
||||||
server: PeerTubeServer
|
server: PeerTubeServer
|
||||||
playlistUrl: string
|
playlistUrl: string
|
||||||
|
|
|
@ -86,6 +86,8 @@ export class SQLCommand extends AbstractCommand {
|
||||||
return seq.query(query, options)
|
return seq.query(query, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
setPluginField (pluginName: string, field: string, value: string) {
|
setPluginField (pluginName: string, field: string, value: string) {
|
||||||
const seq = this.getSequelize()
|
const seq = this.getSequelize()
|
||||||
|
|
||||||
|
@ -102,6 +104,17 @@ export class SQLCommand extends AbstractCommand {
|
||||||
return this.setPluginField(pluginName, 'latestVersion', newVersion)
|
return this.setPluginField(pluginName, 'latestVersion', newVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
async getPlaylistInfohash (playlistId: number) {
|
||||||
|
const result = await this.selectQuery('SELECT "p2pMediaLoaderInfohashes" FROM "videoStreamingPlaylist" WHERE id = ' + playlistId)
|
||||||
|
if (!result || result.length === 0) return []
|
||||||
|
|
||||||
|
return result[0].p2pMediaLoaderInfohashes
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
setActorFollowScores (newScore: number) {
|
setActorFollowScores (newScore: number) {
|
||||||
const seq = this.getSequelize()
|
const seq = this.getSequelize()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user