import { FormValidatorService } from '@app/shared'
import { VideoCaptionService } from '@app/shared/video-caption'
import { VideoImportService } from '@app/shared/video-import'
+import { scrollToTop } from '@app/shared/misc/utils'
@Component({
selector: 'my-video-import-torrent',
})
export class VideoImportTorrentComponent extends VideoSend implements OnInit, CanComponentDeactivate {
@Output() firstStepDone = new EventEmitter<string>()
+ @Output() firstStepError = new EventEmitter<void>()
@ViewChild('torrentfileInput') torrentfileInput: ElementRef<HTMLInputElement>
- videoFileName: string
magnetUri = ''
isImportingVideo = false
isUpdatingVideo = false
video: VideoEdit
+ error: string
protected readonly DEFAULT_VIDEO_PRIVACY = VideoPrivacy.PUBLIC
err => {
this.loadingBar.complete()
this.isImportingVideo = false
+ this.firstStepError.emit()
this.notificationsService.error(this.i18n('Error'), err.message)
}
)
},
err => {
- this.isUpdatingVideo = false
- this.notificationsService.error(this.i18n('Error'), err.message)
+ this.error = err.message
+ scrollToTop()
console.error(err)
}
)