Skip to content

Commit 5beb3d1

Browse files
authored
Add artist, album to item entry template in the web plugin (#5753)
Add the artist and album information to the item template in the web plugin. When searching for an item, Instead of `` Doo Woop (That Thing)`` the interface now shows ``Lauryn Hill - The Miseducation of Lauryn Hill - Doo Wop (That Thing)`` which is arguably clearer, and matches the default output of `beet ls` in the cli.
2 parents 619589d + 44af7b2 commit 5beb3d1

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

beetsplug/web/templates/index.html

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<meta name="description" content="the music geek’s media organizer">
7+
<meta name="keywords"
8+
content="beets, media, music, library, metadata, player, tagger, grep, transcoder, organizer">
49
<title>beets</title>
5-
610
<link rel="stylesheet"
7-
href="{{ url_for('static', filename='beets.css') }}" type="text/css">
8-
11+
href="{{ url_for('static', filename='beets.css') }}"
12+
type="text/css">
913
<script src="{{ url_for('static', filename='jquery.js') }}"></script>
10-
<script src="{{ url_for('static', filename='underscore.js') }}">
11-
</script>
14+
<script src="{{ url_for('static', filename='underscore.js') }}"></script>
1215
<script src="{{ url_for('static', filename='backbone.js') }}"></script>
1316
<script src="{{ url_for('static', filename='beets.js') }}"></script>
1417
</head>
@@ -17,34 +20,29 @@
1720
<h1>beets</h1>
1821
<div id="player">
1922
<audio></audio>
20-
2123
<button class="disabled">&#9654;</button>
2224
<button class="play">&#9654;</button>
2325
<button class="pause" style="letter-spacing: 1px;">&#10073;&#10073;</button>
24-
2526
<span class="times">
26-
<span class="currentTime">
27-
</span>
27+
<span class="currentTime"></span>
2828
</span>
2929
</div>
3030
</div>
31-
3231
<div id="entities">
3332
<form id="queryForm">
3433
<input type="search" id="query" placeholder="Query">
3534
</form>
3635
<ul id="results">
3736
</ul>
3837
</div>
39-
40-
<div id="main-detail">
41-
</div>
42-
43-
<div id="extra-detail">
44-
</div>
45-
38+
<div id="main-detail"></div>
39+
<div id="extra-detail"></div>
4640
<!-- Templates. -->
4741
<script type="text/template" id="item-entry-template">
42+
<% if (artist) { %><%= artist %><% } %>
43+
<% if (artist && album) { %> &ndash; <% } %>
44+
<% if (album) { %><%= album %><% } %>
45+
<% if ((artist || album) && title) { %> &ndash; <% } %>
4846
<%= title %>
4947
<span class="playing">&#9654;</span>
5048
</script>

docs/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ New features:
3333
* :doc:`plugins/mpdstats`: Add new configuration option,
3434
``played_ratio_threshold``, to allow configuring the percentage the song must
3535
be played for it to be counted as played instead of skipped.
36+
* :doc:`plugins/web`: Display artist and album as part of the search results.
3637

3738
Bug fixes:
3839

0 commit comments

Comments
 (0)