Google Maps saved lists from a scheduled Google Takeout: hourly check of TAKEOUT_DIR (brick's Drive backup, mounted read-only), the zip with Takeout/Saved/*.csv picked by its central directory (photo parts skipped), each list into Google Maps/<list>; positions decoded offline from the place's S2 feature id and refined by Nominatim, unresolved ones flagged approximate in the popup (cleared when moved by hand); points matched by Google id per folder, so a new export updates them (own color/icon/position kept, deleted stay deleted)
CI / check (push) Successful in 8m56s
CI / deploy (push) Successful in 38s

This commit is contained in:
randy committed 2026-11-25 15:10:30 +01:00
1 parent 261b4c053e
commit 0aee739ac3
9 files changed
+306 -1

No files matched your search

+18
View File
@@ -8,6 +8,7 @@ require_relative "lib/maptool/gpx"
require_relative "lib/maptool/fit"
require_relative "lib/maptool/gpx_store"
require_relative "lib/maptool/library"
require_relative "lib/maptool/google_saved"
require_relative "lib/maptool/routing"
require_relative "lib/maptool/gpsd_client"
require_relative "lib/maptool/mqtt_client"
@@ -127,6 +128,23 @@ module Maptool
rescue StandardError => e
warn "library reparse failed: #{e.message}"
end
# Google Maps saved lists from a scheduled Google Takeout (product
# "Saved"), synced into TAKEOUT_DIR (mounted read-only, see
# docker-compose.yaml): checked hourly, a new export is imported into
# Tracks & Points under "Google Maps/<list>" (GoogleSaved). Unset = off.
TAKEOUT_DIR = ENV.fetch("TAKEOUT_DIR", "")
unless TAKEOUT_DIR.empty? || test?
Thread.new do
loop do
count = GoogleSaved.import_takeout(TAKEOUT_DIR, library: LIBRARY, state_path: File.join(DATA_DIR, "takeout_imported"))
warn "takeout: imported #{count} saved places" if count
rescue StandardError => e
warn "takeout import failed: #{e.class}: #{e.message}"
ensure
sleep 3600
end
end
end
LIVETRACK_STORE = LiveTrackStore.new(File.join(DATA_DIR, "livetrack.json"))
# Not under DATA_DIR: unlike everything else there (uploads, PMTiles,