Skip to content

Commit 5f9f421

Browse files
committed
Fix custom publish regressions: prevent propertyTable corruption on upload failure and preserve global resize when no album override is set
1 parent 6bd86e3 commit 5f9f421

5 files changed

Lines changed: 39 additions & 21 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Changelog
2-
## [20269999.99]
2+
## [20260305.34]
33
### Fixed
44
Fix #45 Unable to remove photos from Piwigo
55
Associating an existing image with a new album should force re-upload of image if it had been changed in LrC since first upload to Piwigo
66
### Added
7-
Fix #12 Feature request: Keyword removal by filtering when publising images to Piwigo
87
Image assoication behaviour made optional to allow per-album custom export settings
8+
Fix #12 Feature request: Keyword removal by filtering when publising images to Piwigo
9+
Fix #14 Incorporate per-album custom export settings
910

1011
## [20260221.33] - 2026-02-21
1112
### Fixed

piwigoPublish.lrplugin/Info.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,5 @@ return {
6666

6767
LrPluginInfoProvider = 'PluginInfo.lua',
6868

69-
VERSION = { major=20269999, minor=99, revision=0 },
69+
VERSION = { major=20260305, minor=34, revision=0 },
7070
}

piwigoPublish.lrplugin/Init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ _G.iconPath = _PLUGIN:resourceId("icons/icon_med.png")
7979
-- _PLUGIN.VERSION is nil here for some reason, so hardcoding for now
8080
-- just need to ensure both places are updated together
8181

82-
_G.versionInfo = { major=20269999, minor=99, revision=0 }
82+
_G.versionInfo = { major=20260305, minor=34, revision=0 }
8383

8484
_G.pluginVersion = string.format("%d.%d", versionInfo.major, versionInfo.minor)
8585
-- Auto-update checker

piwigoPublish.lrplugin/PublishTaskImageProcessing.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ local function buildCustomOverrideSettings(sourceSettings, collectionSettings)
123123
overrideSettings.LR_size_userWantsConstrain = false
124124
end
125125
else
126-
overrideSettings.LR_size_doConstrain = false
127-
overrideSettings.LR_size_userWantsConstrain = false
126+
-- no custom resize override requested for this collection;
127+
-- preserve the global export resize settings from sourceSettings
128128
end
129129

130130
return overrideSettings

piwigoPublish.lrplugin/utils.lua

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,38 @@ end
9898
-- *************************************************
9999
function utils.anonymiseRenditionParams(renditionParams)
100100
-- return copy of renditionParams with sensitive data removed (for logging etc)
101-
local rpCopy = {}
102-
for k, v in pairs(renditionParams) do
103-
rpCopy[k] = v
104-
end
105-
106-
rpCopy.exportContext.propertyTable.userPW = "****"
107-
rpCopy.exportContext.propertyTable.userName = "****"
108-
rpCopy.exportContext.propertyTable.host = "****"
109-
rpCopy.exportContext.propertyTable.pwurl = "****"
110-
rpCopy.exportContext.propertyTable.cookieHeader = "****"
111-
rpCopy.exportContext.propertyTable.SessionCookie = "**** "
112-
rpCopy.exportContext.propertyTable.token = "****"
113-
rpCopy.exportContext.propertyTable.cookies = "****"
114-
rpCopy.exportContext.propertyTable.tagTable = nil
115-
rpCopy.exportContext.propertyTable._tagIndex = nil
101+
if type(renditionParams) ~= "table" then
102+
return renditionParams
103+
end
104+
105+
local visited = {}
106+
107+
local function deepCopy(value)
108+
if type(value) ~= "table" then
109+
return value
110+
end
111+
if visited[value] then
112+
return visited[value]
113+
end
114+
115+
local copy = {}
116+
visited[value] = copy
117+
for k, v in pairs(value) do
118+
copy[k] = deepCopy(v)
119+
end
120+
return copy
121+
end
122+
123+
local rpCopy = deepCopy(renditionParams)
124+
125+
if type(rpCopy.exportContext) == "table" and type(rpCopy.exportContext.propertyTable) == "table" then
126+
rpCopy.exportContext.propertyTable = utils.anonymisePropertyTable(rpCopy.exportContext.propertyTable)
127+
end
128+
129+
if type(rpCopy.propertyTable) == "table" then
130+
rpCopy.propertyTable = utils.anonymisePropertyTable(rpCopy.propertyTable)
131+
end
132+
116133
return rpCopy
117134
end
118135

0 commit comments

Comments
 (0)