Fix live state on user archive import
This commit is contained in:
parent
46950fbcc8
commit
0f67adf98a
2 changed files with 8 additions and 3 deletions
|
@ -14,7 +14,8 @@ import {
|
||||||
VideoCreateResult,
|
VideoCreateResult,
|
||||||
VideoPlaylistPrivacy,
|
VideoPlaylistPrivacy,
|
||||||
VideoPlaylistType,
|
VideoPlaylistType,
|
||||||
VideoPrivacy
|
VideoPrivacy,
|
||||||
|
VideoState
|
||||||
} from '@peertube/peertube-models'
|
} from '@peertube/peertube-models'
|
||||||
import { prepareImportExportTests } from '@tests/shared/import-export.js'
|
import { prepareImportExportTests } from '@tests/shared/import-export.js'
|
||||||
import { areMockObjectStorageTestsDisabled } from '@peertube/peertube-node-utils'
|
import { areMockObjectStorageTestsDisabled } from '@peertube/peertube-node-utils'
|
||||||
|
@ -466,6 +467,8 @@ function runTest (withObjectStorage: boolean) {
|
||||||
expect(video.duration).to.equal(0)
|
expect(video.duration).to.equal(0)
|
||||||
expect(video.files).to.have.lengthOf(0)
|
expect(video.files).to.have.lengthOf(0)
|
||||||
expect(video.streamingPlaylists).to.have.lengthOf(0)
|
expect(video.streamingPlaylists).to.have.lengthOf(0)
|
||||||
|
|
||||||
|
expect(video.state.id).to.equal(VideoState.WAITING_FOR_LIVE)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { LiveVideoLatencyMode, ThumbnailType, VideoExportJSON, VideoPrivacy } from '@peertube/peertube-models'
|
import { LiveVideoLatencyMode, ThumbnailType, VideoExportJSON, VideoPrivacy, VideoState } from '@peertube/peertube-models'
|
||||||
import { logger, loggerTagsFactory } from '@server/helpers/logger.js'
|
import { logger, loggerTagsFactory } from '@server/helpers/logger.js'
|
||||||
import { Hooks } from '@server/lib/plugins/hooks.js'
|
import { Hooks } from '@server/lib/plugins/hooks.js'
|
||||||
import { buildNextVideoState } from '@server/lib/video-state.js'
|
import { buildNextVideoState } from '@server/lib/video-state.js'
|
||||||
|
@ -207,7 +207,9 @@ export class VideosImporter extends AbstractUserImporter <VideoExportJSON, Impor
|
||||||
videoPasswords: videoImportData.passwords,
|
videoPasswords: videoImportData.passwords,
|
||||||
duration,
|
duration,
|
||||||
filename: videoImportData.source?.filename,
|
filename: videoImportData.source?.filename,
|
||||||
state: buildNextVideoState()
|
state: videoImportData.isLive
|
||||||
|
? VideoState.WAITING_FOR_LIVE
|
||||||
|
: buildNextVideoState()
|
||||||
},
|
},
|
||||||
|
|
||||||
liveAttributes: videoImportData.live,
|
liveAttributes: videoImportData.live,
|
||||||
|
|
Loading…
Reference in a new issue