3 . "$_EXEC/cgilite/storage.sh"
4 . "$_EXEC/indexmeta.sh"
7 for tn in $(seq 1 $(POST_COUNT tag)); do
8 newtags="${newtags},$(POST tag $tn)"
10 newtags="${newtags},$(POST newtag |tr -d '\r')"
12 for select in $(seq 1 $(POST_COUNT select)); do
13 file="$_DATA/$ITEM/$(POST select $select |PATH)"
14 meta="${file%/*}/.index/meta"
16 read -r length width height tags comment fn <<-EOF
20 tags="$(UNSTRING "${tags#tags=}")"
21 tags="$(printf '%s\n' "${tags}" "${newtags}" |tr , '\n' |sort -u |tr '\n' , |STRING)"
22 tags="${tags#,}"; tags="${tags%,}"
25 grep -avF " $fn" "$meta" >"${meta}.tmp"
27 printf '%i %i %i tags=%s comment=%s %s\n' \
28 "$length" "$width" "$height" "$tags" \
29 "${comment#comment=}" "$fn" \
31 mv "${meta}.tmp" "$meta"