mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 10:49:28 +02:00
Add Scheduled Lives functionality (#7144)
* Add Scheduled Lives functionality through originallyPublishedAt Implements #6604 by reusing the originallyPublishedAt field of isLive videos to mark "waiting for live" videos as scheduled at a set time. * Hide scheduled lives from Browse Videos page * Add tests for Scheduled Live videos * Make scheduled lives use a dedicated scheduledAt field in the VideoLive table * Plan live schedules to evolve in the future * Use a dedicated table to store live schedules, so we can add multiple schedules in the future and also add a title, description etc. for a specific schedule * Adapt REST API to use an array to store/get live schedules * Add REST API param so it's the client choice to include or not scheduled lives * Export schedules info in user import/export --------- Co-authored-by: Chocobozzz <me@florianbigard.com>
This commit is contained in:
parent
a5c087d3d4
commit
8c9b4abe45
62 changed files with 858 additions and 148 deletions
|
@ -1,11 +1,18 @@
|
|||
import { LiveVideoLatencyMode } from '@peertube/peertube-models'
|
||||
import { isDateValid } from './misc.js'
|
||||
|
||||
function isLiveLatencyModeValid (value: any) {
|
||||
export function isLiveLatencyModeValid (value: any) {
|
||||
return [ LiveVideoLatencyMode.DEFAULT, LiveVideoLatencyMode.SMALL_LATENCY, LiveVideoLatencyMode.HIGH_LATENCY ].includes(value)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export {
|
||||
isLiveLatencyModeValid
|
||||
export function isLiveScheduleValid (schedule: any) {
|
||||
return isDateValid(schedule?.startAt)
|
||||
}
|
||||
|
||||
export function areLiveSchedulesValid (schedules: any[]) {
|
||||
if (!schedules) return true
|
||||
|
||||
if (!Array.isArray(schedules)) return false
|
||||
|
||||
return schedules.every(schedule => isLiveScheduleValid(schedule))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue