From e659aeed5b635adacfb4bf3111e4cbf1864d1ba0 Mon Sep 17 00:00:00 2001 From: girst Date: Sat, 29 Aug 2020 11:52:07 +0200 Subject: [PATCH] use new card.live property in typed_card --- app/templates/macros.imp.j2 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/templates/macros.imp.j2 b/app/templates/macros.imp.j2 index b56087c..8ec3a95 100644 --- a/app/templates/macros.imp.j2 +++ b/app/templates/macros.imp.j2 @@ -41,7 +41,8 @@ {% macro typed_card(params) -%} {% set c = params.content %} {% if params.type == 'VIDEO' %} - {% call card(c.video_id, c.title, c.published, badge=c.length) %} + {% set badge = 'LIVE' if c.live else c.length %} + {% call card(c.video_id, c.title, c.published, badge=badge) %} {{ infobar_subscriptions(c.video_id, c.channel_id, c.author) }} {% endcall %} {% elif params.type == 'CHANNEL' %} @@ -51,7 +52,7 @@ {% endcall %} {% elif params.type == 'PLAYLIST' %} {% call card_generic("/playlist?list="~c.playlist_id, "https://i.ytimg.com/vi/"~c.video_id~"/mqdefault.jpg", c.title) %} - {{ c.author }} + {{ infobar_subscriptions(None, c.channel_id, c.author) }} {{ c.n_videos }} videos {% endcall %} {% elif params.type == 'WEBSITE' %} @@ -67,6 +68,7 @@ {% endfor %} {%- endmacro %} +{# TODO: remove video_id parameter (unused) #} {% macro infobar_subscriptions(video_id, channel_id, author) -%} {% if channel_id is defined and channel_id is not none %} {{ author | e }} -- 2.39.3