Some minor updates to the site and search API.

This commit is contained in:
Darren 'Tadgy' Austin 2024-08-03 17:42:04 +01:00
commit 1428652b84
5 changed files with 86 additions and 4 deletions

View file

@ -89,7 +89,22 @@ else
[[ "${ITEM/$STORAGE_PREFIX}" == "$QS_p" ]] && continue
# List the item.
printf "%s\\n" "${ITEM/$STORAGE_PREFIX}"
if [[ -f "$ITEM" ]]; then
# File type.
printf "%s %s\\n" "f" "${ITEM/$STORAGE_PREFIX}"
elif [[ -d "$ITEM" ]]; then
# Directory type.
printf "%s %s\\n" "d" "${ITEM/$STORAGE_PREFIX}"
elif [[ -L "$ITEM" ]]; then
# Symbolic link type.
printf "%s %s\\n" "l" "${ITEM/$STORAGE_PREFIX}"
elif [[ -e "$ITEM" ]]; then
# Other type.
printf "%s %s\\n" "o" "${ITEM/$STORAGE_PREFIX}"
else
# Stale file in database.
printf "%s %s\\n" "?" "${ITEM/$STORAGE_PREFIX}"
fi
(( I++ ))
done < <(locate -A -d "$LOCATE_DB" -i -l "$(( QS_l * 2 ))" "$STORAGE_PREFIX/${QS_p##/}" $QS_q | sort)