- return this.authHttp.get<VideoDetailsServerModel>(VideoService.BASE_VIDEO_URL + uuid)
- .map(videoHash => new VideoDetails(videoHash))
- .catch((res) => this.restExtractor.handleError(res))
+ return this.serverService.localeObservable
+ .pipe(
+ switchMap(translations => {
+ return this.authHttp.get<VideoDetailsServerModel>(VideoService.BASE_VIDEO_URL + uuid)
+ .pipe(map(videoHash => ({ videoHash, translations })))
+ }),
+ map(({ videoHash, translations }) => new VideoDetails(videoHash, translations)),
+ catchError(err => this.restExtractor.handleError(err))
+ )