X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-main%2Fvideo%2Fvideo.service.ts;h=78a49567f91746d77845efa035a2f5753ca34404;hb=cb0eda5602a21d1626a7face32de6153ed07b5f9;hp=8c8b1e08ff701a6ebef0cc5c9c1cbadb1e88b900;hpb=1bb4c9ab2e8b3b3022351b33a82a5e527fa5d4d7;p=github%2FChocobozzz%2FPeerTube.git 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 8c8b1e08f..78a49567f 100644 --- a/client/src/app/shared/shared-main/video/video.service.ts +++ b/client/src/app/shared/shared-main/video/video.service.ts @@ -54,6 +54,7 @@ export type CommonVideoParams = { export class VideoService { static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos' static BASE_FEEDS_URL = environment.apiUrl + '/feeds/videos.' + static PODCAST_FEEDS_URL = environment.apiUrl + '/feeds/podcast/videos.xml' static BASE_SUBSCRIPTION_FEEDS_URL = environment.apiUrl + '/feeds/subscriptions.' constructor ( @@ -266,7 +267,15 @@ export class VideoService { let params = this.restService.addRestGetParams(new HttpParams()) params = params.set('videoChannelId', videoChannelId.toString()) - return this.buildBaseFeedUrls(params) + const feedUrls = this.buildBaseFeedUrls(params) + + feedUrls.push({ + format: FeedFormat.RSS, + label: 'podcast rss 2.0', + url: VideoService.PODCAST_FEEDS_URL + `?videoChannelId=${videoChannelId}` + }) + + return feedUrls } getVideoSubscriptionFeedUrls (accountId: number, feedToken: string) { @@ -420,6 +429,24 @@ export class VideoService { : 'both' } + // Choose if we display by default the account or the channel + buildDefaultOwnerDisplayType (video: Video) { + const accountName = video.account.name + + // If the video channel name is an UUID (not really displayable, we changed this behaviour in v1.0.0-beta.12) + // Or has not been customized (default created channel display name) + // -> Use the account name + if ( + video.channel.displayName === `Default ${accountName} channel` || + video.channel.displayName === `Main ${accountName} channel` || + video.channel.name.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/) + ) { + return 'account' as 'account' + } + + return 'videoChannel' as 'videoChannel' + } + buildCommonVideosParams (options: CommonVideoParams & { params: HttpParams }) { const { params,