aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-11-02 11:00:40 +0100
committerChocobozzz <me@florianbigard.com>2021-11-02 11:13:13 +0100
commit7e7d8e485356402e7652c61c9f004e850b0a1607 (patch)
tree71c498c886cfd4b623a3c208572dc656ed800443 /client
parentfd5fa94bbc808e3ebb7a2e6bca636f2607566b52 (diff)
downloadPeerTube-7e7d8e485356402e7652c61c9f004e850b0a1607.tar.gz
PeerTube-7e7d8e485356402e7652c61c9f004e850b0a1607.tar.zst
PeerTube-7e7d8e485356402e7652c61c9f004e850b0a1607.zip
Some fixes for admin videos list
Diffstat (limited to 'client')
-rw-r--r--client/src/app/+admin/overview/videos/video-list.component.html5
-rw-r--r--client/src/app/+admin/overview/videos/video-list.component.ts4
-rw-r--r--client/src/app/shared/shared-main/video/video.service.ts16
3 files changed, 13 insertions, 12 deletions
diff --git a/client/src/app/+admin/overview/videos/video-list.component.html b/client/src/app/+admin/overview/videos/video-list.component.html
index eedf6f3dc..dd4ab178e 100644
--- a/client/src/app/+admin/overview/videos/video-list.component.html
+++ b/client/src/app/+admin/overview/videos/video-list.component.html
@@ -69,7 +69,7 @@
69 69
70 <span *ngIf="video.nsfw" class="badge badge-red" i18n>NSFW</span> 70 <span *ngIf="video.nsfw" class="badge badge-red" i18n>NSFW</span>
71 71
72 <span *ngIf="isUnpublished(video.state.id)" class="badge badge-yellow" i18n>Not published yet</span> 72 <span *ngIf="isUnpublished(video.state.id)" class="badge badge-yellow" i18n>{{ video.state.label }}</span>
73 73
74 <span *ngIf="isAccountBlocked(video)" class="badge badge-red" i18n>Account muted</span> 74 <span *ngIf="isAccountBlocked(video)" class="badge badge-red" i18n>Account muted</span>
75 <span *ngIf="isServerBlocked(video)" class="badge badge-red" i18n>Server muted</span> 75 <span *ngIf="isServerBlocked(video)" class="badge badge-red" i18n>Server muted</span>
@@ -80,8 +80,9 @@
80 <td> 80 <td>
81 <span *ngIf="isHLS(video)" class="badge badge-blue">HLS</span> 81 <span *ngIf="isHLS(video)" class="badge badge-blue">HLS</span>
82 <span *ngIf="isWebTorrent(video)" class="badge badge-blue">WebTorrent</span> 82 <span *ngIf="isWebTorrent(video)" class="badge badge-blue">WebTorrent</span>
83 <span *ngIf="video.isLive" class="badge badge-blue">Live</span>
83 84
84 <span *ngIf="!video.remote">{{ getFilesSize(video) | bytes: 1 }}</span> 85 <span *ngIf="!video.isLive && video.isLocal">{{ getFilesSize(video) | bytes: 1 }}</span>
85 </td> 86 </td>
86 87
87 <td> 88 <td>
diff --git a/client/src/app/+admin/overview/videos/video-list.component.ts b/client/src/app/+admin/overview/videos/video-list.component.ts
index 6885abfc7..8bd171c53 100644
--- a/client/src/app/+admin/overview/videos/video-list.component.ts
+++ b/client/src/app/+admin/overview/videos/video-list.component.ts
@@ -16,7 +16,7 @@ export class VideoListComponent extends RestTable implements OnInit {
16 videos: Video[] = [] 16 videos: Video[] = []
17 17
18 totalRecords = 0 18 totalRecords = 0
19 sort: SortMeta = { field: 'publishedAt', order: 1 } 19 sort: SortMeta = { field: 'publishedAt', order: -1 }
20 pagination: RestPagination = { count: this.rowsPerPage, start: 0 } 20 pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
21 21
22 bulkVideoActions: DropdownAction<Video[]>[][] = [] 22 bulkVideoActions: DropdownAction<Video[]>[][] = []
@@ -99,7 +99,7 @@ export class VideoListComponent extends RestTable implements OnInit {
99 } 99 }
100 100
101 isUnpublished (state: VideoState) { 101 isUnpublished (state: VideoState) {
102 return state !== VideoState.PUBLISHED 102 return state !== VideoState.LIVE_ENDED && state !== VideoState.PUBLISHED
103 } 103 }
104 104
105 isAccountBlocked (video: Video) { 105 isAccountBlocked (video: Video) {
diff --git a/client/src/app/shared/shared-main/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts
index 5db9a8704..819847ac6 100644
--- a/client/src/app/shared/shared-main/video/video.service.ts
+++ b/client/src/app/shared/shared-main/video/video.service.ts
@@ -48,7 +48,7 @@ export type CommonVideoParams = {
48 48
49@Injectable() 49@Injectable()
50export class VideoService { 50export class VideoService {
51 static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos/' 51 static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos'
52 static BASE_FEEDS_URL = environment.apiUrl + '/feeds/videos.' 52 static BASE_FEEDS_URL = environment.apiUrl + '/feeds/videos.'
53 static BASE_SUBSCRIPTION_FEEDS_URL = environment.apiUrl + '/feeds/subscriptions.' 53 static BASE_SUBSCRIPTION_FEEDS_URL = environment.apiUrl + '/feeds/subscriptions.'
54 54
@@ -60,18 +60,18 @@ export class VideoService {
60 ) {} 60 ) {}
61 61
62 getVideoViewUrl (uuid: string) { 62 getVideoViewUrl (uuid: string) {
63 return VideoService.BASE_VIDEO_URL + uuid + '/views' 63 return VideoService.BASE_VIDEO_URL + '/' + uuid + '/views'
64 } 64 }
65 65
66 getUserWatchingVideoUrl (uuid: string) { 66 getUserWatchingVideoUrl (uuid: string) {
67 return VideoService.BASE_VIDEO_URL + uuid + '/watching' 67 return VideoService.BASE_VIDEO_URL + '/' + uuid + '/watching'
68 } 68 }
69 69
70 getVideo (options: { videoId: string }): Observable<VideoDetails> { 70 getVideo (options: { videoId: string }): Observable<VideoDetails> {
71 return this.serverService.getServerLocale() 71 return this.serverService.getServerLocale()
72 .pipe( 72 .pipe(
73 switchMap(translations => { 73 switchMap(translations => {
74 return this.authHttp.get<VideoDetailsServerModel>(VideoService.BASE_VIDEO_URL + options.videoId) 74 return this.authHttp.get<VideoDetailsServerModel>(VideoService.BASE_VIDEO_URL + '/' + options.videoId)
75 .pipe(map(videoHash => ({ videoHash, translations }))) 75 .pipe(map(videoHash => ({ videoHash, translations })))
76 }), 76 }),
77 map(({ videoHash, translations }) => new VideoDetails(videoHash, translations)), 77 map(({ videoHash, translations }) => new VideoDetails(videoHash, translations)),
@@ -111,7 +111,7 @@ export class VideoService {
111 111
112 const data = objectToFormData(body) 112 const data = objectToFormData(body)
113 113
114 return this.authHttp.put(VideoService.BASE_VIDEO_URL + video.id, data) 114 return this.authHttp.put(VideoService.BASE_VIDEO_URL + '/' + video.id, data)
115 .pipe( 115 .pipe(
116 map(this.restExtractor.extractDataBool), 116 map(this.restExtractor.extractDataBool),
117 catchError(err => this.restExtractor.handleError(err)) 117 catchError(err => this.restExtractor.handleError(err))
@@ -119,7 +119,7 @@ export class VideoService {
119 } 119 }
120 120
121 uploadVideo (video: FormData) { 121 uploadVideo (video: FormData) {
122 const req = new HttpRequest('POST', VideoService.BASE_VIDEO_URL + 'upload', video, { reportProgress: true }) 122 const req = new HttpRequest('POST', VideoService.BASE_VIDEO_URL + '/' + 'upload', video, { reportProgress: true })
123 123
124 return this.authHttp 124 return this.authHttp
125 .request<{ video: { id: number, uuid: string } }>(req) 125 .request<{ video: { id: number, uuid: string } }>(req)
@@ -321,7 +321,7 @@ export class VideoService {
321 321
322 return from(ids) 322 return from(ids)
323 .pipe( 323 .pipe(
324 concatMap(id => this.authHttp.delete(VideoService.BASE_VIDEO_URL + id)), 324 concatMap(id => this.authHttp.delete(VideoService.BASE_VIDEO_URL + '/' + id)),
325 toArray(), 325 toArray(),
326 catchError(err => this.restExtractor.handleError(err)) 326 catchError(err => this.restExtractor.handleError(err))
327 ) 327 )
@@ -413,7 +413,7 @@ export class VideoService {
413 } 413 }
414 414
415 private setVideoRate (id: number, rateType: UserVideoRateType) { 415 private setVideoRate (id: number, rateType: UserVideoRateType) {
416 const url = VideoService.BASE_VIDEO_URL + id + '/rate' 416 const url = VideoService.BASE_VIDEO_URL + '/' + id + '/rate'
417 const body: UserVideoRateUpdate = { 417 const body: UserVideoRateUpdate = {
418 rating: rateType 418 rating: rateType
419 } 419 }