diff options
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/shared-main/shared-main.module.ts | 4 | ||||
-rw-r--r-- | client/src/app/shared/shared-main/users/user-notification.service.ts | 10 | ||||
-rw-r--r-- | client/src/app/shared/shared-main/video/index.ts | 2 | ||||
-rw-r--r-- | client/src/app/shared/shared-main/video/live-video.service.ts (renamed from client/src/app/shared/shared-main/video/video-live.service.ts) | 8 | ||||
-rw-r--r-- | client/src/app/shared/shared-share-modal/video-share.component.html | 6 | ||||
-rw-r--r-- | client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts | 5 |
6 files changed, 19 insertions, 16 deletions
diff --git a/client/src/app/shared/shared-main/shared-main.module.ts b/client/src/app/shared/shared-main/shared-main.module.ts index bca67b193..0580872f4 100644 --- a/client/src/app/shared/shared-main/shared-main.module.ts +++ b/client/src/app/shared/shared-main/shared-main.module.ts | |||
@@ -23,7 +23,7 @@ import { FeedComponent } from './feeds' | |||
23 | import { LoaderComponent, SmallLoaderComponent } from './loaders' | 23 | import { LoaderComponent, SmallLoaderComponent } from './loaders' |
24 | import { HelpComponent, ListOverflowComponent, TopMenuDropdownComponent } from './misc' | 24 | import { HelpComponent, ListOverflowComponent, TopMenuDropdownComponent } from './misc' |
25 | import { UserHistoryService, UserNotificationsComponent, UserNotificationService, UserQuotaComponent } from './users' | 25 | import { UserHistoryService, UserNotificationsComponent, UserNotificationService, UserQuotaComponent } from './users' |
26 | import { RedundancyService, VideoImportService, VideoOwnershipService, VideoService, VideoLiveService } from './video' | 26 | import { RedundancyService, VideoImportService, VideoOwnershipService, VideoService, LiveVideoService } from './video' |
27 | import { VideoCaptionService } from './video-caption' | 27 | import { VideoCaptionService } from './video-caption' |
28 | import { VideoChannelService } from './video-channel' | 28 | import { VideoChannelService } from './video-channel' |
29 | 29 | ||
@@ -142,7 +142,7 @@ import { VideoChannelService } from './video-channel' | |||
142 | RedundancyService, | 142 | RedundancyService, |
143 | VideoImportService, | 143 | VideoImportService, |
144 | VideoOwnershipService, | 144 | VideoOwnershipService, |
145 | VideoLiveService, | 145 | LiveVideoService, |
146 | VideoService, | 146 | VideoService, |
147 | 147 | ||
148 | VideoCaptionService, | 148 | VideoCaptionService, |
diff --git a/client/src/app/shared/shared-main/users/user-notification.service.ts b/client/src/app/shared/shared-main/users/user-notification.service.ts index 7b9dc34be..9014b48a8 100644 --- a/client/src/app/shared/shared-main/users/user-notification.service.ts +++ b/client/src/app/shared/shared-main/users/user-notification.service.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { catchError, map, tap } from 'rxjs/operators' | 1 | import { catchError, map, tap } from 'rxjs/operators' |
2 | import { HttpClient, HttpParams } from '@angular/common/http' | 2 | import { HttpClient, HttpParams } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { ComponentPaginationLight, RestExtractor, RestService, User, UserNotificationSocket, AuthService } from '@app/core' | 4 | import { ComponentPaginationLight, RestExtractor, RestService, User, PeerTubeSocket, AuthService } from '@app/core' |
5 | import { ResultList, UserNotification as UserNotificationServer, UserNotificationSetting } from '@shared/models' | 5 | import { ResultList, UserNotification as UserNotificationServer, UserNotificationSetting } from '@shared/models' |
6 | import { environment } from '../../../../environments/environment' | 6 | import { environment } from '../../../../environments/environment' |
7 | import { UserNotification } from './user-notification.model' | 7 | import { UserNotification } from './user-notification.model' |
@@ -17,7 +17,7 @@ export class UserNotificationService { | |||
17 | private auth: AuthService, | 17 | private auth: AuthService, |
18 | private restExtractor: RestExtractor, | 18 | private restExtractor: RestExtractor, |
19 | private restService: RestService, | 19 | private restService: RestService, |
20 | private userNotificationSocket: UserNotificationSocket | 20 | private peertubeSocket: PeerTubeSocket |
21 | ) {} | 21 | ) {} |
22 | 22 | ||
23 | listMyNotifications (parameters: { | 23 | listMyNotifications (parameters: { |
@@ -57,7 +57,7 @@ export class UserNotificationService { | |||
57 | return this.authHttp.post(url, body, { headers }) | 57 | return this.authHttp.post(url, body, { headers }) |
58 | .pipe( | 58 | .pipe( |
59 | map(this.restExtractor.extractDataBool), | 59 | map(this.restExtractor.extractDataBool), |
60 | tap(() => this.userNotificationSocket.dispatch('read')), | 60 | tap(() => this.peertubeSocket.dispatchNotificationEvent('read')), |
61 | catchError(res => this.restExtractor.handleError(res)) | 61 | catchError(res => this.restExtractor.handleError(res)) |
62 | ) | 62 | ) |
63 | } | 63 | } |
@@ -69,12 +69,12 @@ export class UserNotificationService { | |||
69 | return this.authHttp.post(url, {}, { headers }) | 69 | return this.authHttp.post(url, {}, { headers }) |
70 | .pipe( | 70 | .pipe( |
71 | map(this.restExtractor.extractDataBool), | 71 | map(this.restExtractor.extractDataBool), |
72 | tap(() => this.userNotificationSocket.dispatch('read-all')), | 72 | tap(() => this.peertubeSocket.dispatchNotificationEvent('read-all')), |
73 | catchError(res => this.restExtractor.handleError(res)) | 73 | catchError(res => this.restExtractor.handleError(res)) |
74 | ) | 74 | ) |
75 | } | 75 | } |
76 | 76 | ||
77 | updateNotificationSettings (user: User, settings: UserNotificationSetting) { | 77 | updateNotificationSettings (settings: UserNotificationSetting) { |
78 | const url = UserNotificationService.BASE_NOTIFICATION_SETTINGS | 78 | const url = UserNotificationService.BASE_NOTIFICATION_SETTINGS |
79 | 79 | ||
80 | return this.authHttp.put(url, settings) | 80 | return this.authHttp.put(url, settings) |
diff --git a/client/src/app/shared/shared-main/video/index.ts b/client/src/app/shared/shared-main/video/index.ts index 121635a30..f69089517 100644 --- a/client/src/app/shared/shared-main/video/index.ts +++ b/client/src/app/shared/shared-main/video/index.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | export * from './live-video.service' | ||
1 | export * from './redundancy.service' | 2 | export * from './redundancy.service' |
2 | export * from './video-details.model' | 3 | export * from './video-details.model' |
3 | export * from './video-edit.model' | 4 | export * from './video-edit.model' |
4 | export * from './video-import.service' | 5 | export * from './video-import.service' |
5 | export * from './video-live.service' | ||
6 | export * from './video-ownership.service' | 6 | export * from './video-ownership.service' |
7 | export * from './video.model' | 7 | export * from './video.model' |
8 | export * from './video.service' | 8 | export * from './video.service' |
diff --git a/client/src/app/shared/shared-main/video/video-live.service.ts b/client/src/app/shared/shared-main/video/live-video.service.ts index 12daff756..2cd1c66a5 100644 --- a/client/src/app/shared/shared-main/video/video-live.service.ts +++ b/client/src/app/shared/shared-main/video/live-video.service.ts | |||
@@ -2,11 +2,11 @@ import { catchError } from 'rxjs/operators' | |||
2 | import { HttpClient } from '@angular/common/http' | 2 | import { HttpClient } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { RestExtractor } from '@app/core' | 4 | import { RestExtractor } from '@app/core' |
5 | import { VideoCreate, VideoLive } from '@shared/models' | 5 | import { VideoCreate, LiveVideo } from '@shared/models' |
6 | import { environment } from '../../../../environments/environment' | 6 | import { environment } from '../../../../environments/environment' |
7 | 7 | ||
8 | @Injectable() | 8 | @Injectable() |
9 | export class VideoLiveService { | 9 | export class LiveVideoService { |
10 | static BASE_VIDEO_LIVE_URL = environment.apiUrl + '/api/v1/videos/live/' | 10 | static BASE_VIDEO_LIVE_URL = environment.apiUrl + '/api/v1/videos/live/' |
11 | 11 | ||
12 | constructor ( | 12 | constructor ( |
@@ -16,13 +16,13 @@ export class VideoLiveService { | |||
16 | 16 | ||
17 | goLive (video: VideoCreate) { | 17 | goLive (video: VideoCreate) { |
18 | return this.authHttp | 18 | return this.authHttp |
19 | .post<{ video: { id: number, uuid: string } }>(VideoLiveService.BASE_VIDEO_LIVE_URL, video) | 19 | .post<{ video: { id: number, uuid: string } }>(LiveVideoService.BASE_VIDEO_LIVE_URL, video) |
20 | .pipe(catchError(err => this.restExtractor.handleError(err))) | 20 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
21 | } | 21 | } |
22 | 22 | ||
23 | getVideoLive (videoId: number | string) { | 23 | getVideoLive (videoId: number | string) { |
24 | return this.authHttp | 24 | return this.authHttp |
25 | .get<VideoLive>(VideoLiveService.BASE_VIDEO_LIVE_URL + videoId) | 25 | .get<LiveVideo>(LiveVideoService.BASE_VIDEO_LIVE_URL + videoId) |
26 | .pipe(catchError(err => this.restExtractor.handleError(err))) | 26 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
27 | } | 27 | } |
28 | } | 28 | } |
diff --git a/client/src/app/shared/shared-share-modal/video-share.component.html b/client/src/app/shared/shared-share-modal/video-share.component.html index 3222dc5a6..80b4e446a 100644 --- a/client/src/app/shared/shared-share-modal/video-share.component.html +++ b/client/src/app/shared/shared-share-modal/video-share.component.html | |||
@@ -107,7 +107,7 @@ | |||
107 | 107 | ||
108 | <div class="filters"> | 108 | <div class="filters"> |
109 | <div> | 109 | <div> |
110 | <div class="form-group start-at"> | 110 | <div class="form-group start-at" *ngIf="!video.isLive"> |
111 | <my-peertube-checkbox | 111 | <my-peertube-checkbox |
112 | inputName="startAt" [(ngModel)]="customizations.startAtCheckbox" | 112 | inputName="startAt" [(ngModel)]="customizations.startAtCheckbox" |
113 | i18n-labelText labelText="Start at" | 113 | i18n-labelText labelText="Start at" |
@@ -138,7 +138,7 @@ | |||
138 | 138 | ||
139 | <div class="advanced-filters collapse-transition" [ngbCollapse]="isAdvancedCustomizationCollapsed"> | 139 | <div class="advanced-filters collapse-transition" [ngbCollapse]="isAdvancedCustomizationCollapsed"> |
140 | <div> | 140 | <div> |
141 | <div class="form-group stop-at"> | 141 | <div class="form-group stop-at" *ngIf="!video.isLive"> |
142 | <my-peertube-checkbox | 142 | <my-peertube-checkbox |
143 | inputName="stopAt" [(ngModel)]="customizations.stopAtCheckbox" | 143 | inputName="stopAt" [(ngModel)]="customizations.stopAtCheckbox" |
144 | i18n-labelText labelText="Stop at" | 144 | i18n-labelText labelText="Stop at" |
@@ -167,7 +167,7 @@ | |||
167 | ></my-peertube-checkbox> | 167 | ></my-peertube-checkbox> |
168 | </div> | 168 | </div> |
169 | 169 | ||
170 | <div class="form-group"> | 170 | <div class="form-group" *ngIf="!video.isLive"> |
171 | <my-peertube-checkbox | 171 | <my-peertube-checkbox |
172 | inputName="loop" [(ngModel)]="customizations.loop" | 172 | inputName="loop" [(ngModel)]="customizations.loop" |
173 | i18n-labelText labelText="Loop" | 173 | i18n-labelText labelText="Loop" |
diff --git a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts index 39358e08b..4ef17bfe3 100644 --- a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts +++ b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts | |||
@@ -146,7 +146,10 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
146 | } | 146 | } |
147 | 147 | ||
148 | isVideoDownloadable () { | 148 | isVideoDownloadable () { |
149 | return this.video && this.video instanceof VideoDetails && this.video.downloadEnabled | 149 | return this.video && |
150 | this.video.isLive !== true && | ||
151 | this.video instanceof VideoDetails && | ||
152 | this.video.downloadEnabled | ||
150 | } | 153 | } |
151 | 154 | ||
152 | canVideoBeDuplicated () { | 155 | canVideoBeDuplicated () { |