Avoid rendering extraneous separators

handling cases where the artist or album data might be missing to avoid
rendering extraneous separators. Suggested by Copilot.
This commit is contained in:
Martin Atukunda 2025-07-06 12:22:02 +03:00
parent 8ea7346575
commit 54e76368d0
No known key found for this signature in database
GPG key ID: 77854F599553E486

View file

@ -39,7 +39,11 @@
<div id="extra-detail"></div>
<!-- Templates. -->
<script type="text/template" id="item-entry-template">
<%= artist %> &ndash; <%= album %> &ndash; <%= title %>
<% if (artist) { %><%= artist %><% } %>
<% if (artist && album) { %> &ndash; <% } %>
<% if (album) { %><%= album %><% } %>
<% if ((artist || album) && title) { %> &ndash; <% } %>
<%= title %>
<span class="playing">&#9654;</span>
</script>
<script type="text/template" id="item-main-detail-template">