import { from as observableFrom, Observable } from 'rxjs'
import { concatAll, tap } from 'rxjs/operators'
-import { Component, OnDestroy, OnInit, Inject, LOCALE_ID } from '@angular/core'
+import { Component, OnDestroy, OnInit, Inject, LOCALE_ID, ViewChild } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { Location } from '@angular/common'
import { immutableAssign } from '@app/shared/misc/utils'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { VideoPrivacy, VideoState } from '../../../../../shared/models/videos'
import { ScreenService } from '@app/shared/misc/screen.service'
+import { VideoChangeOwnershipComponent } from './video-change-ownership/video-change-ownership.component'
@Component({
selector: 'my-account-videos',
protected baseVideoWidth = -1
protected baseVideoHeight = 155
+ @ViewChild('videoChangeOwnershipModal') videoChangeOwnershipModal: VideoChangeOwnershipComponent
+
constructor (
protected router: Router,
protected route: ActivatedRoute,
)
}
+ changeOwnership (event: Event, video: Video) {
+ event.preventDefault()
+ this.videoChangeOwnershipModal.show(video)
+ }
+
getStateLabel (video: Video) {
let suffix: string
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 ''
}
private spliceVideosById (id: number) {
for (const key of Object.keys(this.loadedPages)) {
- const videos = this.loadedPages[ key ]
+ const videos: Video[] = this.loadedPages[ key ]
const index = videos.findIndex(v => v.id === id)
if (index !== -1) {