1
0
Fork 0

Implement user import/export in server

This commit is contained in:
Chocobozzz 2024-02-12 10:47:52 +01:00 committed by Chocobozzz
parent 4d63e6f577
commit 8573e5a80a
196 changed files with 5661 additions and 722 deletions

View file

@ -2,7 +2,7 @@ import { LiveVideo, VideoState, type LiveVideoLatencyModeType } from '@peertube/
import { AttributesOnly } from '@peertube/peertube-typescript-utils'
import { CONFIG } from '@server/initializers/config.js'
import { WEBSERVER } from '@server/initializers/constants.js'
import { MVideoLive, MVideoLiveVideoWithSetting } from '@server/types/models/index.js'
import { MVideoLive, MVideoLiveVideoWithSetting, MVideoLiveWithSetting } from '@server/types/models/index.js'
import { Transaction } from 'sequelize'
import {
AllowNull,
@ -149,6 +149,22 @@ export class VideoLiveModel extends Model<Partial<AttributesOnly<VideoLiveModel>
return VideoLiveModel.findOne<MVideoLive>(query)
}
static loadByVideoIdWithSettings (videoId: number) {
const query = {
where: {
videoId
},
include: [
{
model: VideoLiveReplaySettingModel.unscoped(),
required: false
}
]
}
return VideoLiveModel.findOne<MVideoLiveWithSetting>(query)
}
toFormattedJSON (canSeePrivateInformation: boolean): LiveVideo {
let privateInformation: Pick<LiveVideo, 'rtmpUrl' | 'rtmpsUrl' | 'streamKey'> | {} = {}