Regenerate miniature on live save
This commit is contained in:
parent
3bc68dfd61
commit
053aed43fb
|
@ -339,10 +339,8 @@ export class PeertubePlayerManager {
|
||||||
const resolution = Math.min(level.height || 0, level.width || 0)
|
const resolution = Math.min(level.height || 0, level.width || 0)
|
||||||
|
|
||||||
const file = p2pMediaLoaderOptions.videoFiles.find(f => f.resolution.id === resolution)
|
const file = p2pMediaLoaderOptions.videoFiles.find(f => f.resolution.id === resolution)
|
||||||
if (!file) {
|
// We don't have files for live videos
|
||||||
console.error('Cannot find video file for level %d.', level.height)
|
if (!file) return level.height
|
||||||
return level.height
|
|
||||||
}
|
|
||||||
|
|
||||||
let label = file.resolution.label
|
let label = file.resolution.label
|
||||||
if (file.fps >= 50) label += file.fps
|
if (file.fps >= 50) label += file.fps
|
||||||
|
|
|
@ -1,11 +1,22 @@
|
||||||
import * as express from 'express'
|
|
||||||
import * as cors from 'cors'
|
import * as cors from 'cors'
|
||||||
|
import * as express from 'express'
|
||||||
|
import { getRateUrl } from '@server/lib/activitypub/video-rates'
|
||||||
|
import { getServerActor } from '@server/models/application/application'
|
||||||
|
import { MAccountId, MActorId, MChannelId, MVideoId } from '@server/types/models'
|
||||||
import { VideoPrivacy, VideoRateType } from '../../../shared/models/videos'
|
import { VideoPrivacy, VideoRateType } from '../../../shared/models/videos'
|
||||||
|
import { VideoPlaylistPrivacy } from '../../../shared/models/videos/playlist/video-playlist-privacy.model'
|
||||||
import { activityPubCollectionPagination, activityPubContextify } from '../../helpers/activitypub'
|
import { activityPubCollectionPagination, activityPubContextify } from '../../helpers/activitypub'
|
||||||
import { ROUTE_CACHE_LIFETIME, WEBSERVER } from '../../initializers/constants'
|
import { ROUTE_CACHE_LIFETIME, WEBSERVER } from '../../initializers/constants'
|
||||||
import { buildAnnounceWithVideoAudience, buildLikeActivity } from '../../lib/activitypub/send'
|
|
||||||
import { audiencify, getAudience } from '../../lib/activitypub/audience'
|
import { audiencify, getAudience } from '../../lib/activitypub/audience'
|
||||||
|
import { buildAnnounceWithVideoAudience, buildLikeActivity } from '../../lib/activitypub/send'
|
||||||
import { buildCreateActivity } from '../../lib/activitypub/send/send-create'
|
import { buildCreateActivity } from '../../lib/activitypub/send/send-create'
|
||||||
|
import { buildDislikeActivity } from '../../lib/activitypub/send/send-dislike'
|
||||||
|
import {
|
||||||
|
getVideoCommentsActivityPubUrl,
|
||||||
|
getVideoDislikesActivityPubUrl,
|
||||||
|
getVideoLikesActivityPubUrl,
|
||||||
|
getVideoSharesActivityPubUrl
|
||||||
|
} from '../../lib/activitypub/url'
|
||||||
import {
|
import {
|
||||||
asyncMiddleware,
|
asyncMiddleware,
|
||||||
executeIfActivityPub,
|
executeIfActivityPub,
|
||||||
|
@ -14,30 +25,19 @@ import {
|
||||||
videosCustomGetValidator,
|
videosCustomGetValidator,
|
||||||
videosShareValidator
|
videosShareValidator
|
||||||
} from '../../middlewares'
|
} from '../../middlewares'
|
||||||
|
import { cacheRoute } from '../../middlewares/cache'
|
||||||
import { getAccountVideoRateValidatorFactory, videoCommentGetValidator } from '../../middlewares/validators'
|
import { getAccountVideoRateValidatorFactory, videoCommentGetValidator } from '../../middlewares/validators'
|
||||||
|
import { videoFileRedundancyGetValidator, videoPlaylistRedundancyGetValidator } from '../../middlewares/validators/redundancy'
|
||||||
|
import { videoPlaylistElementAPGetValidator, videoPlaylistsGetValidator } from '../../middlewares/validators/videos/video-playlists'
|
||||||
import { AccountModel } from '../../models/account/account'
|
import { AccountModel } from '../../models/account/account'
|
||||||
|
import { AccountVideoRateModel } from '../../models/account/account-video-rate'
|
||||||
import { ActorFollowModel } from '../../models/activitypub/actor-follow'
|
import { ActorFollowModel } from '../../models/activitypub/actor-follow'
|
||||||
import { VideoModel } from '../../models/video/video'
|
import { VideoModel } from '../../models/video/video'
|
||||||
import { VideoCommentModel } from '../../models/video/video-comment'
|
|
||||||
import { VideoShareModel } from '../../models/video/video-share'
|
|
||||||
import { cacheRoute } from '../../middlewares/cache'
|
|
||||||
import { activityPubResponse } from './utils'
|
|
||||||
import { AccountVideoRateModel } from '../../models/account/account-video-rate'
|
|
||||||
import {
|
|
||||||
getVideoCommentsActivityPubUrl,
|
|
||||||
getVideoDislikesActivityPubUrl,
|
|
||||||
getVideoLikesActivityPubUrl,
|
|
||||||
getVideoSharesActivityPubUrl
|
|
||||||
} from '../../lib/activitypub/url'
|
|
||||||
import { VideoCaptionModel } from '../../models/video/video-caption'
|
import { VideoCaptionModel } from '../../models/video/video-caption'
|
||||||
import { videoFileRedundancyGetValidator, videoPlaylistRedundancyGetValidator } from '../../middlewares/validators/redundancy'
|
import { VideoCommentModel } from '../../models/video/video-comment'
|
||||||
import { buildDislikeActivity } from '../../lib/activitypub/send/send-dislike'
|
|
||||||
import { videoPlaylistElementAPGetValidator, videoPlaylistsGetValidator } from '../../middlewares/validators/videos/video-playlists'
|
|
||||||
import { VideoPlaylistModel } from '../../models/video/video-playlist'
|
import { VideoPlaylistModel } from '../../models/video/video-playlist'
|
||||||
import { VideoPlaylistPrivacy } from '../../../shared/models/videos/playlist/video-playlist-privacy.model'
|
import { VideoShareModel } from '../../models/video/video-share'
|
||||||
import { MAccountId, MActorId, MVideoAPWithoutCaption, MVideoId, MChannelId } from '@server/types/models'
|
import { activityPubResponse } from './utils'
|
||||||
import { getServerActor } from '@server/models/application/application'
|
|
||||||
import { getRateUrl } from '@server/lib/activitypub/video-rates'
|
|
||||||
|
|
||||||
const activityPubClientRouter = express.Router()
|
const activityPubClientRouter = express.Router()
|
||||||
activityPubClientRouter.use(cors())
|
activityPubClientRouter.use(cors())
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { getVideoActivityPubUrl } from '@server/lib/activitypub/url'
|
||||||
import { buildLocalVideoFromReq, buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video'
|
import { buildLocalVideoFromReq, buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video'
|
||||||
import { getVideoFilePath } from '@server/lib/video-paths'
|
import { getVideoFilePath } from '@server/lib/video-paths'
|
||||||
import { getServerActor } from '@server/models/application/application'
|
import { getServerActor } from '@server/models/application/application'
|
||||||
import { MVideoDetails, MVideoFullLight } from '@server/types/models'
|
import { MVideoFullLight } from '@server/types/models'
|
||||||
import { VideoCreate, VideoState, VideoUpdate } from '../../../../shared'
|
import { VideoCreate, VideoState, VideoUpdate } from '../../../../shared'
|
||||||
import { VideoFilter } from '../../../../shared/models/videos/video-query.type'
|
import { VideoFilter } from '../../../../shared/models/videos/video-query.type'
|
||||||
import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger'
|
import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as ffmpeg from 'fluent-ffmpeg'
|
import * as ffmpeg from 'fluent-ffmpeg'
|
||||||
import { outputFile, readFile, remove, writeFile } from 'fs-extra'
|
import { readFile, remove, writeFile } from 'fs-extra'
|
||||||
import { dirname, join } from 'path'
|
import { dirname, join } from 'path'
|
||||||
import { VideoFileMetadata } from '@shared/models/videos/video-file-metadata'
|
import { VideoFileMetadata } from '@shared/models/videos/video-file-metadata'
|
||||||
import { getMaxBitrate, getTargetBitrate, VideoResolution } from '../../shared/models/videos'
|
import { getMaxBitrate, getTargetBitrate, VideoResolution } from '../../shared/models/videos'
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { VideoLiveModel } from '@server/models/video/video-live'
|
|
||||||
import * as Bluebird from 'bluebird'
|
import * as Bluebird from 'bluebird'
|
||||||
import { maxBy, minBy } from 'lodash'
|
import { maxBy, minBy } from 'lodash'
|
||||||
import * as magnetUtil from 'magnet-uri'
|
import * as magnetUtil from 'magnet-uri'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import * as request from 'request'
|
import * as request from 'request'
|
||||||
import * as sequelize from 'sequelize'
|
import * as sequelize from 'sequelize'
|
||||||
|
import { VideoLiveModel } from '@server/models/video/video-live'
|
||||||
import {
|
import {
|
||||||
ActivityHashTagObject,
|
ActivityHashTagObject,
|
||||||
ActivityMagnetUrlObject,
|
ActivityMagnetUrlObject,
|
||||||
|
@ -13,8 +13,7 @@ import {
|
||||||
ActivitypubHttpFetcherPayload,
|
ActivitypubHttpFetcherPayload,
|
||||||
ActivityTagObject,
|
ActivityTagObject,
|
||||||
ActivityUrlObject,
|
ActivityUrlObject,
|
||||||
ActivityVideoUrlObject,
|
ActivityVideoUrlObject
|
||||||
VideoState
|
|
||||||
} from '../../../shared/index'
|
} from '../../../shared/index'
|
||||||
import { VideoObject } from '../../../shared/models/activitypub/objects'
|
import { VideoObject } from '../../../shared/models/activitypub/objects'
|
||||||
import { VideoPrivacy } from '../../../shared/models/videos'
|
import { VideoPrivacy } from '../../../shared/models/videos'
|
||||||
|
@ -562,8 +561,6 @@ function isAPHashTagObject (url: any): url is ActivityHashTagObject {
|
||||||
return url && url.type === 'Hashtag'
|
return url && url.type === 'Hashtag'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async function createVideo (videoObject: VideoObject, channel: MChannelAccountLight, waitThumbnail = false) {
|
async function createVideo (videoObject: VideoObject, channel: MChannelAccountLight, waitThumbnail = false) {
|
||||||
logger.debug('Adding remote video %s.', videoObject.id)
|
logger.debug('Adding remote video %s.', videoObject.id)
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,9 @@ import { VideoFileModel } from '@server/models/video/video-file'
|
||||||
import { VideoLiveModel } from '@server/models/video/video-live'
|
import { VideoLiveModel } from '@server/models/video/video-live'
|
||||||
import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist'
|
import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist'
|
||||||
import { MStreamingPlaylist, MVideo, MVideoLive } from '@server/types/models'
|
import { MStreamingPlaylist, MVideo, MVideoLive } from '@server/types/models'
|
||||||
import { VideoLiveEndingPayload, VideoState } from '@shared/models'
|
import { ThumbnailType, VideoLiveEndingPayload, VideoState } from '@shared/models'
|
||||||
import { logger } from '../../../helpers/logger'
|
import { logger } from '../../../helpers/logger'
|
||||||
|
import { generateVideoMiniature } from '@server/lib/thumbnail'
|
||||||
|
|
||||||
async function processVideoLiveEnding (job: Bull.Job) {
|
async function processVideoLiveEnding (job: Bull.Job) {
|
||||||
const payload = job.data as VideoLiveEndingPayload
|
const payload = job.data as VideoLiveEndingPayload
|
||||||
|
@ -109,6 +110,15 @@ async function saveLive (video: MVideo, live: MVideoLive) {
|
||||||
await remove(videoInputPath)
|
await remove(videoInputPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Regenerate the thumbnail & preview?
|
||||||
|
if (videoWithFiles.getMiniature().automaticallyGenerated === true) {
|
||||||
|
await generateVideoMiniature(videoWithFiles, videoWithFiles.getMaxQualityFile(), ThumbnailType.MINIATURE)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (videoWithFiles.getPreview().automaticallyGenerated === true) {
|
||||||
|
await generateVideoMiniature(videoWithFiles, videoWithFiles.getMaxQualityFile(), ThumbnailType.PREVIEW)
|
||||||
|
}
|
||||||
|
|
||||||
await publishAndFederateIfNeeded(video, true)
|
await publishAndFederateIfNeeded(video, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,13 @@ import * as chokidar from 'chokidar'
|
||||||
import { FfmpegCommand } from 'fluent-ffmpeg'
|
import { FfmpegCommand } from 'fluent-ffmpeg'
|
||||||
import { ensureDir, stat } from 'fs-extra'
|
import { ensureDir, stat } from 'fs-extra'
|
||||||
import { basename } from 'path'
|
import { basename } from 'path'
|
||||||
import { computeResolutionsToTranscode, getVideoFileFPS, getVideoFileResolution, getVideoStreamCodec, getVideoStreamSize, runLiveMuxing, runLiveTranscoding } from '@server/helpers/ffmpeg-utils'
|
import {
|
||||||
|
computeResolutionsToTranscode,
|
||||||
|
getVideoFileFPS,
|
||||||
|
getVideoFileResolution,
|
||||||
|
runLiveMuxing,
|
||||||
|
runLiveTranscoding
|
||||||
|
} from '@server/helpers/ffmpeg-utils'
|
||||||
import { logger } from '@server/helpers/logger'
|
import { logger } from '@server/helpers/logger'
|
||||||
import { CONFIG, registerConfigChangedHandler } from '@server/initializers/config'
|
import { CONFIG, registerConfigChangedHandler } from '@server/initializers/config'
|
||||||
import { MEMOIZE_TTL, P2P_MEDIA_LOADER_PEER_VERSION, VIDEO_LIVE, WEBSERVER } from '@server/initializers/constants'
|
import { MEMOIZE_TTL, P2P_MEDIA_LOADER_PEER_VERSION, VIDEO_LIVE, WEBSERVER } from '@server/initializers/constants'
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { extractVideo } from '@server/helpers/video'
|
||||||
function getVideoFilename (videoOrPlaylist: MVideo | MStreamingPlaylistVideo, videoFile: MVideoFile) {
|
function getVideoFilename (videoOrPlaylist: MVideo | MStreamingPlaylistVideo, videoFile: MVideoFile) {
|
||||||
const video = extractVideo(videoOrPlaylist)
|
const video = extractVideo(videoOrPlaylist)
|
||||||
|
|
||||||
if (isStreamingPlaylist(videoOrPlaylist)) {
|
if (videoFile.isHLS()) {
|
||||||
return generateVideoStreamingPlaylistName(video.uuid, videoFile.resolution)
|
return generateVideoStreamingPlaylistName(video.uuid, videoFile.resolution)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ function generateWebTorrentVideoName (uuid: string, resolution: number, extname:
|
||||||
}
|
}
|
||||||
|
|
||||||
function getVideoFilePath (videoOrPlaylist: MVideo | MStreamingPlaylistVideo, videoFile: MVideoFile, isRedundancy = false) {
|
function getVideoFilePath (videoOrPlaylist: MVideo | MStreamingPlaylistVideo, videoFile: MVideoFile, isRedundancy = false) {
|
||||||
if (isStreamingPlaylist(videoOrPlaylist)) {
|
if (videoFile.isHLS()) {
|
||||||
const video = extractVideo(videoOrPlaylist)
|
const video = extractVideo(videoOrPlaylist)
|
||||||
|
|
||||||
return join(getHLSDirectory(video), getVideoFilename(videoOrPlaylist, videoFile))
|
return join(getHLSDirectory(video), getVideoFilename(videoOrPlaylist, videoFile))
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
import { HLS_STREAMING_PLAYLIST_DIRECTORY, P2P_MEDIA_LOADER_PEER_VERSION, WEBSERVER } from '../initializers/constants'
|
import { copyFile, ensureDir, move, remove, stat } from 'fs-extra'
|
||||||
import { basename, extname as extnameUtil, join } from 'path'
|
import { basename, extname as extnameUtil, join } from 'path'
|
||||||
|
import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent'
|
||||||
|
import { MStreamingPlaylistFilesVideo, MVideoFile, MVideoWithAllFiles, MVideoWithFile } from '@server/types/models'
|
||||||
|
import { VideoResolution } from '../../shared/models/videos'
|
||||||
|
import { VideoStreamingPlaylistType } from '../../shared/models/videos/video-streaming-playlist.type'
|
||||||
import {
|
import {
|
||||||
canDoQuickTranscode,
|
canDoQuickTranscode,
|
||||||
getDurationFromVideoFile,
|
getDurationFromVideoFile,
|
||||||
|
@ -9,18 +13,13 @@ import {
|
||||||
TranscodeOptions,
|
TranscodeOptions,
|
||||||
TranscodeOptionsType
|
TranscodeOptionsType
|
||||||
} from '../helpers/ffmpeg-utils'
|
} from '../helpers/ffmpeg-utils'
|
||||||
import { copyFile, ensureDir, move, remove, stat } from 'fs-extra'
|
|
||||||
import { logger } from '../helpers/logger'
|
import { logger } from '../helpers/logger'
|
||||||
import { VideoResolution } from '../../shared/models/videos'
|
|
||||||
import { VideoFileModel } from '../models/video/video-file'
|
|
||||||
import { updateMasterHLSPlaylist, updateSha256VODSegments } from './hls'
|
|
||||||
import { VideoStreamingPlaylistModel } from '../models/video/video-streaming-playlist'
|
|
||||||
import { VideoStreamingPlaylistType } from '../../shared/models/videos/video-streaming-playlist.type'
|
|
||||||
import { CONFIG } from '../initializers/config'
|
import { CONFIG } from '../initializers/config'
|
||||||
import { MStreamingPlaylistFilesVideo, MVideoFile, MVideoWithAllFiles, MVideoWithFile } from '@server/types/models'
|
import { HLS_STREAMING_PLAYLIST_DIRECTORY, P2P_MEDIA_LOADER_PEER_VERSION, WEBSERVER } from '../initializers/constants'
|
||||||
import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent'
|
import { VideoFileModel } from '../models/video/video-file'
|
||||||
|
import { VideoStreamingPlaylistModel } from '../models/video/video-streaming-playlist'
|
||||||
|
import { updateMasterHLSPlaylist, updateSha256VODSegments } from './hls'
|
||||||
import { generateVideoStreamingPlaylistName, getVideoFilename, getVideoFilePath } from './video-paths'
|
import { generateVideoStreamingPlaylistName, getVideoFilename, getVideoFilePath } from './video-paths'
|
||||||
import { spawn } from 'child_process'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optimize the original video file and replace it. The resolution is not changed.
|
* Optimize the original video file and replace it. The resolution is not changed.
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { TagModel } from '@server/models/video/tag'
|
||||||
import { VideoModel } from '@server/models/video/video'
|
import { VideoModel } from '@server/models/video/video'
|
||||||
import { FilteredModelAttributes } from '@server/types'
|
import { FilteredModelAttributes } from '@server/types'
|
||||||
import { MTag, MThumbnail, MVideoTag, MVideoThumbnail, MVideoUUID } from '@server/types/models'
|
import { MTag, MThumbnail, MVideoTag, MVideoThumbnail, MVideoUUID } from '@server/types/models'
|
||||||
import { ThumbnailType, VideoCreate, VideoPrivacy, VideoState } from '@shared/models'
|
import { ThumbnailType, VideoCreate, VideoPrivacy } from '@shared/models'
|
||||||
import { federateVideoIfNeeded } from './activitypub/videos'
|
import { federateVideoIfNeeded } from './activitypub/videos'
|
||||||
import { Notifier } from './notifier'
|
import { Notifier } from './notifier'
|
||||||
import { createVideoMiniatureFromExisting } from './thumbnail'
|
import { createVideoMiniatureFromExisting } from './thumbnail'
|
||||||
|
|
|
@ -333,6 +333,10 @@ export class VideoFileModel extends Model<VideoFileModel> {
|
||||||
return this.size === -1
|
return this.size === -1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isHLS () {
|
||||||
|
return this.videoStreamingPlaylistId !== null
|
||||||
|
}
|
||||||
|
|
||||||
hasSameUniqueKeysThan (other: MVideoFile) {
|
hasSameUniqueKeysThan (other: MVideoFile) {
|
||||||
return this.fps === other.fps &&
|
return this.fps === other.fps &&
|
||||||
this.resolution === other.resolution &&
|
this.resolution === other.resolution &&
|
||||||
|
|
|
@ -3,18 +3,16 @@
|
||||||
import 'mocha'
|
import 'mocha'
|
||||||
import * as chai from 'chai'
|
import * as chai from 'chai'
|
||||||
import { getLiveNotificationSocket } from '@shared/extra-utils/socket/socket-io'
|
import { getLiveNotificationSocket } from '@shared/extra-utils/socket/socket-io'
|
||||||
import { LiveVideo, LiveVideoCreate, User, Video, VideoDetails, VideoPrivacy, VideoState, VideoStreamingPlaylistType } from '@shared/models'
|
import { LiveVideo, LiveVideoCreate, Video, VideoDetails, VideoPrivacy, VideoState, VideoStreamingPlaylistType } from '@shared/models'
|
||||||
import {
|
import {
|
||||||
addVideoToBlacklist,
|
addVideoToBlacklist,
|
||||||
checkLiveCleanup,
|
checkLiveCleanup,
|
||||||
checkResolutionsInMasterPlaylist,
|
checkResolutionsInMasterPlaylist,
|
||||||
cleanupTests,
|
cleanupTests,
|
||||||
createLive,
|
createLive,
|
||||||
createUser,
|
|
||||||
doubleFollow,
|
doubleFollow,
|
||||||
flushAndRunMultipleServers,
|
flushAndRunMultipleServers,
|
||||||
getLive,
|
getLive,
|
||||||
getMyUserInformation,
|
|
||||||
getVideo,
|
getVideo,
|
||||||
getVideoIdFromUUID,
|
getVideoIdFromUUID,
|
||||||
getVideosList,
|
getVideosList,
|
||||||
|
@ -30,7 +28,6 @@ import {
|
||||||
testImage,
|
testImage,
|
||||||
updateCustomSubConfig,
|
updateCustomSubConfig,
|
||||||
updateLive,
|
updateLive,
|
||||||
userLogin,
|
|
||||||
waitJobs,
|
waitJobs,
|
||||||
waitUntilLiveStarts
|
waitUntilLiveStarts
|
||||||
} from '../../../../shared/extra-utils'
|
} from '../../../../shared/extra-utils'
|
||||||
|
@ -39,9 +36,6 @@ const expect = chai.expect
|
||||||
|
|
||||||
describe('Test live', function () {
|
describe('Test live', function () {
|
||||||
let servers: ServerInfo[] = []
|
let servers: ServerInfo[] = []
|
||||||
let userId: number
|
|
||||||
let userAccessToken: string
|
|
||||||
let userChannelId: number
|
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(120000)
|
this.timeout(120000)
|
||||||
|
@ -62,22 +56,6 @@ describe('Test live', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
{
|
|
||||||
const user = { username: 'user1', password: 'superpassword' }
|
|
||||||
const res = await createUser({
|
|
||||||
url: servers[0].url,
|
|
||||||
accessToken: servers[0].accessToken,
|
|
||||||
username: user.username,
|
|
||||||
password: user.password
|
|
||||||
})
|
|
||||||
userId = res.body.user.id
|
|
||||||
|
|
||||||
userAccessToken = await userLogin(servers[0], user)
|
|
||||||
|
|
||||||
const resMe = await getMyUserInformation(servers[0].url, userAccessToken)
|
|
||||||
userChannelId = (resMe.body as User).videoChannels[0].id
|
|
||||||
}
|
|
||||||
|
|
||||||
// Server 1 and server 2 follow each other
|
// Server 1 and server 2 follow each other
|
||||||
await doubleFollow(servers[0], servers[1])
|
await doubleFollow(servers[0], servers[1])
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue