Skip to content

Commit 54e7636

Browse files
committed
Avoid rendering extraneous separators
handling cases where the artist or album data might be missing to avoid rendering extraneous separators. Suggested by Copilot.
1 parent 8ea7346 commit 54e7636

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

beetsplug/web/templates/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ <h1>beets</h1>
3939
<div id="extra-detail"></div>
4040
<!-- Templates. -->
4141
<script type="text/template" id="item-entry-template">
42-
<%= artist %> &ndash; <%= album %> &ndash; <%= title %>
42+
<% if (artist) { %><%= artist %><% } %>
43+
<% if (artist && album) { %> &ndash; <% } %>
44+
<% if (album) { %><%= album %><% } %>
45+
<% if ((artist || album) && title) { %> &ndash; <% } %>
46+
<%= title %>
4347
<span class="playing">&#9654;</span>
4448
</script>
4549
<script type="text/template" id="item-main-detail-template">

0 commit comments

Comments
 (0)