aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+videos')
-rw-r--r--client/src/app/+videos/video-list/video-user-subscriptions.component.ts27
1 files changed, 25 insertions, 2 deletions
diff --git a/client/src/app/+videos/video-list/video-user-subscriptions.component.ts b/client/src/app/+videos/video-list/video-user-subscriptions.component.ts
index 6988c574b..10031d6cc 100644
--- a/client/src/app/+videos/video-list/video-user-subscriptions.component.ts
+++ b/client/src/app/+videos/video-list/video-user-subscriptions.component.ts
@@ -3,9 +3,12 @@ import { ActivatedRoute, Router } from '@angular/router'
3import { AuthService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core' 3import { AuthService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core'
4import { HooksService } from '@app/core/plugins/hooks.service' 4import { HooksService } from '@app/core/plugins/hooks.service'
5import { immutableAssign } from '@app/helpers' 5import { immutableAssign } from '@app/helpers'
6import { VideoService } from '@app/shared/shared-main'
6import { UserSubscriptionService } from '@app/shared/shared-user-subscription' 7import { UserSubscriptionService } from '@app/shared/shared-user-subscription'
7import { AbstractVideoList, OwnerDisplayType } from '@app/shared/shared-video-miniature' 8import { AbstractVideoList, OwnerDisplayType } from '@app/shared/shared-video-miniature'
8import { VideoSortField } from '@shared/models' 9import { VideoSortField, FeedFormat } from '@shared/models'
10import { copyToClipboard } from '../../../root-helpers/utils'
11import { environment } from '../../../environments/environment'
9 12
10@Component({ 13@Component({
11 selector: 'my-videos-user-subscriptions', 14 selector: 'my-videos-user-subscriptions',
@@ -28,11 +31,13 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement
28 protected screenService: ScreenService, 31 protected screenService: ScreenService,
29 protected storageService: LocalStorageService, 32 protected storageService: LocalStorageService,
30 private userSubscription: UserSubscriptionService, 33 private userSubscription: UserSubscriptionService,
31 private hooks: HooksService 34 private hooks: HooksService,
35 private videoService: VideoService
32 ) { 36 ) {
33 super() 37 super()
34 38
35 this.titlePage = $localize`Videos from your subscriptions` 39 this.titlePage = $localize`Videos from your subscriptions`
40
36 this.actions.push({ 41 this.actions.push({
37 routerLink: '/my-library/subscriptions', 42 routerLink: '/my-library/subscriptions',
38 label: $localize`Subscriptions`, 43 label: $localize`Subscriptions`,
@@ -42,6 +47,20 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement
42 47
43 ngOnInit () { 48 ngOnInit () {
44 super.ngOnInit() 49 super.ngOnInit()
50
51 const user = this.authService.getUser()
52 let feedUrl = environment.embedUrl
53 this.videoService.getVideoSubscriptionFeedUrls(user.account.id)
54 .then((feeds: any) => feedUrl = feedUrl + feeds.find((f: any) => f.format === FeedFormat.RSS).url)
55 this.actions.unshift({
56 label: $localize`Feed`,
57 iconName: 'syndication',
58 justIcon: true,
59 click: () => {
60 copyToClipboard(feedUrl)
61 this.activateCopiedMessage()
62 }
63 })
45 } 64 }
46 65
47 ngOnDestroy () { 66 ngOnDestroy () {
@@ -68,4 +87,8 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement
68 generateSyndicationList () { 87 generateSyndicationList () {
69 // not implemented yet 88 // not implemented yet
70 } 89 }
90
91 activateCopiedMessage () {
92 this.notifier.success($localize`Feed URL copied`)
93 }
71} 94}