{# Renders one page of /fragment/search/results (or a query error) for the search page. #}
{% from "fragment_templates/source_path_cells.html" import inferred_path_cell, clean_slate_link with context %}
{% macro source_path_cell(paths, row_id, album_id, item_id) -%}
{%- if paths | length == 1 -%}
{{ paths[0] }}
{{ clean_slate_link(paths[0], album_id, item_id) }}
{%- elif paths -%}
{{ paths | length }} paths
{% for path in paths %}
{{ path }}
{{ clean_slate_link(path, album_id, item_id) }}
{%- endif -%}
{%- endmacro %}
{% macro destination_path_cell(path) -%}
{%- if path -%}{{ path }}{%- else -%}—{%- endif -%}
{%- endmacro %}
{% macro album_health_cell(health) -%}
{%- if health is none -%}
—
{%- elif health.incomplete -%}
{%- if health.files_missing -%}{{ health.files_missing }} of {{ health.item_count }} files missing{%- endif -%}
{%- if health.files_missing and health.short_of_release %}
{% endif -%}
{%- if health.short_of_release -%}{{ health.item_count }} tracks, release lists {{ health.expected_tracks }}{%- endif -%}
{%- else -%}
ok
{%- endif -%}
{%- endmacro %}
{% if error %}
Query error: {{ error }}
{% elif results %}Showing {{ start_index }}–{{ end_index }} of {{ total }} {{ "albums" if albums else "tracks" }}.
{% if missing_source_count %}{{ missing_source_count }} of the {{ "albums" if albums else "tracks" }} on this page {{ "has" if missing_source_count == 1 else "have" }} no recorded source path. Source paths are known only for imports reported by the beetkeeper beets plugin; these were likely imported without it (or before it was configured).
{% endif %}| Album artist | Album | Year | Files | Source path(s) | Destination path | ||
|---|---|---|---|---|---|---|---|
| Artist | Album | Title | Track | Year | File | Source path(s) | Destination path |
| {{ row['albumartist'] }} | {{ row['album'] }} | {{ row['year'] or "" }} | {{ album_health_cell(health_by_id.get(row['id'])) }} | {{ source_path_cell(source_paths_by_id.get(row['id'], []), row['id'], row['id'], none) }} | {{ destination_path_cell(row['path']) }} | ||
| {{ row['artist'] }} | {{ row['album'] }} | {{ row['title'] }} | {{ row['track'] or "" }} | {{ row['year'] or "" }} | {% if row['id'] in missing_item_ids %}file missing{% else %}ok{% endif %} | {# An album track's clean slate is its album's; a standalone track is its own. #}{{ source_path_cell(source_paths_by_id.get(row['id'], []), row['id'], row['album_id'], none if row['album_id'] else row['id']) }} | {{ destination_path_cell(row['path']) }} |
{% if page > 1 %} {% endif %} {% if end_index < total %} {% endif %}
{% endif %} {% elif total %}No results on this page — {{ total }} {{ "albums" if albums else "tracks" }} match.
{% else %}
No matches.
{% endif %}