- getStateLabel (video: Video) {
- let suffix: string
-
- if (video.privacy.id !== VideoPrivacy.PRIVATE && video.state.id === VideoState.PUBLISHED) {
- suffix = this.i18n('Published')
- } else if (video.scheduledUpdate) {
- const updateAt = new Date(video.scheduledUpdate.updateAt.toString()).toLocaleString(this.localeId)
- suffix = this.i18n('Publication scheduled on ') + updateAt
- } else if (video.state.id === VideoState.TO_TRANSCODE && video.waitTranscoding === true) {
- suffix = this.i18n('Waiting transcoding')
- } else if (video.state.id === VideoState.TO_TRANSCODE) {
- suffix = this.i18n('To transcode')
- } else if (video.state.id === VideoState.TO_IMPORT) {
- suffix = this.i18n('To import')
- } else {
- return ''
- }
-
- return ' - ' + suffix
- }
-
- protected buildVideoHeight () {
- // In account videos, the video height is fixed
- return this.baseVideoHeight
- }
-
- private spliceVideosById (id: number) {
- let key: any
- for (key of Object.keys(this.loadedPages)) {
- const videos = this.loadedPages[ key ]
- const index = videos.findIndex((v: any) => v.id === id)
-
- if (index !== -1) {
- videos.splice(index, 1)
- return
- }
- }