diff options
Diffstat (limited to 'client/src/app/shared/video')
-rw-r--r-- | client/src/app/shared/video/video-miniature.component.html | 2 | ||||
-rw-r--r-- | client/src/app/shared/video/video-thumbnail.component.html | 2 | ||||
-rw-r--r-- | client/src/app/shared/video/video.service.ts | 51 |
3 files changed, 17 insertions, 38 deletions
diff --git a/client/src/app/shared/video/video-miniature.component.html b/client/src/app/shared/video/video-miniature.component.html index 20020e2a8..3010e5ccc 100644 --- a/client/src/app/shared/video/video-miniature.component.html +++ b/client/src/app/shared/video/video-miniature.component.html | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | <div class="video-miniature-information"> | 4 | <div class="video-miniature-information"> |
5 | <a | 5 | <a |
6 | class="video-miniature-name" alt="" | 6 | class="video-miniature-name" |
7 | [routerLink]="[ '/videos/watch', video.uuid ]" [attr.title]="video.name" [ngClass]="{ 'blur-filter': isVideoBlur() }" | 7 | [routerLink]="[ '/videos/watch', video.uuid ]" [attr.title]="video.name" [ngClass]="{ 'blur-filter': isVideoBlur() }" |
8 | > | 8 | > |
9 | {{ video.name }} | 9 | {{ video.name }} |
diff --git a/client/src/app/shared/video/video-thumbnail.component.html b/client/src/app/shared/video/video-thumbnail.component.html index 971f352ba..4909cf3f1 100644 --- a/client/src/app/shared/video/video-thumbnail.component.html +++ b/client/src/app/shared/video/video-thumbnail.component.html | |||
@@ -2,7 +2,7 @@ | |||
2 | [routerLink]="['/videos/watch', video.uuid]" [attr.title]="video.name" | 2 | [routerLink]="['/videos/watch', video.uuid]" [attr.title]="video.name" |
3 | class="video-thumbnail" | 3 | class="video-thumbnail" |
4 | > | 4 | > |
5 | <img [attr.src]="getImageUrl()" [ngClass]="{ 'blur-filter': nsfw }" /> | 5 | <img alt="" [attr.src]="getImageUrl()" [ngClass]="{ 'blur-filter': nsfw }" /> |
6 | 6 | ||
7 | <div class="video-thumbnail-overlay"> | 7 | <div class="video-thumbnail-overlay"> |
8 | {{ video.durationLabel }} | 8 | {{ video.durationLabel }} |
diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts index b4c1f10f9..f316d31ea 100644 --- a/client/src/app/shared/video/video.service.ts +++ b/client/src/app/shared/video/video.service.ts | |||
@@ -231,27 +231,6 @@ export class VideoService { | |||
231 | return this.buildBaseFeedUrls(params) | 231 | return this.buildBaseFeedUrls(params) |
232 | } | 232 | } |
233 | 233 | ||
234 | searchVideos ( | ||
235 | search: string, | ||
236 | videoPagination: ComponentPagination, | ||
237 | sort: VideoSortField | ||
238 | ): Observable<{ videos: Video[], totalVideos: number }> { | ||
239 | const url = VideoService.BASE_VIDEO_URL + 'search' | ||
240 | |||
241 | const pagination = this.restService.componentPaginationToRestPagination(videoPagination) | ||
242 | |||
243 | let params = new HttpParams() | ||
244 | params = this.restService.addRestGetParams(params, pagination, sort) | ||
245 | params = params.append('search', search) | ||
246 | |||
247 | return this.authHttp | ||
248 | .get<ResultList<VideoServerModel>>(url, { params }) | ||
249 | .pipe( | ||
250 | switchMap(res => this.extractVideos(res)), | ||
251 | catchError(err => this.restExtractor.handleError(err)) | ||
252 | ) | ||
253 | } | ||
254 | |||
255 | removeVideo (id: number) { | 234 | removeVideo (id: number) { |
256 | return this.authHttp | 235 | return this.authHttp |
257 | .delete(VideoService.BASE_VIDEO_URL + id) | 236 | .delete(VideoService.BASE_VIDEO_URL + id) |
@@ -289,21 +268,7 @@ export class VideoService { | |||
289 | .pipe(catchError(err => this.restExtractor.handleError(err))) | 268 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
290 | } | 269 | } |
291 | 270 | ||
292 | private setVideoRate (id: number, rateType: VideoRateType) { | 271 | extractVideos (result: ResultList<VideoServerModel>) { |
293 | const url = VideoService.BASE_VIDEO_URL + id + '/rate' | ||
294 | const body: UserVideoRateUpdate = { | ||
295 | rating: rateType | ||
296 | } | ||
297 | |||
298 | return this.authHttp | ||
299 | .put(url, body) | ||
300 | .pipe( | ||
301 | map(this.restExtractor.extractDataBool), | ||
302 | catchError(err => this.restExtractor.handleError(err)) | ||
303 | ) | ||
304 | } | ||
305 | |||
306 | private extractVideos (result: ResultList<VideoServerModel>) { | ||
307 | return this.serverService.localeObservable | 272 | return this.serverService.localeObservable |
308 | .pipe( | 273 | .pipe( |
309 | map(translations => { | 274 | map(translations => { |
@@ -319,4 +284,18 @@ export class VideoService { | |||
319 | }) | 284 | }) |
320 | ) | 285 | ) |
321 | } | 286 | } |
287 | |||
288 | private setVideoRate (id: number, rateType: VideoRateType) { | ||
289 | const url = VideoService.BASE_VIDEO_URL + id + '/rate' | ||
290 | const body: UserVideoRateUpdate = { | ||
291 | rating: rateType | ||
292 | } | ||
293 | |||
294 | return this.authHttp | ||
295 | .put(url, body) | ||
296 | .pipe( | ||
297 | map(this.restExtractor.extractDataBool), | ||
298 | catchError(err => this.restExtractor.handleError(err)) | ||
299 | ) | ||
300 | } | ||
322 | } | 301 | } |