Open EddyLB opened 7 years ago
I can add, for admins only:
community.images.pendingList
community.images.validate
community.images.reject
We already have pwg.images.delete
.
Would that be fine?
Mostly yes, but I also need to know whether a freshly uploaded image will have to be validated:
Today, the iOS app assumes that the freshly uploaded image is immediately available and it therefore refreshes the album content. How can the iOS app know that it won't be possible ?
So I suggest that you also add a community.images.submit
or community.images.upload
command returning that information and sending an email to the Admin (raised in #24)?
Yes, I clearly have this problem with the new HTML5 upload form in Community: on frontend side, after pwg.images.upload, I have no idea if the image is waiting for moderation. What I'm implementing is a new method community.images.uploadCompleted
: you give the list of image_ids and Community does 2 things:
If I understand well, when a non-admin user uploads images, the iOS app will have to do the following to determine if it should refresh the content of the alum:
pwg.categories.getImages
to identify those already on the server,pwg.images.upload
,pwg.categories.getImages
and build the list of freshly uploaded image_ids by comparing the two lists,community.images.uploadCompleted
to determine if the freshly updated images are waiting for moderation,A bit heavy, no ? Unless I misunderstood…
- get the list of image_ids with pwg.categories.getImages to identify those already on the server,
You should already have done it earlier, no? Or you could have a local list of photos already uploaded to this Piwigo.
2 + 3 + 4
no, this is how Community web form does the job:
a. perform the pwg.images.upload
and save the returned image_id
b. once all files are uploaded, perform the community.images.uploadCompleted
Here is the javascript version (simplified):
jQuery("#uploader").pluploadQueue({
url : 'ws.php?method=pwg.images.upload&format=json',
...
FileUploaded: function(up, file, info) {
var data = jQuery.parseJSON(info.response);
uploadedPhotos.push(parseInt(data.result.image_id));
},
UploadComplete: function(up, files) {
jQuery.ajax({
url: "ws.php?format=json&method=community.images.uploadCompleted",
data: {
pwg_token: pwg_token,
image_id: uploadedPhotos.join(","),
category_id: uploadCategory.id
},
...
});
}
}
- and finally refresh the content of the album if needed.
Yes, unless community.images.uploadCompleted
tells you all photos are moderation_pending
Thank for the detailed answer. As I did not work much on that part of the code, I did not know that pwg.images.upload
did return image_ids. That looks fine.
@plegall, I now have a beta version 2.1 of Piwigo for iOS compatible with the Community extension. Do you have an idea when you will be able to provide the admin methods ?
ommunity.images.pendingList
community.images.validate
community.images.reject
I ask the question to determine whether I should wait for releasing version 2.1.
Would it be possible to provide methods for submitting, rejecting, removing and validating images uploaded by Community users as for Piwigo demo?