Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Commit

Permalink
Fix photo count of zero or undefined (#408)
Browse files Browse the repository at this point in the history
album_decoration==photo: show photo count only if at least one photo in album (same as for album_decoration==all)
  • Loading branch information
evoludolab authored Sep 4, 2023
1 parent 742e453 commit 3398bbe
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions scripts/main/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,16 @@ build.album = function (data, disabled = false) {
case "none": // no decorations
break;
case "photo": // photos only
html += lychee.html`
<div class='album_counters'>
<div class='photos'>
<a class='photos'>${build.iconic("puzzle-piece")}
<span>${data.num_photos}</span>
</a>
</div>
</div>`;
if (data.num_photos > 0) {
html += lychee.html`
<div class='album_counters'>
<div class='photos'>
<a class='photos'>${build.iconic("puzzle-piece")}
<span>${data.num_photos}</span>
</a>
</div>
</div>`;
}
break;
case "layers": // sub-albums only and only marker without count (as in old v4 behaviour)
if (albumcount > 0) {
Expand Down

0 comments on commit 3398bbe

Please sign in to comment.