Skip to content

Commit

Permalink
Add option to set private/obscured locations
Browse files Browse the repository at this point in the history
  • Loading branch information
rcloran committed May 13, 2023
1 parent 7db6eb6 commit 7b7452f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lr-inaturalist-publish.lrdevplugin/ExportServiceProvider.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ local exportServiceProvider = {
{ key = "syncSearchIn", default = -1 },
{ key = "syncTitle", default = false },
{ key = "uploadKeywordsSpeciesGuess", default = true },
{ key = "uploadPrivateLocation", default = "obscured" },
},
hideSections = {
"exportLocation",
Expand Down Expand Up @@ -165,6 +166,23 @@ function exportServiceProvider.sectionsForTopOfDialog(f, propertyTable)
alignment = "left",
}),
}),
f:row({
spacing = f:control_spacing(),
f:static_text({
title = "Set observation location for photos in LR private locations",
alignment = "right",
width = LrView.share("inaturalistSyncLabel"),
}),
f:popup_menu({
value = bind("uploadPrivateLocation"),
items = {
{ title = "Public", value = "public" },
{ title = "Obscured", value = "obscured" },
{ title = "Private", value = "private" },
{ title = "Don't set", value = "unset" },
},
}),
}),
}
local synchronization = {
title = "iNaturalist Synchronization",
Expand Down
12 changes: 12 additions & 0 deletions lr-inaturalist-publish.lrdevplugin/Upload.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ local function updateObservation(observation, photo, exportSettings)
end
end

if not observation.latitude then
local gps = photo:getRawMetadata("gps")
if gps and photo:getRawMetadata("locationIsPrivate") then
local uploadPrivateLocation = exportSettings.uploadPrivateLocation
if uploadPrivateLocation and uploadPrivateLocation ~= "unset" then
observation.latitude = gps.latitude
observation.longitude = gps.longitude
observation.geoprivacy = uploadPrivateLocation
end
end
end

return observation
end

Expand Down

0 comments on commit 7b7452f

Please sign in to comment.