Implement user import/export in server
This commit is contained in:
		
							parent
							
								
									4d63e6f577
								
							
						
					
					
						commit
						8573e5a80a
					
				
					 196 changed files with 5661 additions and 722 deletions
				
			
		| 
						 | 
				
			
			@ -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'> | {} = {}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue