summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul C. Buetow (mars.fritz.box) <paul@buetow.org>2014-05-07 14:58:35 +0200
committerPaul C. Buetow (mars.fritz.box) <paul@buetow.org>2014-05-07 14:58:35 +0200
commit9ed5d1e65a07ec1511a6599946b39c70f6441015 (patch)
tree0b5fc4b81a7e7737fe282c41afeac8f5ffd0440a /src
parent92eb329acc9e5b1905786d96be6fe151093c98ac (diff)
more infos
Diffstat (limited to 'src')
-rwxr-xr-xsrc/photoalbum.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/photoalbum.sh b/src/photoalbum.sh
index 13a8b95..4e67bc0 100755
--- a/src/photoalbum.sh
+++ b/src/photoalbum.sh
@@ -218,10 +218,13 @@ function makealbumoverviewhtml() {
basename=$(basename "$dir")
ALBUM=$basename
thumbs_dir="${DIST_DIR}/thumbs/${basename}"
- count=$(ls "${thumbs_dir}" | wc -l)
- random=$(( 1 + $RANDOM % $count ))
+ pictures=$(ls "${thumbs_dir}" | wc -l)
+ random=$(( 1 + $RANDOM % $pictures ))
RANDOM_THUMB="./thumbs/${basename}"/$(find "$thumbs_dir" -type f -printf "%f\n" |
head -n $random | tail -n 1)
+ pages=$(( $pictures / $MAXPREVIEWS + 1))
+ test $pages -gt 1 && s=s || s=''
+ DESCRIPTION="${pictures} pictures / ${pages} page$s"
template index-preview index
done