Restrict shown artists in cells

This commit is contained in:
krateng 2024-03-14 17:51:52 +01:00
parent 915808a020
commit 33ed2abdea
2 changed files with 5 additions and 3 deletions

View File

@ -20,11 +20,11 @@
<td class='searchProvider'>{{ links.link_search(entity) }}</td>
{% endif %}
<td class='track'>
<span class='artist_in_trackcolumn'>{{ links.links(entity.artists) }}</span> {{ links.link(entity) }}
<span class='artist_in_trackcolumn'>{{ links.links(entity.artists, restrict_amount=True) }}</span> {{ links.link(entity) }}
</td>
{% elif entity is mapping and 'albumtitle' in entity %}
<td class='album'>
<span class='artist_in_albumcolumn'>{{ links.links(entity.artists) }}</span> {{ links.link(entity) }}
<span class='artist_in_albumcolumn'>{{ links.links(entity.artists, restrict_amount=True) }}</span> {{ links.link(entity) }}
</td>
{% else %}
<td class='artist'>{{ links.link(entity) }}

View File

@ -8,9 +8,11 @@
<a href="{{ url(entity) }}">{{ name | e }}</a>
{%- endmacro %}
{% macro links(entities) -%}
{% macro links(entities, restrict_amount=False) -%}
{% if entities is none or entities == [] %}
{{ settings["DEFAULT_ALBUM_ARTIST"] }}
{% elif entities.__len__() > 3 and restrict_amount %}
{{ link(entities[0]) }} et al.
{% else %}
{% for entity in entities -%}
{{ link(entity) }}{{ ", " if not loop.last }}