- file="$_DATA/$ITEM/$(POST select $select |PATH)"
- meta="${file%/*}/.index/meta"
-
- read -r length width height tags comment fn <<-EOF
- $(meta_info "$file")
- EOF
-
- if [ ! "$deltags" ]; then
- extags="$(printf '%s' "$newtags" |tr , '\n' |grep -e "^-" |cut -d: -f1 )"
- tags="$(UNSTRING "${tags#tags=}" |tr , '\n' |grep -vwFe "$extags")"
- if printf %s "$extags" |grep -vq :; then
- tags="$(printf %s\\n "$tags" |grep -vE '^-[^:]+$')"
+ file="$(POST select $select)"
+ read_meta "${file%.*}" || continue
+
+ tags="$(printf %s\\n "$META_TAGS" |tr , \\n)"
+
+ if [ "$op" = add ]; then
+ extags="$(printf '%s' "${newtags}" |grep -e "^-" |cut -d: -f1 )"
+ [ "$extags" ] && tags="$(printf %s\\n "$tags" |grep -vwFe "$extags")"
+ if printf %s "${newtags}" |grep -e "^-" |grep -qEe "^-[^:]+$"; then
+ tags="$(printf %s\\n "$tags" |grep -vEe '^-[^:]+$')"