From 9d8752d052dcda270d286d0797bcfd265c23ae9f Mon Sep 17 00:00:00 2001 From: krateng Date: Thu, 14 Apr 2022 14:49:59 +0200 Subject: [PATCH] Fixed proper recognition of artist and track entities, fix GH-111 --- maloja/web/jinja/snippets/entityrow.jinja | 4 ++-- maloja/web/jinja/snippets/links.jinja | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/maloja/web/jinja/snippets/entityrow.jinja b/maloja/web/jinja/snippets/entityrow.jinja index e44f7fd..58fc46c 100644 --- a/maloja/web/jinja/snippets/entityrow.jinja +++ b/maloja/web/jinja/snippets/entityrow.jinja @@ -2,14 +2,14 @@ {% import 'snippets/links.jinja' as links %} -{% if 'artists' in entity %} +{% if entity is mapping and 'artists' in entity %} {% set img = images.get_track_image(entity) %} {% else %} {% set img = images.get_artist_image(entity) %} {% endif %}
-{% if "artists" in entity %} +{% if entity is mapping and 'artists' in entity %} {% if settings['TRACK_SEARCH_PROVIDER'] %} {{ links.link_search(entity) }} {% endif %} diff --git a/maloja/web/jinja/snippets/links.jinja b/maloja/web/jinja/snippets/links.jinja index f66bd3b..bb014e1 100644 --- a/maloja/web/jinja/snippets/links.jinja +++ b/maloja/web/jinja/snippets/links.jinja @@ -1,5 +1,5 @@ {% macro link(entity) -%} - {% if 'artists' in entity %} + {% if entity is mapping and 'artists' in entity %} {% set name = entity.title %} {% else %} {% set name = entity %} @@ -17,7 +17,7 @@ {% macro url(entity) %} - {% if 'artists' in entity -%} + {% if entity is mapping and 'artists' in entity -%} {{ mlj_uri.create_uri("/track",{'track':entity}) }} {%- else -%} {{ mlj_uri.create_uri("/artist",{'artist':entity}) }}