Skip to content

Commit 744f17b

Browse files
committed
Fix #41 Problem with 'Clone Existing Publish Service - public/private setting
1 parent 58cb8fb commit 744f17b

4 files changed

Lines changed: 47 additions & 20 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# Changelog
2+
3+
## [20260205.30] - 2026-02-05
4+
### Fixed
5+
Fix #41 Problem with 'Clone Existing Publish Service - public/private setting
6+
7+
### Added
8+
- Preparation for locatalistion
9+
210
## [20260126.29] - 2026-01-26
311
### Fixed
412
Fix #41 Allow clone service to include unpublished photos from standard published collections

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=20260126, minor=29, revision=0 },
69+
VERSION = { major=20260205, minor=30, 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=20260126, minor=29, revision=0 }
82+
_G.versionInfo = { major=20260205, minor=30, revision=0 }
8383

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

piwigoPublish.lrplugin/PWImportService.lua

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -356,13 +356,13 @@ local function createTree(nodes, parentSet, publishService, created, childrenInd
356356
local remoteAlbumId = node.remoteId
357357
local remoteAlbumUrl
358358
local comment = ""
359-
local status = ""
359+
local status = "public"
360360
local isSmartColl = false
361361
local searchDesc
362362
if extra then
363363
if extra.collSettings then
364364
comment = extra.collSettings.comment or ""
365-
status = extra.collSettings.status or ""
365+
status = extra.collSettings.status or "public"
366366
end
367367
isSmartColl = extra.isSmartColl
368368
searchDesc = extra.searchDesc
@@ -388,22 +388,36 @@ local function createTree(nodes, parentSet, publishService, created, childrenInd
388388
local collectionSettings = newCollorSet:getCollectionSetInfoSummary().collectionSettings or {}
389389
if propertyTable.syncAlbumDescriptions then
390390
collectionSettings.albumDescription = comment
391-
collectionSettings.albumPrivate = status == "private"
392391
else
393392
collectionSettings.albumDescription = ""
394-
collectionSettings.albumPrivate = "public"
395393
end
394+
if status == "private" then
395+
collectionSettings.albumPrivate = true
396+
else
397+
collectionSettings.albumPrivate = false
398+
end
399+
396400
if remoteAlbumId then
397401
local thisCat = PiwigoAPI.pwCategoriesGetThis(propertyTable, remoteAlbumId)
398402
if thisCat then
399-
if thisCat.name == name then
400-
albumUrl = propertyTable.host .. "/index.php?/category/" .. remoteAlbumId
401-
catalog:withWriteAccessDo("Add Piwigo details to collections", function()
402-
newCollorSet:setRemoteId(remoteAlbumId)
403-
newCollorSet:setRemoteUrl(albumUrl)
404-
newCollorSet:setCollectionSetSettings(collectionSettings)
405-
end)
403+
if propertyTable.syncAlbumDescriptions then
404+
if thisCat.description then
405+
collectionSettings.albumDescription = thisCat.description
406+
else
407+
collectionSettings.albumDescription = ""
408+
end
409+
end
410+
if thisCat.status == "public" then
411+
collectionSettings.albumPrivate = false
412+
else
413+
collectionSettings.albumPrivate = true
406414
end
415+
albumUrl = propertyTable.host .. "/index.php?/category/" .. remoteAlbumId
416+
catalog:withWriteAccessDo("Add Piwigo details to collections", function()
417+
newCollorSet:setRemoteId(remoteAlbumId)
418+
newCollorSet:setRemoteUrl(albumUrl)
419+
newCollorSet:setCollectionSetSettings(collectionSettings)
420+
end)
407421
end
408422
end
409423
end
@@ -453,17 +467,22 @@ local function createTree(nodes, parentSet, publishService, created, childrenInd
453467
if pwDetails.isPiwigo and pwDetails.isSameHost then
454468
-- this is the same Piwigo host then we can copy remote ids etc
455469
local collectionSettings = newCollorSet:getCollectionInfoSummary().collectionSettings or {}
456-
if propertyTable.syncAlbumDescriptions then
457-
collectionSettings.albumDescription = comment
458-
collectionSettings.albumPrivate = status == "private"
459-
else
460-
collectionSettings.albumDescription = ""
461-
collectionSettings.albumPrivate = "public"
462-
end
463470
if remoteAlbumId then
464471
-- check if remoote album exists and add to collection if so
465472
local thisCat = PiwigoAPI.pwCategoriesGetThis(propertyTable, remoteAlbumId)
466473
if thisCat then
474+
if propertyTable.syncAlbumDescriptions then
475+
if thisCat.description then
476+
collectionSettings.albumDescription = thisCat.description
477+
else
478+
collectionSettings.albumDescription = ""
479+
end
480+
end
481+
if thisCat.status == "public" then
482+
collectionSettings.albumPrivate = false
483+
else
484+
collectionSettings.albumPrivate = true
485+
end
467486
albumUrl = propertyTable.host .. "/index.php?/category/" .. remoteAlbumId
468487
catalog:withWriteAccessDo("Add Piwigo details to collections", function()
469488
newCollorSet:setRemoteId(remoteAlbumId)

0 commit comments

Comments
 (0)