From afff310e50f2fa8419bb4242470cbde46ab54463 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Thu, 13 Aug 2020 15:07:23 +0200 Subject: allow private syndication feeds via a user feedToken --- client/src/app/shared/shared-main/video/video.service.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'client/src/app/shared/shared-main/video/video.service.ts') 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 c8a3ec043..b81540e8d 100644 --- a/client/src/app/shared/shared-main/video/video.service.ts +++ b/client/src/app/shared/shared-main/video/video.service.ts @@ -2,7 +2,7 @@ import { Observable } from 'rxjs' import { catchError, map, switchMap } from 'rxjs/operators' import { HttpClient, HttpParams, HttpRequest } from '@angular/common/http' import { Injectable } from '@angular/core' -import { ComponentPaginationLight, RestExtractor, RestService, ServerService, UserService } from '@app/core' +import { ComponentPaginationLight, RestExtractor, RestService, ServerService, UserService, AuthService } from '@app/core' import { objectToFormData } from '@app/helpers' import { FeedFormat, @@ -49,7 +49,8 @@ export class VideoService implements VideosProvider { private authHttp: HttpClient, private restExtractor: RestExtractor, private restService: RestService, - private serverService: ServerService + private serverService: ServerService, + private authService: AuthService ) {} getVideoViewUrl (uuid: string) { @@ -293,6 +294,16 @@ export class VideoService implements VideosProvider { return this.buildBaseFeedUrls(params) } + async getVideoSubscriptionFeedUrls (accountId: number) { + let params = this.restService.addRestGetParams(new HttpParams()) + params = params.set('accountId', accountId.toString()) + + const { feedToken } = await this.authService.getScopedTokens() + params = params.set('token', feedToken) + + return this.buildBaseFeedUrls(params) + } + getVideoFileMetadata (metadataUrl: string) { return this.authHttp .get(metadataUrl) -- cgit v1.2.3