From 46dd67f9571fae1d3c9e938901bee28069c0cd2f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Wed, 18 Jul 2018 07:49:33 +0200 Subject: [PATCH] sanitizing and rereading of meta data --- multitag.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/multitag.sh b/multitag.sh index 49bf273..649fb78 100644 --- a/multitag.sh +++ b/multitag.sh @@ -7,12 +7,20 @@ for select in $(seq 1 $(POST_COUNT select)); do file="$_DATA/$ITEM/$(POST select $select)" meta="${file%/*}/.index/meta" - read -r length width height tags comment fn <<-EOF + fn="$(meta_name "$file")" + read -r length width height tags comment discard <<-EOF $(meta_info "$file") EOF + [ "${length%%[1-9]*}" -o "${width%%[1-9]*}" -o "${height%%[1-9]*}" = 0 ] \ + && read -r length width height discard <<-EOF + $(meta_line "$file"; echo Rereading meta for "$file" >&2) + EOF + [ "${tags%%tags=*}" ] && tags='tags='; + [ "${comment%%comment=*}" ] && comment='comment=' if LOCK "$meta"; then - grep -vF " $fn" "$meta" >"${meta}.tmp" + grep -avF " $fn" "$meta" >"${meta}.tmp" + tags="$(UNSTRING "${tags#tags=}" |tr , '\n')" for tn in $(seq 1 $(POST_COUNT tag)); do -- 2.39.2