1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Fixed proper recognition of artist and track entities, fix GH-111

This commit is contained in:
krateng 2022-04-14 14:49:59 +02:00
parent 741246a7c1
commit 9d8752d052
2 changed files with 4 additions and 4 deletions

View File

@ -2,14 +2,14 @@
{% import 'snippets/links.jinja' as links %} {% 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) %} {% set img = images.get_track_image(entity) %}
{% else %} {% else %}
{% set img = images.get_artist_image(entity) %} {% set img = images.get_artist_image(entity) %}
{% endif %} {% endif %}
<td class='icon'><div style="background-image:url('{{ img }}')"></div></td> <td class='icon'><div style="background-image:url('{{ img }}')"></div></td>
{% if "artists" in entity %} {% if entity is mapping and 'artists' in entity %}
{% if settings['TRACK_SEARCH_PROVIDER'] %} {% if settings['TRACK_SEARCH_PROVIDER'] %}
<td class='searchProvider'>{{ links.link_search(entity) }}</td> <td class='searchProvider'>{{ links.link_search(entity) }}</td>
{% endif %} {% endif %}

View File

@ -1,5 +1,5 @@
{% macro link(entity) -%} {% macro link(entity) -%}
{% if 'artists' in entity %} {% if entity is mapping and 'artists' in entity %}
{% set name = entity.title %} {% set name = entity.title %}
{% else %} {% else %}
{% set name = entity %} {% set name = entity %}
@ -17,7 +17,7 @@
{% macro url(entity) %} {% macro url(entity) %}
{% if 'artists' in entity -%} {% if entity is mapping and 'artists' in entity -%}
{{ mlj_uri.create_uri("/track",{'track':entity}) }} {{ mlj_uri.create_uri("/track",{'track':entity}) }}
{%- else -%} {%- else -%}
{{ mlj_uri.create_uri("/artist",{'artist':entity}) }} {{ mlj_uri.create_uri("/artist",{'artist':entity}) }}