@@ -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