aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-15 16:52:15 +0200
committerChocobozzz <me@florianbigard.com>2018-06-15 18:20:56 +0200
commitbbe0f0645ca958d33a3f409b15166609733b663f (patch)
treeedcd5d702c73cda74a2177c4bdc08c616334337d /client/src/app/+my-account/my-account-videos/my-account-videos.component.ts
parent2baea0c77cc765f7cbca9c9a2f4272268892a35c (diff)
downloadPeerTube-bbe0f0645ca958d33a3f409b15166609733b663f.tar.gz
PeerTube-bbe0f0645ca958d33a3f409b15166609733b663f.tar.zst
PeerTube-bbe0f0645ca958d33a3f409b15166609733b663f.zip
Add ability to schedule video publication
Diffstat (limited to 'client/src/app/+my-account/my-account-videos/my-account-videos.component.ts')
-rw-r--r--client/src/app/+my-account/my-account-videos/my-account-videos.component.ts29
1 files changed, 21 insertions, 8 deletions
diff --git a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts
index afc01073c..e698b75ec 100644
--- a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts
+++ b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts
@@ -1,6 +1,6 @@
1import { from as observableFrom, Observable } from 'rxjs' 1import { from as observableFrom, Observable } from 'rxjs'
2import { concatAll, tap } from 'rxjs/operators' 2import { concatAll, tap } from 'rxjs/operators'
3import { Component, OnDestroy, OnInit } from '@angular/core' 3import { Component, OnDestroy, OnInit, Inject, LOCALE_ID } from '@angular/core'
4import { ActivatedRoute, Router } from '@angular/router' 4import { ActivatedRoute, Router } from '@angular/router'
5import { Location } from '@angular/common' 5import { Location } from '@angular/common'
6import { immutableAssign } from '@app/shared/misc/utils' 6import { immutableAssign } from '@app/shared/misc/utils'
@@ -12,7 +12,8 @@ import { AbstractVideoList } from '../../shared/video/abstract-video-list'
12import { Video } from '../../shared/video/video.model' 12import { Video } from '../../shared/video/video.model'
13import { VideoService } from '../../shared/video/video.service' 13import { VideoService } from '../../shared/video/video.service'
14import { I18n } from '@ngx-translate/i18n-polyfill' 14import { I18n } from '@ngx-translate/i18n-polyfill'
15import { VideoState } from '../../../../../shared/models/videos' 15import { VideoPrivacy, VideoState } from '../../../../../shared/models/videos'
16import { ScreenService } from '@app/shared/misc/screen.service'
16 17
17@Component({ 18@Component({
18 selector: 'my-account-videos', 19 selector: 'my-account-videos',
@@ -39,8 +40,10 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni
39 protected notificationsService: NotificationsService, 40 protected notificationsService: NotificationsService,
40 protected confirmService: ConfirmService, 41 protected confirmService: ConfirmService,
41 protected location: Location, 42 protected location: Location,
43 protected screenService: ScreenService,
42 protected i18n: I18n, 44 protected i18n: I18n,
43 private videoService: VideoService 45 private videoService: VideoService,
46 @Inject(LOCALE_ID) private localeId: string
44 ) { 47 ) {
45 super() 48 super()
46 49
@@ -131,12 +134,22 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni
131 } 134 }
132 135
133 getStateLabel (video: Video) { 136 getStateLabel (video: Video) {
134 if (video.state.id === VideoState.PUBLISHED) return this.i18n('Published') 137 let suffix: string
135 138
136 if (video.state.id === VideoState.TO_TRANSCODE && video.waitTranscoding === true) return this.i18n('Waiting transcoding') 139 if (video.privacy.id !== VideoPrivacy.PRIVATE && video.state.id === VideoState.PUBLISHED) {
137 if (video.state.id === VideoState.TO_TRANSCODE) return this.i18n('To transcode') 140 suffix = this.i18n('Published')
141 } else if (video.scheduledUpdate) {
142 const updateAt = new Date(video.scheduledUpdate.updateAt.toString()).toLocaleString(this.localeId)
143 suffix = this.i18n('Publication scheduled on ') + updateAt
144 } else if (video.state.id === VideoState.TO_TRANSCODE && video.waitTranscoding === true) {
145 suffix = this.i18n('Waiting transcoding')
146 } else if (video.state.id === VideoState.TO_TRANSCODE) {
147 suffix = this.i18n('To transcode')
148 } else {
149 return ''
150 }
138 151
139 return this.i18n('Unknown state') 152 return ' - ' + suffix
140 } 153 }
141 154
142 protected buildVideoHeight () { 155 protected buildVideoHeight () {