mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 09:49:20 +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
|
@ -5,6 +5,7 @@ import { isArray } from './custom-validators/misc.js'
|
|||
import { buildDigest } from './peertube-crypto.js'
|
||||
import type { signJsonLDObject } from './peertube-jsonld.js'
|
||||
import { doJSONRequest } from './requests.js'
|
||||
import { logger } from './logger.js'
|
||||
|
||||
export type ContextFilter = <T>(arg: T) => Promise<T>
|
||||
|
||||
|
@ -36,7 +37,13 @@ export async function signAndContextify<T> (options: {
|
|||
? await activityPubContextify(data, contextType, contextFilter)
|
||||
: data
|
||||
|
||||
return signerFunction({ byActor, data: activity })
|
||||
try {
|
||||
return await signerFunction({ byActor, data: activity })
|
||||
} catch (err) {
|
||||
logger.debug('Cannot sign activity', { activity, err })
|
||||
|
||||
throw err
|
||||
}
|
||||
}
|
||||
|
||||
export async function getApplicationActorOfHost (host: string) {
|
||||
|
@ -117,6 +124,8 @@ const contextStore: { [id in ContextType]: (string | { [id: string]: string })[]
|
|||
},
|
||||
|
||||
originallyPublishedAt: 'sc:datePublished',
|
||||
schedules: 'sc:eventSchedule',
|
||||
startDate: 'sc:startDate',
|
||||
|
||||
uploadDate: 'sc:uploadDate',
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue