From ff4de38385049bf8f6e1d76d8511854fcfabc71c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 2 Aug 2021 16:50:56 +0200 Subject: Filter videos by live in custom markup --- client/src/app/shared/shared-custom-markup/custom-markup.service.ts | 2 ++ .../peertube-custom-tags/channel-miniature-markup.component.ts | 2 +- .../peertube-custom-tags/playlist-miniature-markup.component.ts | 2 +- .../peertube-custom-tags/video-miniature-markup.component.ts | 2 +- .../peertube-custom-tags/videos-list-markup.component.ts | 4 +++- 5 files changed, 8 insertions(+), 4 deletions(-) (limited to 'client/src/app/shared/shared-custom-markup') diff --git a/client/src/app/shared/shared-custom-markup/custom-markup.service.ts b/client/src/app/shared/shared-custom-markup/custom-markup.service.ts index 089728a51..c9d33980e 100644 --- a/client/src/app/shared/shared-custom-markup/custom-markup.service.ts +++ b/client/src/app/shared/shared-custom-markup/custom-markup.service.ts @@ -191,6 +191,8 @@ export class CustomMarkupService { accountHandle: data.accountHandle || undefined, channelHandle: data.channelHandle || undefined, + isLive: this.buildBoolean(data.isLive), + filter: this.buildBoolean(data.onlyLocal) ? 'local' as VideoFilter : undefined } diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts index bb099deae..5bb045a82 100644 --- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts @@ -50,7 +50,7 @@ export class ChannelMiniatureMarkupComponent implements CustomMarkupComponent, O this.video = data[0] }, - err => this.notifier.error('Error in channel miniature component: ' + err.message) + err => this.notifier.error($localize`Error in channel miniature component: ${err.message}`) ) } diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.ts index 97d31c4a7..5a5c34867 100644 --- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.ts +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.ts @@ -44,7 +44,7 @@ export class PlaylistMiniatureMarkupComponent implements CustomMarkupComponent, .subscribe( playlist => this.playlist = playlist, - err => this.notifier.error('Error in playlist miniature component: ' + err.message) + err => this.notifier.error($localize`Error in playlist miniature component: ${err.message}`) ) } } diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts index ba61aaf51..84c936ee7 100644 --- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts @@ -56,7 +56,7 @@ export class VideoMiniatureMarkupComponent implements CustomMarkupComponent, OnI .subscribe( video => this.video = video, - err => this.notifier.error('Error in video miniature component: ' + err.message) + err => this.notifier.error($localize`Error in video miniature component: ${err.message}`) ) } } diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts index d9f77802b..6473e9ba0 100644 --- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts @@ -22,6 +22,7 @@ export class VideosListMarkupComponent implements CustomMarkupComponent, OnInit @Input() count: number @Input() onlyDisplayTitle: boolean @Input() filter: VideoFilter + @Input() isLive: boolean @Input() maxRows: number @Input() channelHandle: string @Input() accountHandle: string @@ -73,7 +74,7 @@ export class VideosListMarkupComponent implements CustomMarkupComponent, OnInit .subscribe( ({ data }) => this.videos = data, - err => this.notifier.error('Error in videos list component: ' + err.message) + err => this.notifier.error($localize`Error in videos list component: ${err.message}`) ) } @@ -86,6 +87,7 @@ export class VideosListMarkupComponent implements CustomMarkupComponent, OnInit categoryOneOf: this.categoryOneOf, languageOneOf: this.languageOneOf, filter: this.filter, + isLive: this.isLive, sort: this.sort as VideoSortField, account: { nameWithHost: this.accountHandle }, videoChannel: { nameWithHost: this.channelHandle } -- cgit v1.2.3