{% extends "base.html" %}
{% block title %}{{ track.title }} - {{ track.album }} - {{ track.artist }} - Playlist Archive - {{ super() }}{% endblock %}
{% block content %}
<section>
<header>
    <h2>{{ track.title }}</h2>
    <h3>On {{ track.album }} by {{ track.artist }}</h3>
</header>

<p>This track has been spun {{ tracklogs|length }} times.</p>

{% if track.recording_mbid %}
<p><a href="https://musicbrainz.org/recording/{{ track.recording_mbid }}" rel="external">See more information about this recording on MusicBrainz</a></p>
{% endif %}

<h2>Spins</h2>
<ul>
    {% for tracklog in tracklogs %}
    {% if tracklog.djset_id > 0 -%}
    <li><a href="{{ url_for('trackman.playlist', set_id=tracklog.djset_id) }}"><time datetime="{{ tracklog.played|isodatetime }}" data-format="YYYY-MM-DD HH:mm">{{ tracklog.played|datetime("%Y-%m-%d %H:%M") }}</time></a> by <a href="{{ url_for('trackman.playlists_dj_sets', dj_id=tracklog.dj.id) }}">{{ tracklog.dj.airname }}</a></li>
    {% endif -%}
    {% endfor %}
</ul>
</section>
{% endblock %}

{% extends "base.html" %}
{% block title %}{{ track.title }} - {{ track.album }} - {{ track.artist }} - Playlist Archive - {{ super() }}{% endblock %}
{% block content %}
<section>
<header>
    <h2>{{ track.title }}</h2>
    <h3>On {{ track.album }} by {{ track.artist }}</h3>
</header>

<p>This track has been spun {{ tracklogs|length }} times.</p>

{% if track.recording_mbid %}
<p><a href="https://musicbrainz.org/recording/{{ track.recording_mbid }}" rel="external">See more information about this recording on MusicBrainz</a></p>
{% endif %}

<h2>Spins</h2>
<ul>
    {% for tracklog in tracklogs %}
    {% if tracklog.djset_id is not none and tracklog.djset_id > 0 -%}
    <li><a href="{{ url_for('trackman.playlist', set_id=tracklog.djset_id) }}"><time datetime="{{ tracklog.played|isodatetime }}" data-format="YYYY-MM-DD HH:mm">{{ tracklog.played|datetime("%Y-%m-%d %H:%M") }}</time></a> by <a href="{{ url_for('trackman.playlists_dj_sets', dj_id=tracklog.dj.id) }}">{{ tracklog.dj.airname }}</a></li>
    {% endif -%}
    {% endfor %}
</ul>
</section>
{% endblock %}

Check that tracklog.djset_id is not None
Check that tracklog.djset_id is not None
