SDK: LrExportSession - handling of LrProgressScope is broken.
Hi.
It's me again, maybe I'm just lucky...
Here is my test code:
local progressTitle = "Exporting..."
local progressScope = LrProgressScope{ title = progressTitle }
local exportSession = LrExportSession{ photosToExport = photos, exportSettings = settings }
local renderOptions =
{
progressScope = progressScope,
renderProgressPortion = progressPortion or 1,
stopIfCanceled = true
}
progressScope:setPortionComplete(0, 1)
LrDialogs.message("ProgressStart="..progressScope:getPortionComplete())
for _, rendition in exportSession:renditions(renderOptions)
local success, pathOrMessage = rendition:waitForRender()
if not success then rendition:uploadFailed(pathOrMessage) end
LrDialogs.message("Progress="..progressScope:getPortionComplete())
end
LrDialogs.message("ProgressEnd="..progressScope:getPortionComplete())
-- set some flag to indicate export cancelation if it's needed
if progressScope:isCanceled() then exportCancel=true end
There are two issues with this:
1. progressScope is only updated by the next iterator call, so if there is only one photo to render - it's never updated and stays at 0. If exporting 4 photos - it stays at 0.75 after export, etc
2. progressScope is always reset by exportSession:renditions() - it always starts from 0.
What's the point in having the ability to specify partial progress with renderProgressPortion if you can't continue later?
Both doesn't look by design to me.
Can someone confirm?
@johnrellis- maybe you can check?
Doesn't seem to be a lot of developers in here...
