commit b2475712c27f14f1657a6ae544d53032320994ba Author: GRayHook Date: Sat Jun 14 10:04:03 2025 +0700 init diff --git a/fix_gto.sh b/fix_gto.sh new file mode 100755 index 0000000..645e33b --- /dev/null +++ b/fix_gto.sh @@ -0,0 +1,17 @@ +#!/bin/bash +while read -r json_file; do + dirname=$(dirname "$json_file") + picture_ts=$(jq -r '.photoTakenTime.timestamp' "$json_file") + filename=$(jq -r '.title' "$json_file") + if [[ "$filename" != "null" ]]; then + filename="$dirname/$filename" + if [[ -e "$filename" ]]; then + touch_string=$(date -d "@$picture_ts" +%Y%m%d%H%M) + ls -la "$filename" + touch -m -t "$touch_string" "$filename" + ls -la "$filename" + else + >&2 echo "Cannot find $filename referenced by $json_file" + fi + fi +done < <(find ./ -name "*.json")