From 017c4162661903103fa648fd63a37da6390c37a7 Mon Sep 17 00:00:00 2001 From: eduardklinger Date: Wed, 8 Mar 2023 17:56:39 +0100 Subject: [PATCH] filter out livestreams fom lti series --- modules/lti/src/OpencastRest.ts | 4 +++- modules/lti/src/components/Series.tsx | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/lti/src/OpencastRest.ts b/modules/lti/src/OpencastRest.ts index 38fe7057abb..d858c44aaf9 100644 --- a/modules/lti/src/OpencastRest.ts +++ b/modules/lti/src/OpencastRest.ts @@ -30,6 +30,7 @@ export interface SearchEpisodeResult { readonly mediapackage: MediaPackage; readonly languageShortCode: string; readonly licenseKey: string; + readonly isLive: boolean; } export interface SearchEpisodeResults { @@ -224,7 +225,8 @@ export async function searchEpisode( url: attachment.url })), tracks: parseTracksFromResult(result) - } + }, + isLive: result.mediapackage?.media?.track?.includes((track: any) => track.live === true) })), total: response.data["search-results"].total, limit: response.data["search-results"].limit, diff --git a/modules/lti/src/components/Series.tsx b/modules/lti/src/components/Series.tsx index d71ed3ac25c..181e04e79a8 100644 --- a/modules/lti/src/components/Series.tsx +++ b/modules/lti/src/components/Series.tsx @@ -259,14 +259,18 @@ class TranslatedSeries extends React.Component { {this.props.t("LTI.RESULT_HEADING", headingOpts)}
- {sr.results.map((episode) => { + + if (episode.isLive) return <> + + return )} + t={this.props.t} />})}