{% macro card_generic(link, thumbnail, title='') -%}
"}}">
{{ title | e }}
{{ caller() }}
{%- endmacro %} {% macro card(video_id, title='', advanced_text='', pinned="undefined", advanced_title='', post_url=None) -%} {% set caller_ = caller %} {% call card_generic("/watch?v="~video_id, "https://i.ytimg.com/vi/"~video_id~"/mqdefault.jpg", title) %} {{ caller_() }}
{{ advanced_text }}
{% if post_url %} {{ emoji_link("comments", post_url, False) }} {%endif%} {% if pinned != "undefined" %} {{ emoji_button("pin", video_id, pinned, False) }} {{ emoji_button("hide", video_id, False, False) }} {%endif%} {{ emoji_link("audio", video_id, False) }} {{ emoji_link("raw", video_id, False) }} {{ emoji_link("json", video_id, False) }}
{% endcall %} {%- endmacro %} {% macro dummycard() -%} {% for _ in range(4) %}
{% endfor %} {%- endmacro %} {% macro infobar_subscriptions(video_id, channel_id, author) -%} {{ author | e }} {%- endmacro %} {% macro emoji_button(action, subject, reverse=False, text=False) -%} {% set icons = { 'pin': ['📌️', '📌️⃠'], 'hide': ['💨️', ''], 'subscribe': ['📝️', '🗑️'], } %} {% set texts = { 'pin': ['pin to subscription feed', 'unpin'], 'hide': ['hide video', ''], 'subscribe': ['subscribe', 'unsubscribe'], } %} {% set actions = { 'pin': 'youtube.feed_post', 'hide': 'youtube.feed_post', 'subscribe': 'youtube.manage_subscriptions', } %}
{%- endmacro %} {% macro emoji_link(action, subject, text=False) -%} {% set icons = { 'raw': '🎞️', 'json': '💡', 'audio': '🎧', 'comments': '💬', } %} {% set texts = { 'raw': 'show raw video', 'json': 'view json metadata', 'audio': 'listen to audio only', 'comments': 'view comments', } %} {% set actions = { 'raw': '/watch?v='~subject~'&show=raw', 'json': '/watch?v='~subject~'&show=json', 'audio': '/watch?v='~subject~'&show=audio', 'comments': 'https://old.reddit.com'~subject, } %} {# #}{{ icons[action] }}{# #}{{ texts[action] if text }} {%- endmacro %} {% macro pagination(text, fields, direction) -%} {%- endmacro %}