« get me outta code hell

show more details on album indexes - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/upd8.js
diff options
context:
space:
mode:
author(quasar) nebula <towerofnix@gmail.com>2020-11-13 14:27:19 -0400
committer(quasar) nebula <towerofnix@gmail.com>2020-11-13 14:27:19 -0400
commit869515eafa0225a3e748b2165c324567a0d29132 (patch)
tree4b21ab7f409fc31f6070a5e85aa905ded7c6c82c /upd8.js
parent7fcb651e52aff6e16ec48f77dc3224b67404a9c1 (diff)
show more details on album indexes
Diffstat (limited to 'upd8.js')
-rw-r--r--upd8.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/upd8.js b/upd8.js
index a05840ae..2404a22c 100644
--- a/upd8.js
+++ b/upd8.js
@@ -1085,6 +1085,7 @@ function getGridHTML({
     srcFn,
     hrefFn,
     altFn,
+    details = false,
     lazy = true
 }) {
     return entries.map(({ large, item }, i) => fixWS`
@@ -1096,6 +1097,9 @@ function getGridHTML({
                 square: true
             })}
             <span>${item.name}</span>
+            ${details && fixWS`
+                <span>(${s(item.tracks.length, 'track')}, ${getDurationString(getTotalDuration(item.tracks))})</span>
+            `}
         </a>
     `).join('\n');
 }
@@ -1256,6 +1260,7 @@ function writeMiscellaneousPages() {
                     <p class="quick-links"><a href="list/">More listings!</a></p>
                     <div class="grid-listing">
                         ${getAlbumGridHTML({
+                            details: true,
                             entries: (albumData
                                 .filter(album => album.isFanon)
                                 .reverse()
@@ -1277,6 +1282,7 @@ function writeMiscellaneousPages() {
                     <p class="quick-links"><a href="list/">More listings!</a></p>
                     <div class="grid-listing">
                         ${getAlbumGridHTML({
+                            details: true,
                             entries: (albumData
                                 .filter(album => album.isOfficial)
                                 .reverse()