{% extends 'base.html.twig' %} {% block title %}Album Search{% endblock %} {% block body %} {% set query_value = query|default('') %} {% set album_value = album|default('') %} {% set artist_value = artist|default('') %} {% set year_from_value = year_from|default('') %} {% set year_to_value = year_to|default('') %} {% set source_value = source|default('all') %} {% set has_search = (query_value is not empty) or (album_value is not empty) or (artist_value is not empty) or (year_from_value is not empty) or (year_to_value is not empty) or (source_value != 'all') %} {% set advanced_open = (album_value is not empty) or (artist_value is not empty) or (year_from_value is not empty) or (year_to_value is not empty) or (source_value != 'all') %} {% set landing_view = not has_search %} {% if landing_view %} {% endif %}

Search Albums

{% if landing_view %}
{% else %}
{% endif %}
{% if albums is defined and albums|length > 0 %}
{% for album in albums %}
{% set image = (album.images[1] ?? album.images[0] ?? null) %} {% if image %} {{ album.name }} cover {% endif %}
{{ album.name }}

{{ album.artists|map(a => a.name)|join(', ') }}

Released {{ album.release_date }} • {{ album.total_tracks }} tracks

{% set s = stats[album.id] ?? { 'avg': 0, 'count': 0 } %}

User score: {{ s.avg }}/10 ({{ s.count }})

{% if album.external_urls.spotify is defined and album.external_urls.spotify %} Open in Spotify {% endif %} Reviews {% if app.user and (album.source is not defined or album.source != 'user') %} {% if savedIds is defined and (album.id in savedIds) %} {# Saved indicator intentionally omitted to reduce noise #} {% else %}
{% endif %} {% endif %}
{% endfor %}
{% elseif query or album or artist or year_from or year_to %}

No albums found.

{% endif %} {% endblock %}