@@ -1430,14 +1430,14 @@ end
14301430function 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
@@ -2340,10 +2340,6 @@ function PiwigoAPI.deletePhoto(propertyTable, pwCatID, pwImageID, callStatus)
23402340 value = propertyTable .token
23412341 } }
23422342
2343- log :info (" PiwigoAPI.deletePhoto - propertyTable \n " .. utils .serialiseVar (propertyTable ))
2344- log :info (" PiwigoAPI.deletePhoto - params \n " .. utils .serialiseVar (params ))
2345- -- log:info("PiwigoAPI.deletePhoto - headrs \n" .. utils.serialiseVar(headers))
2346-
23472343 local httpResponse , httpHeaders = LrHttp .postMultipart (propertyTable .pwurl , params , {
23482344 headers = {
23492345 field = " Cookie" ,
@@ -2352,9 +2348,6 @@ function PiwigoAPI.deletePhoto(propertyTable, pwCatID, pwImageID, callStatus)
23522348 }
23532349 })
23542350
2355- log :info (" PiwigoAPI.deletePhoto - httpResponse \n " .. utils .serialiseVar (httpResponse ))
2356- log :info (" PiwigoAPI.deletePhoto - httpHeaders \n " .. utils .serialiseVar (httpHeaders ))
2357-
23582351 local body
23592352 if httpResponse then
23602353 body = JSON :decode (httpResponse )
@@ -2365,10 +2358,18 @@ function PiwigoAPI.deletePhoto(propertyTable, pwCatID, pwImageID, callStatus)
23652358 callStatus .status = true
23662359 callStatus .statusMsg = " "
23672360 else
2361+ log :info (" PiwigoAPI.deletePhoto - propertyTable \n " .. utils .serialiseVar (propertyTable ))
2362+ log :info (" PiwigoAPI.deletePhoto - params \n " .. utils .serialiseVar (params ))
2363+ log :info (" PiwigoAPI.deletePhoto - httpResponse \n " .. utils .serialiseVar (httpResponse ))
2364+ log :info (" PiwigoAPI.deletePhoto - httpHeaders \n " .. utils .serialiseVar (httpHeaders ))
23682365 callStatus .status = false
23692366 callStatus .statusMsg = body .message or " "
23702367 end
23712368 else
2369+ log :info (" PiwigoAPI.deletePhoto - propertyTable \n " .. utils .serialiseVar (propertyTable ))
2370+ log :info (" PiwigoAPI.deletePhoto - params \n " .. utils .serialiseVar (params ))
2371+ log :info (" PiwigoAPI.deletePhoto - httpResponse \n " .. utils .serialiseVar (httpResponse ))
2372+ log :info (" PiwigoAPI.deletePhoto - httpHeaders \n " .. utils .serialiseVar (httpHeaders ))
23722373 callStatus .status = false
23732374 callStatus .statusMsg = body .message or " "
23742375 end
@@ -2465,12 +2466,6 @@ function PiwigoAPI.addComment(publishSettings, metaData)
24652466 return false
24662467 end
24672468 -- end
2468- -- log:info("PiwigoAPI.addComment - publishSettings\n" .. utils.serialiseVar(publishSettings))
2469- -- check role is admin level
2470- -- if publishSettings.userStatus ~= "webmaster" then
2471- -- LrDialogs.message("PiwigoAPI.addComment - user needs webmaster role ")
2472- -- return false
2473- -- end
24742469
24752470 -- get antispam token from image details (unique for each image)
24762471 local rtnStatus = PiwigoAPI .checkPhoto (publishSettings , metaData .remoteId )
0 commit comments