X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bvideos%2F%2Bvideo-edit%2Fvideo-update.resolver.ts;h=91e76b7fe31f09b3cc7562ec029eb97fa81d5d2f;hb=087fc5dadec95061c05bd0b6c86197a32ec4f23c;hp=5388a64b0899288d7b19cdeff9ce7dcf86d89fb5;hpb=b5b687550d8ef8beafdf706e45d6556fb5f4c876;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+videos/+video-edit/video-update.resolver.ts b/client/src/app/+videos/+video-edit/video-update.resolver.ts index 5388a64b0..91e76b7fe 100644 --- a/client/src/app/+videos/+video-edit/video-update.resolver.ts +++ b/client/src/app/+videos/+video-edit/video-update.resolver.ts @@ -2,20 +2,23 @@ import { forkJoin, of } from 'rxjs' import { map, switchMap } from 'rxjs/operators' import { Injectable } from '@angular/core' import { ActivatedRouteSnapshot, Resolve } from '@angular/router' -import { VideoCaptionService, VideoChannelService, VideoDetails, LiveVideoService, VideoService } from '@app/shared/shared-main' +import { AuthService } from '@app/core' +import { listUserChannels } from '@app/helpers' +import { VideoCaptionService, VideoDetails, VideoService } from '@app/shared/shared-main' +import { LiveVideoService } from '@app/shared/shared-video-live' @Injectable() export class VideoUpdateResolver implements Resolve { constructor ( private videoService: VideoService, private liveVideoService: LiveVideoService, - private videoChannelService: VideoChannelService, + private authService: AuthService, private videoCaptionService: VideoCaptionService ) { } resolve (route: ActivatedRouteSnapshot) { - const uuid: string = route.params[ 'uuid' ] + const uuid: string = route.params['uuid'] return this.videoService.getVideo({ videoId: uuid }) .pipe( @@ -30,17 +33,7 @@ export class VideoUpdateResolver implements Resolve { .loadCompleteDescription(video.descriptionPath) .pipe(map(description => Object.assign(video, { description }))), - this.videoChannelService - .listAccountVideoChannels(video.account) - .pipe( - map(result => result.data), - map(videoChannels => videoChannels.map(c => ({ - id: c.id, - label: c.displayName, - support: c.support, - avatarPath: c.avatar?.path - }))) - ), + listUserChannels(this.authService), this.videoCaptionService .listCaptions(video.id) @@ -49,8 +42,8 @@ export class VideoUpdateResolver implements Resolve { ), video.isLive - ? this.liveVideoService.getVideoLive(video.id) - : of(undefined) + ? this.liveVideoService.getVideoLive(video.id) + : of(undefined) ] } }