Skip to content

Commit 7b7452f

Browse files
committed
Add option to set private/obscured locations
1 parent 7db6eb6 commit 7b7452f

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

lr-inaturalist-publish.lrdevplugin/ExportServiceProvider.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ local exportServiceProvider = {
2323
{ key = "syncSearchIn", default = -1 },
2424
{ key = "syncTitle", default = false },
2525
{ key = "uploadKeywordsSpeciesGuess", default = true },
26+
{ key = "uploadPrivateLocation", default = "obscured" },
2627
},
2728
hideSections = {
2829
"exportLocation",
@@ -165,6 +166,23 @@ function exportServiceProvider.sectionsForTopOfDialog(f, propertyTable)
165166
alignment = "left",
166167
}),
167168
}),
169+
f:row({
170+
spacing = f:control_spacing(),
171+
f:static_text({
172+
title = "Set observation location for photos in LR private locations",
173+
alignment = "right",
174+
width = LrView.share("inaturalistSyncLabel"),
175+
}),
176+
f:popup_menu({
177+
value = bind("uploadPrivateLocation"),
178+
items = {
179+
{ title = "Public", value = "public" },
180+
{ title = "Obscured", value = "obscured" },
181+
{ title = "Private", value = "private" },
182+
{ title = "Don't set", value = "unset" },
183+
},
184+
}),
185+
}),
168186
}
169187
local synchronization = {
170188
title = "iNaturalist Synchronization",

lr-inaturalist-publish.lrdevplugin/Upload.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ local function updateObservation(observation, photo, exportSettings)
3232
end
3333
end
3434

35+
if not observation.latitude then
36+
local gps = photo:getRawMetadata("gps")
37+
if gps and photo:getRawMetadata("locationIsPrivate") then
38+
local uploadPrivateLocation = exportSettings.uploadPrivateLocation
39+
if uploadPrivateLocation and uploadPrivateLocation ~= "unset" then
40+
observation.latitude = gps.latitude
41+
observation.longitude = gps.longitude
42+
observation.geoprivacy = uploadPrivateLocation
43+
end
44+
end
45+
end
46+
3547
return observation
3648
end
3749

0 commit comments

Comments
 (0)