{% extends "layouts/app.twig" %} {% block nav_controls %}
{% for genre in filters.genres %} {% endfor %} {% for artist in filters.artists %} {% endfor %}
{% for mode in view_modes %} {% if mode == 'grid' %} {% endif %} {% if mode == 'list' %} {% endif %} {% if mode == 'covers' %} {% endif %} {% endfor %}
{% for key, label in sort_options %} {{ label }} {% if sort == key %} {% endif %} {% endfor %}
{% endblock %} {% block item_list %} {% if view_mode == 'list' and albums %}
{% set grouped_albums = {} %} {% for album in albums %} {% set first_letter = album.title|first|upper %} {% if grouped_albums[first_letter] is defined %} {% set grouped_albums = grouped_albums|merge({(first_letter): grouped_albums[first_letter]|merge([album])}) %} {% else %} {% set grouped_albums = grouped_albums|merge({(first_letter): [album]}) %} {% endif %} {% endfor %} {% for letter, letter_albums in grouped_albums|sort %}

{{ letter }}

{% endfor %}
{% else %}
No items to display
{% endif %} {% endblock %} {% block sidebar %}

Filters

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

Active Filters

{% if search %}
Search: "{{ search }}"
{% endif %} {% for genre in filters.genres %}
Genre: {{ genre }}
{% endfor %} {% for artist in filters.artists %}
Artist: {{ artist }}
{% endfor %}
{% endif %}

Quick Stats

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

Music

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

{% if search or filters.genres or filters.artists %} No albums found matching your criteria {% else %} No albums found {% endif %}

{% if search or filters.genres or filters.artists %} Try adjusting your search terms or filters. {% else %} Start syncing your music libraries to see your albums here. {% endif %}

{% if search or filters.genres or filters.artists %} Clear filters {% endif %}
{% else %} {% if view_mode == 'list' %}
{% elseif view_mode == 'covers' %}
{% for album in albums %}
{% if album.cover_url %}
{{ album.title }}
{% if album.track_count %}
{{ album.track_count }} tracks
{% endif %} {% if album.is_favorite %}
Favorite
{% endif %}
{% else %}
{% endif %}
{{ album.title }}

{{ album.artist_name }}

{% if album.release_date %}

{{ album.release_date|date('Y') }}

{% endif %} {% if album.genre %}
{% for genre in album.genre|split(',')|slice(0, 2) %} {{ genre|trim }} {% endfor %}
{% endif %}
{% endfor %}
{% else %}
{% for album in albums %}
{% if album.cover_url %} {{ album.title }} {% else %}
{% endif %}
{{ album.title }}
{{ album.artist_name }} {% if album.release_date %} {{ album.release_date|date('Y') }} {% endif %}
{% if album.source_name %}

{{ album.source_name }}

{% endif %}
{% if album.track_count %}

{{ album.track_count }} tracks

{% endif %}
{% if album.total_duration_seconds %} {{ (album.total_duration_seconds / 60)|round(0) }} min {% endif %}
{% if album.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 }} albums
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 %}