SET_COOKIE +$((86400 * 90)) mode="$(POST mode |grep -m1 -axE 'browse|index' || printf browse)"
SET_COOKIE +$((86400 * 90)) fakemp4="$(POST fakemp4 |grep -m1 -axE 'yes' || printf no)"
SET_COOKIE +$((86400 * 90)) downscale="$(POST downscale |grep -m1 -axE 'yes' || printf no)"
- [ "$(POST index)" = "update" ] && touch -cd @0 "${_DATA}/.index/meta"
+ [ "$(POST index)" = "update" ] && touch -cd @0 "${_DATA}/.index/meta.time"
REDIRECT "$(POST ref)"
;;
bookmark)
local dir meta v
dir="${1}"
meta="${dir}/.index/meta"
+ metat="${dir}/.index/meta.time"
+
+ [ -f "$metat" ] || touch -d @0 "$metat"
if [ -d "$dir/.index" -a \! -f "$meta" ] && LOCK "$meta"; then
touch "$meta" # preliminary touch to prevent concurrent generators
done >"$meta"
RELEASE "$meta"
- elif [ -d "$dir/.index" -a "$dir" -nt "$meta" ] && LOCK "$meta"; then
+ elif [ -d "$dir/.index" -a "$dir" -nt "$metat" ] && LOCK "$meta"; then
cp -p "$meta" "$meta.ref"; touch "$meta"
- find "$dir" -type f -newer "$meta.ref" \
+ find "$dir" -type f -newer "$metat" \
-mindepth 1 -maxdepth 1 \
| grep -aE "$file_pattern" \
| while read -r v; do
done >>"$meta"
sort -u "$meta" >"$meta.ref"
mv "$meta.ref" "$meta"
+ touch "$metat"
RELEASE "$meta"
fi