master
bel 2024-09-07 15:35:09 -06:00
parent 8af32661eb
commit f2d24c6e2a
1 changed files with 13 additions and 1 deletions

View File

@ -31,6 +31,18 @@ main() {
-X DELETE
fi
done
local too_old_unix="$(($(_date +%s) - 30 * 24 * 60 * 60))" # 30d ago
local too_old_ts="$(_date -d @$too_old_unix -u +%Y-%m-%d_%H-%M-%S)"
for recording in $(
api "/api/recording/query?recording-id=${too_old_ts}_x&limit=10000&reverse=false&include-data=false" \
| jq -r .[].id \
| sort
); do
echo "$recording is too old"
echo api "/api/recording/delete/$recording" \
-X DELETE
done
}
video_has_movement() {
@ -52,7 +64,7 @@ video_has_movement() {
threshold="$max_of_last_n"
fi
done
threshold="$(_perl -e "print $threshold + 0.005")"
threshold="$(_perl -e "print $threshold + 0.01")"
local has_change=false
if [ "${#flattened_scores[@]}" -lt 10 ]; then