Skip to content

Commit c372feb

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents aa50c7e + a3308f5 commit c372feb

15 files changed

Lines changed: 425 additions & 377 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ copilot-instructions.md
2121

2222
# i18n
2323
localize_plugin.py
24+
extract_localizable_strings.py
2425
localization_report.txt

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# Changelog
2+
## [20260124.28] - 2026-01-24
3+
### Added
4+
- Synchronisation of photos based on the Lr parameter: photoId, and Update system compatible with GitHub RCs. - PR (#40) - thank you @Gotcha26
5+
6+
27
## [20260122.27] - 2026-01-22
38
### Fixed
49
#37 An error occurred while deleting images

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ You should have received a copy of the GNU General Public License along with thi
2222

2323
As a user of both Lightroom Classic and Piwigo, the ability use the powerful Publishing Service in LrC to keep my Piwigo galleries up to date is very appealing. I've been a long time user of a popular plugin that has been providing this functionality, but unfortunately since the version 15 release of LrC that has not been available.
2424

25-
This plugin is my attempt to allow me to continue publishing to Piwigo from LrC, and I have looked at the work of others for help and ideas in developing this plugin. In particular, the following should be credited:
25+
This plugin was developed to allow me to continue publishing to Piwigo from LrC, and I have looked at the work of others for help and ideas in developing this plugin. In particular, the following should be credited:
2626

2727
[All the contributers to Piwigo](https://piwigo.org/)
2828

29+
[Julien Moreau for contributing various improvements](https://julien-moreau.fr/)
30+
2931
[Jeffrey Friedl for JSON.lua](http://regex.info/blog/lua/json)
3032

3133
[Bastian Machek with his Immich Plugin](https://github.com/bmachek/lrc-immich-plugin)

piwigoPublish.lrplugin/Info.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ return {
2525
LrPluginName = "Piwigo Publisher",
2626
-- typo in PwigoPublish is noted but can't be changed without forcing all services using this plugin to be re-initialised.
2727
LrToolkitIdentifier = "fiona.boston.PwigoPublish",
28-
-- LrToolkitIdentifier = "fiona.boston.PiwigoPublish",
2928
LrMetadataProvider = 'CustomMetadata.lua',
3029
LrMetadataTagsetFactory = 'Tagset.lua',
3130
LrInitPlugin = "Init.lua",
@@ -67,5 +66,5 @@ return {
6766

6867
LrPluginInfoProvider = 'PluginInfo.lua',
6968

70-
VERSION = { major=20260122, minor=27, revision=0 },
69+
VERSION = { major=20260124, minor=28, revision=0 },
7170
}

piwigoPublish.lrplugin/Init.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,12 @@ end
7575
_G.iconPath = _PLUGIN:resourceId("icons/icon_med.png")
7676

7777
-- Build version string from Info.lua VERSION table
78-
local versionInfo = _PLUGIN.VERSION or { major = 0, minor = 0, revision = 0 }
78+
--local versionInfo = _PLUGIN.VERSION or { major = 0, minor = 0, revision = 0 }
79+
-- _PLUGIN.VERSION is nil here for some reason, so hardcoding for now
80+
-- just need to ensure both places are updated together
81+
82+
_G.versionInfo = { major=20260124, minor=28, revision=0 }
83+
7984
_G.pluginVersion = string.format("%d.%d", versionInfo.major, versionInfo.minor)
8085
-- Auto-update checker
8186
_G.UpdateChecker = require "UpdateChecker"
@@ -91,5 +96,4 @@ LrTasks.startAsyncTask(function()
9196
UpdateChecker.checkForUpdates(true) -- silent = true
9297
end
9398
end)
94-
--_G.LocStrings = utils.loadStrings()
9599

piwigoPublish.lrplugin/Locales/en.lrproj/PluginStrings.txt

Lines changed: 99 additions & 122 deletions
Large diffs are not rendered by default.

piwigoPublish.lrplugin/Locales/fr.lrproj/PluginStrings.txt

Lines changed: 133 additions & 157 deletions
Large diffs are not rendered by default.

piwigoPublish.lrplugin/PWExtraOptions.lua

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
along with this program. If not, see <http://www.gnu.org/licenses/>.
2121
]]
2222

23+
require "UIHelpers"
24+
2325
-- *************************************************
2426
-- Define a value_equal function for the popup_menu
2527
local function valueEqual(a, b)
@@ -64,31 +66,7 @@ local function main()
6466
local c = f:column {
6567
spacing = f:dialog_spacing(),
6668

67-
f:row {
68-
f:picture {
69-
alignment = 'left',
70-
value = iconPath,
71-
},
72-
f:column {
73-
spacing = f:control_spacing(),
74-
f:spacer { height = 1 },
75-
f:row {
76-
f:static_text {
77-
title = " Piwigo Publisher Plugin",
78-
font = "<system/bold>",
79-
alignment = 'left',
80-
width = share 'labelWidth',
81-
},
82-
},
83-
f:row {
84-
f:static_text {
85-
title = " Plugin Version " .. pluginVersion,
86-
alignment = 'left',
87-
width = share 'labelWidth',
88-
},
89-
},
90-
},
91-
},
69+
UIHelpers.createPluginHeader(f, share, iconPath, pluginVersion),
9270

9371
f:row {
9472
spacing = f:label_spacing(),

piwigoPublish.lrplugin/PiwigoAPI.lua

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,14 +1430,14 @@ end
14301430
function PiwigoAPI.getCommentInfos(propertyTable)
14311431
-- return output from pwg.userComments.getList
14321432
-- primarily used to check if comments are enabled on this Piwigo host
1433-
log:info("PiwigoAPI.getComments")
1433+
log:info("PiwigoAPI.getCommentInfos")
14341434
local rtnStatus = {}
14351435
rtnStatus.status = false
14361436
rtnStatus.commentsEnabled = false
14371437
-- successful connection, now get user role and token via pwg.session.getStatus
14381438
local Params = { {
14391439
name = "method",
1440-
value = "pwg.pwg.userComments.getList"
1440+
value = "pwg.userComments.getList"
14411441
} }
14421442
-- build headers to include cookies from pwConnect call
14431443
local headers = {}
@@ -1448,9 +1448,9 @@ function PiwigoAPI.getCommentInfos(propertyTable)
14481448
end
14491449
local getResponse = httpGet(propertyTable.pwurl, Params, headers)
14501450
if (not getResponse.response) then
1451-
log:info("PiwigoAPI.getComments - Params\n" .. utils.serialiseVar(Params))
1452-
log:info("PiwigoAPI.getComments - headers\n" .. utils.serialiseVar(headers))
1453-
log:info("PiwigoAPI.getComments - getResponse\n" .. utils.serialiseVar(getResponse))
1451+
log:info("PiwigoAPI.getCommentInfos - Params\n" .. utils.serialiseVar(Params))
1452+
log:info("PiwigoAPI.getCommentInfos - headers\n" .. utils.serialiseVar(headers))
1453+
log:info("PiwigoAPI.getCommentInfos - getResponse\n" .. utils.serialiseVar(getResponse))
14541454
LrDialogs.message("Cannot get comments information from Piwigo - Unknown error")
14551455
return rtnStatus
14561456
end
@@ -2450,10 +2450,6 @@ function PiwigoAPI.deletePhoto(propertyTable, pwCatID, pwImageID, callStatus)
24502450
value = propertyTable.token
24512451
} }
24522452

2453-
log:info("PiwigoAPI.deletePhoto - propertyTable \n " .. utils.serialiseVar(propertyTable))
2454-
log:info("PiwigoAPI.deletePhoto - params \n" .. utils.serialiseVar(params))
2455-
-- log:info("PiwigoAPI.deletePhoto - headrs \n" .. utils.serialiseVar(headers))
2456-
24572453
local httpResponse, httpHeaders = LrHttp.postMultipart(propertyTable.pwurl, params, {
24582454
headers = {
24592455
field = "Cookie",
@@ -2462,9 +2458,6 @@ function PiwigoAPI.deletePhoto(propertyTable, pwCatID, pwImageID, callStatus)
24622458
}
24632459
})
24642460

2465-
log:info("PiwigoAPI.deletePhoto - httpResponse \n" .. utils.serialiseVar(httpResponse))
2466-
log:info("PiwigoAPI.deletePhoto - httpHeaders \n" .. utils.serialiseVar(httpHeaders))
2467-
24682461
local body
24692462
if httpResponse then
24702463
body = JSON:decode(httpResponse)
@@ -2475,10 +2468,18 @@ function PiwigoAPI.deletePhoto(propertyTable, pwCatID, pwImageID, callStatus)
24752468
callStatus.status = true
24762469
callStatus.statusMsg = ""
24772470
else
2471+
log:info("PiwigoAPI.deletePhoto - propertyTable \n " .. utils.serialiseVar(propertyTable))
2472+
log:info("PiwigoAPI.deletePhoto - params \n" .. utils.serialiseVar(params))
2473+
log:info("PiwigoAPI.deletePhoto - httpResponse \n" .. utils.serialiseVar(httpResponse))
2474+
log:info("PiwigoAPI.deletePhoto - httpHeaders \n" .. utils.serialiseVar(httpHeaders))
24782475
callStatus.status = false
24792476
callStatus.statusMsg = body.message or ""
24802477
end
24812478
else
2479+
log:info("PiwigoAPI.deletePhoto - propertyTable \n " .. utils.serialiseVar(propertyTable))
2480+
log:info("PiwigoAPI.deletePhoto - params \n" .. utils.serialiseVar(params))
2481+
log:info("PiwigoAPI.deletePhoto - httpResponse \n" .. utils.serialiseVar(httpResponse))
2482+
log:info("PiwigoAPI.deletePhoto - httpHeaders \n" .. utils.serialiseVar(httpHeaders))
24822483
callStatus.status = false
24832484
callStatus.statusMsg = body.message or ""
24842485
end
@@ -2575,12 +2576,6 @@ function PiwigoAPI.addComment(publishSettings, metaData)
25752576
return false
25762577
end
25772578
--end
2578-
-- log:info("PiwigoAPI.addComment - publishSettings\n" .. utils.serialiseVar(publishSettings))
2579-
-- check role is admin level
2580-
--if publishSettings.userStatus ~= "webmaster" then
2581-
-- LrDialogs.message("PiwigoAPI.addComment - user needs webmaster role ")
2582-
-- return false
2583-
--end
25842579

25852580
-- get antispam token from image details (unique for each image)
25862581
local rtnStatus = PiwigoAPI.checkPhoto(publishSettings, metaData.remoteId)

piwigoPublish.lrplugin/PluginInfoDialogSections.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ local function resetPluginPrefs(prefix)
3131
log:info("resetPluginPrefs \n" .. utils.serialiseVar(prefs))
3232
for k, p in prefs:pairs() do
3333
if prefix then
34-
log:info("resetting " .. utils.serialiseVar(k))
3534
if k:find(prefix, 1, true) == 1 then
3635
prefs[k] = nil
3736
end
3837
else
39-
log:info("resetting " .. utils.serialiseVar(k))
4038
prefs[k] = nil
4139
end
4240
end
@@ -63,6 +61,7 @@ function PluginInfoDialogSections.startDialog(propertyTable)
6361
else
6462
log:disable()
6563
end
64+
6665
propertyTable.debugEnabled = prefs.debugEnabled
6766
propertyTable.debugToFile = prefs.debugToFile
6867
end

0 commit comments

Comments
 (0)