From b499255a7c227a48d014e8d2a7c7ba7428fee48a Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 28 Mar 2019 02:16:33 +0300 Subject: [PATCH] updated archive management scripts... Signed-off-by: Alex A. Naanou --- scripts/process-archive.sh | 9 ++-- scripts/sync-flash.sh | 45 +++++++++++++++---- .../media/img/my/work/process-archive.sh | 9 ++-- .../archive/media/img/my/work/sync-flash.sh | 45 +++++++++++++++---- ui (gen4)/lib/widget/browse2.js | 3 +- 5 files changed, 84 insertions(+), 27 deletions(-) diff --git a/scripts/process-archive.sh b/scripts/process-archive.sh index 4a8c10af..4362354d 100755 --- a/scripts/process-archive.sh +++ b/scripts/process-archive.sh @@ -117,9 +117,10 @@ JSON_NAME="%-:1d/${METADATA_DIR}/%f.json" if [ -z $SKIP_ARCHIVE ] ; then exiftool -if '$jpgfromraw' -b -jpgfromraw -w "$PREVIEW_NAME" \ -execute -if '$previewimage' -b -previewimage -w "$PREVIEW_NAME" \ - -execute '-FileModifyDateall' '-xmp' \ + -overwrite_original \ + -execute -j -G -w "$JSON_NAME" \ -common_args --ext jpg -r "./$ARCHIVE_ROOT" -progress fi @@ -288,7 +289,7 @@ fi # build cache... if [ -z $SKIP_CACHE ] ; then # a little tweak to make build cache work... - export PYTHONIOENCODING=UTF-8 + export PYTHONIOENCODING=UTF-8 #if [ -z $TOTAL ] ; then # export TOTAL=`find . -path '*hi-res (RAW)/*.jpg' | wc -l` #fi diff --git a/scripts/sync-flash.sh b/scripts/sync-flash.sh index 83ad94ae..187f6f85 100755 --- a/scripts/sync-flash.sh +++ b/scripts/sync-flash.sh @@ -4,6 +4,16 @@ DATE=`date +%Y%m%d` COUNT=1 TITLE="" +RSYNC=rsync +RSYNCFLAGS="-arptgoA --info=progress2,flist --human-readable" + +CP=cp +CPFLAGS=-Rpfv + +# override default... +COPY=$RSYNC +COPYFLAGS=$RSYNCFLAGS + # base mount dir... # systems with /mnt if [ -d /mnt ] ; then @@ -32,6 +42,8 @@ while true ; do echo " process-archive.sh after copying." echo " -b|-base the base dir to look for drives in" echo " default: $BASE" + echo " --rsync use rsync (default)" + echo " --cp use cp" echo exit ;; @@ -52,6 +64,16 @@ while true ; do BASE=1 shift ;; + -cp|--cp) + COPY=cp + COPYFLAGS=-Rpfv + break + ;; + -rsync|--rsync) + COPY=$RSYNC + COPYFLAGS=$RSYNCFLAGS + break + ;; *) break ;; @@ -118,29 +140,34 @@ while true ; do # XXX do a real three digit count... # single flash card... + SCOUNT=`printf "%03d" $COUNT` if [ -z $MULTI ] ; then - DIR="./- ${DATE}.00${COUNT}${TITLE}/" - while [ -e "$DIR" ] ; do + DIR="${DATE}.${SCOUNT}${TITLE}" + while [ -e *"$DIR"* ] ; do COUNT=$((COUNT+1)) - DIR="./- ${DATE}.00${COUNT}${TITLE}/" + SCOUNT=`printf "%03d" $COUNT` + DIR="${DATE}.${SCOUNT}${TITLE}" done BASE_DIR=$DIR # multiple flash cards shoot... else - BASE_DIR="./- ${DATE}${TITLE}/" - DIR="${BASE_DIR}/${DATE}.00${COUNT}/" - while [ -e "$DIR" ] ; do + BASE_DIR="${DATE}${TITLE}/" + DIR="${BASE_DIR}/${DATE}.${SCOUNT}" + while [ -e *"$DIR"* ] ; do COUNT=$((COUNT+1)) - DIR="${BASE_DIR}/${DATE}.00${COUNT}/" + SCOUNT=`printf "%03d" $COUNT` + DIR="${BASE_DIR}/${DATE}.${SCOUNT}" done fi - + # normalize paths... + BASE_DIR="./- ${BASE_DIR}/" + DIR="./- $DIR/" mkdir -vp "$DIR" echo "Copying files from $1..." - cp -Rpfv ${BASE}/${DRIVE}/* "$DIR" + $COPY $COPYFLAGS ${BASE}/${DRIVE}/* "$DIR" echo "Copying files: done." diff --git a/ui (gen4)/archive/media/img/my/work/process-archive.sh b/ui (gen4)/archive/media/img/my/work/process-archive.sh index 4a8c10af..4362354d 100755 --- a/ui (gen4)/archive/media/img/my/work/process-archive.sh +++ b/ui (gen4)/archive/media/img/my/work/process-archive.sh @@ -117,9 +117,10 @@ JSON_NAME="%-:1d/${METADATA_DIR}/%f.json" if [ -z $SKIP_ARCHIVE ] ; then exiftool -if '$jpgfromraw' -b -jpgfromraw -w "$PREVIEW_NAME" \ -execute -if '$previewimage' -b -previewimage -w "$PREVIEW_NAME" \ - -execute '-FileModifyDateall' '-xmp' \ + -overwrite_original \ + -execute -j -G -w "$JSON_NAME" \ -common_args --ext jpg -r "./$ARCHIVE_ROOT" -progress fi @@ -288,7 +289,7 @@ fi # build cache... if [ -z $SKIP_CACHE ] ; then # a little tweak to make build cache work... - export PYTHONIOENCODING=UTF-8 + export PYTHONIOENCODING=UTF-8 #if [ -z $TOTAL ] ; then # export TOTAL=`find . -path '*hi-res (RAW)/*.jpg' | wc -l` #fi diff --git a/ui (gen4)/archive/media/img/my/work/sync-flash.sh b/ui (gen4)/archive/media/img/my/work/sync-flash.sh index 83ad94ae..187f6f85 100755 --- a/ui (gen4)/archive/media/img/my/work/sync-flash.sh +++ b/ui (gen4)/archive/media/img/my/work/sync-flash.sh @@ -4,6 +4,16 @@ DATE=`date +%Y%m%d` COUNT=1 TITLE="" +RSYNC=rsync +RSYNCFLAGS="-arptgoA --info=progress2,flist --human-readable" + +CP=cp +CPFLAGS=-Rpfv + +# override default... +COPY=$RSYNC +COPYFLAGS=$RSYNCFLAGS + # base mount dir... # systems with /mnt if [ -d /mnt ] ; then @@ -32,6 +42,8 @@ while true ; do echo " process-archive.sh after copying." echo " -b|-base the base dir to look for drives in" echo " default: $BASE" + echo " --rsync use rsync (default)" + echo " --cp use cp" echo exit ;; @@ -52,6 +64,16 @@ while true ; do BASE=1 shift ;; + -cp|--cp) + COPY=cp + COPYFLAGS=-Rpfv + break + ;; + -rsync|--rsync) + COPY=$RSYNC + COPYFLAGS=$RSYNCFLAGS + break + ;; *) break ;; @@ -118,29 +140,34 @@ while true ; do # XXX do a real three digit count... # single flash card... + SCOUNT=`printf "%03d" $COUNT` if [ -z $MULTI ] ; then - DIR="./- ${DATE}.00${COUNT}${TITLE}/" - while [ -e "$DIR" ] ; do + DIR="${DATE}.${SCOUNT}${TITLE}" + while [ -e *"$DIR"* ] ; do COUNT=$((COUNT+1)) - DIR="./- ${DATE}.00${COUNT}${TITLE}/" + SCOUNT=`printf "%03d" $COUNT` + DIR="${DATE}.${SCOUNT}${TITLE}" done BASE_DIR=$DIR # multiple flash cards shoot... else - BASE_DIR="./- ${DATE}${TITLE}/" - DIR="${BASE_DIR}/${DATE}.00${COUNT}/" - while [ -e "$DIR" ] ; do + BASE_DIR="${DATE}${TITLE}/" + DIR="${BASE_DIR}/${DATE}.${SCOUNT}" + while [ -e *"$DIR"* ] ; do COUNT=$((COUNT+1)) - DIR="${BASE_DIR}/${DATE}.00${COUNT}/" + SCOUNT=`printf "%03d" $COUNT` + DIR="${BASE_DIR}/${DATE}.${SCOUNT}" done fi - + # normalize paths... + BASE_DIR="./- ${BASE_DIR}/" + DIR="./- $DIR/" mkdir -vp "$DIR" echo "Copying files from $1..." - cp -Rpfv ${BASE}/${DRIVE}/* "$DIR" + $COPY $COPYFLAGS ${BASE}/${DRIVE}/* "$DIR" echo "Copying files: done." diff --git a/ui (gen4)/lib/widget/browse2.js b/ui (gen4)/lib/widget/browse2.js index 7878aaf7..ea63859b 100755 --- a/ui (gen4)/lib/widget/browse2.js +++ b/ui (gen4)/lib/widget/browse2.js @@ -1433,6 +1433,7 @@ var BrowserClassPrototype = { // XXX render of nested lists does not affect the parent list(s)... // ...need to render lists and items both as a whole or independently... // XXX should this use vanilla DOM or jQuery??? +// XXX add a left button type/option -- expand/collapse and friends... var BrowserPrototype = { __proto__: BaseBrowser.prototype, @@ -1644,7 +1645,7 @@ var BrowserPrototype = { .run(function(){ // class... // XXX should be done here or in the config??? - this.classList.add('sub-list-header') + this.classList.add('sub-list-header', 'traversable') item.collapsed && this.classList.add('collapsed')