{% extends "layouts/app.twig" %} {% block nav_controls %}
{% for genre in filters.genres %} {% endfor %} {% for year in filters.years %} {% endfor %}
{% for mode in view_modes %} {% if mode == 'grid' %} {% endif %} {% if mode == 'list' %} {% endif %} {% endfor %}
{% endblock %} {% block sidebar %}

Filters

{% if available_filters.genres %}
{% endif %} {% if available_filters.years %}
{% endif %}
Clear All
{% if filters.genres or filters.years or search %}

Active Filters

{% if search %}
Search: "{{ search }}"
{% endif %} {% for genre in filters.genres %}
Genre: {{ genre }}
{% endfor %} {% for year in filters.years %}
Year: {{ year }}
{% endfor %}
{% endif %}

Quick Stats

Total TV Shows {{ pagination.total_items }}
This Page {{ tvshows|length }}
{% if pagination.total_pages > 1 %}
Page {{ pagination.current_page }} of {{ pagination.total_pages }}
{% endif %}
{% endblock %} {% block content %}

TV Shows

{% if pagination.total_items > 0 %}
{{ pagination.total_items }} TV shows {% if search %} matching "{{ search }}" {% endif %} {% if filters.genres or filters.years %} {% if filters.genres %} {{ filters.genres|join(', ') }} {% endif %} {% if filters.years %} {{ filters.years|join(', ') }} {% endif %} {% endif %}
{% endif %}
{% if tvshows is empty %}

{% if search or filters.genres or filters.years %} No TV shows found matching your criteria {% else %} No TV shows found {% endif %}

{% if search or filters.genres or filters.years %} Try adjusting your search terms or filters. {% else %} Start syncing your TV show libraries to see your TV shows here. {% endif %}

{% if search or filters.genres or filters.years %} Clear filters {% endif %}
{% else %} {% if view_mode == 'list' %}
{% elseif view_mode == 'covers' %}
{% for tvshow in tvshows %}
{% if tvshow.poster_url %}
{{ tvshow.title }}
{% else %}
{% endif %}
{{ tvshow.title }}
{% if tvshow.first_air_date %}

{{ tvshow.first_air_date|date('Y') }}

{% endif %}
{% endfor %}
{% else %}
{% for tvshow in tvshows %}
{% if tvshow.poster_url %} {{ tvshow.title }} {% else %}
{% endif %}
{{ tvshow.title }}
{% if tvshow.first_air_date %} {{ tvshow.first_air_date|date('Y') }} {% endif %} {% if tvshow.rating %} ⭐ {{ tvshow.rating }}/10 {% endif %}
{% if tvshow.source_name %}

{{ tvshow.source_name }}

{% endif %}
{% if tvshow.overview %}

{{ tvshow.overview|slice(0, 150) }}{% if tvshow.overview|length > 150 %}...{% endif %}

{% endif %}
{% if tvshow.number_of_seasons %} {{ tvshow.number_of_seasons }} season{{ tvshow.number_of_seasons > 1 ? 's' : '' }} {% endif %}
{% if tvshow.is_favorite %} Favorite {% endif %}
{% endfor %}
{% endif %} {% if pagination.total_pages > 1 %}
Showing {{ (pagination.current_page - 1) * pagination.per_page + 1 }} to {{ min(pagination.current_page * pagination.per_page, pagination.total_items) }} of {{ pagination.total_items }} TV shows
per page
{% if pagination.has_prev %} Previous {% else %} Previous {% endif %} {% set start_page = max(1, pagination.current_page - 2) %} {% set end_page = min(pagination.total_pages, pagination.current_page + 2) %} {% if start_page > 1 %} 1 {% if start_page > 2 %} ... {% endif %} {% endif %} {% for page_num in start_page..end_page %} {% if page_num == pagination.current_page %} {{ page_num }} {% else %} {{ page_num }} {% endif %} {% endfor %} {% if end_page < pagination.total_pages %} {% if end_page < pagination.total_pages - 1 %} ... {% endif %} {{ pagination.total_pages }} {% endif %} {% if pagination.has_next %} Next {% else %} Next {% endif %}
{% endif %} {% endif %}
{% endblock %}