From f1f7ceb7e62dafca41d6e31de34dda1aa02ca538 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 31 Oct 2013 07:40:02 +0400 Subject: [PATCH] fixed a couple of issues in process-archive.sh... Signed-off-by: Alex A. Naanou --- scripts/process-archive.sh | 16 ++++++++++++---- ui/data.js | 16 ++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/scripts/process-archive.sh b/scripts/process-archive.sh index cc2ddee9..376ffc0a 100755 --- a/scripts/process-archive.sh +++ b/scripts/process-archive.sh @@ -34,7 +34,7 @@ while true ; do ;; --common-previews) - COMMON_PREVIEWS="${2}/preview (RAW)" + COMMON_PREVIEWS="${2}" shift shift ;; @@ -214,18 +214,26 @@ fi # collect previews to one location... # XXX test!!! -if ! [ -z $COMMON_PREVIEWS ] ; then +if ! [ -z "$COMMON_PREVIEWS" ] ; then if ! [ -e "./$COMMON_PREVIEWS" ] ; then mkdir -p "./$COMMON_PREVIEWS" fi - find . -type d -name 'preview (RAW)' -exec mv "{}" "./$COMMON_PREVIEWS" \; + find . -type d \ + -name 'preview (RAW)' \ + -print \ + -exec cp -rl "{}" "./$COMMON_PREVIEWS" \; + #-exec rm -rf "./$d" fi # build cache... if [ -z $SKIP_CACHE ] ; then - find . -type d -name 'preview (RAW)' -exec buildcache "{}" \; + if ! [ -z "$COMMON_PREVIEWS" ] && [ -e "./$COMMON_PREVIEWS/preview (RAW)" ] ; then + buildcache "./$COMMON_PREVIEWS/preview (RAW)" + else + find . -type d -name 'preview (RAW)' -exec buildcache "{}" \; + fi fi diff --git a/ui/data.js b/ui/data.js index ccefd782..5e676516 100755 --- a/ui/data.js +++ b/ui/data.js @@ -1620,6 +1620,22 @@ function appendMarker(){ } +// NOTE: if cmp is explicitly false then no sorting will be done. +function loadRibbonsFromPath(path, cmp, reverse){ + path = path == null ? BASE_URL : path + path = normalizePath(path) + cmp = cmp == null ? imageDateCmp : cmp + + DATA.ribbons = ribbonsFromFavDirs(path) + + if(cmp != false){ + sortImages(cmp, reverse) + } else { + reloadViewer() + } +} + + /********************************************************************** * vim:set ts=4 sw=4 spell : */