{% extends "layouts/youtube.njk" %} {% block youtube %} {% if error %} {{ prose({ text: error.message }) }} {% elif isMultiChannel and channelsData %} {# Multi-channel mode: show all channels #} {% for chData in channelsData %}
{# Channel Header #} {% if chData.error %}

{{ chData.name }}

Error: {{ chData.error }}

{% elif chData.channel %}
{% if chData.channel.thumbnail %} {% endif %}

{{ chData.channel.title }}

{{ chData.channel.subscriberCount }} {{ __("youtube.subscribers") }} {{ chData.channel.videoCount }} videos
{% if chData.isLive %} {{ __("youtube.live") }} {% elif chData.isUpcoming %} {{ __("youtube.upcoming") }} {% else %} {{ __("youtube.offline") }} {% endif %}
{# Live Stream (if live) #} {% if chData.liveStatus and (chData.liveStatus.isLive or chData.liveStatus.isUpcoming) %} {% call section({ title: chData.liveStatus.isLive and __("youtube.live") or __("youtube.upcoming") }) %}
{% if chData.liveStatus.thumbnail %} {% endif %}

{{ chData.liveStatus.title }}

{{ button({ href: "https://www.youtube.com/watch?v=" + chData.liveStatus.videoId, text: __("youtube.watchNow"), target: "_blank" }) }}
{% endcall %} {% endif %} {# Latest Videos #} {% call section({ title: __("youtube.videos") }) %} {% if chData.videos and chData.videos.length > 0 %} {% else %} {{ prose({ text: __("youtube.noVideos") }) }} {% endif %} {% endcall %} {# Link to YouTube channel #} {% endif %}
{% endfor %} {% else %} {# Single channel mode (backward compatible) #} {# Channel Header #} {% if channel %}
{% if channel.thumbnail %} {% endif %}

{{ channel.title }}

{{ channel.subscriberCount }} {{ __("youtube.subscribers") }} {{ channel.videoCount }} videos
{% if isLive %} {{ __("youtube.live") }} {% elif isUpcoming %} {{ __("youtube.upcoming") }} {% else %} {{ __("youtube.offline") }} {% endif %}
{% endif %} {# Live Stream (if live) #} {% if liveStatus and (liveStatus.isLive or liveStatus.isUpcoming) %} {% call section({ title: liveStatus.isLive and __("youtube.live") or __("youtube.upcoming") }) %}
{% if liveStatus.thumbnail %} {% endif %}

{{ liveStatus.title }}

{{ button({ href: "https://www.youtube.com/watch?v=" + liveStatus.videoId, text: __("youtube.watchNow"), target: "_blank" }) }}
{% endcall %} {% endif %} {# Latest Videos #} {% call section({ title: __("youtube.videos") }) %} {% if videos and videos.length > 0 %} {% else %} {{ prose({ text: __("youtube.noVideos") }) }} {% endif %} {% endcall %} {# Link to YouTube channel #} {% if channel %} {% endif %} {% endif %} {# ── API Endpoints reference ── #} {% call section({ title: __("youtube.api.title") }) %} {% endcall %} {% endblock %}