{# The one card every page draws a channel, movie, or series with. Needs items; kind names theirs when all are one kind, else each record's own is read. show_kind labels each card with what it is, for search's mix of kinds. #} {% for record, shown in with_shown(items) %} {% set own = kind if kind is defined else ('series' if record.series_id is defined else ('live' if record.netv_kind == 'live' else 'movies')) %} {% set noun = {'movies': 'movie', 'series': 'series', 'live': 'live'}[own] %} {% set item_id = record.series_id if own == 'series' else record.stream_id %} {% set href = '/play/live/' ~ item_id if own == 'live' else '/' ~ noun ~ '/' ~ item_id %} {% set cover = shown.poster | logo_url %} {% set meta = [shown.year, shown.rating] | select | join(' · ') %}
{% if shown.poster %} {# A channel's logo is drawn whole; a poster fills the card. #} {% endif %}
{# One-line title, and a fixed-height line below, keep every card one size. #}
{{ shown.name }}
{# Year and rating always whole; on a narrow card the kind label gives way. #}
{% if show_kind %}{{ {'movies': 'Movie', 'series': 'Series', 'live': 'Live'}[own] }}{% endif %}{{ shown.year or '' }}{{ shown.rating }}
{% if own != 'live' %} {% endif %}
{% endfor %}