[upload] add a new new trigger for the end of an upload process #164

Closed
opened 2026-10-04 23:45:31 +02:00 by adam · 5 comments
Owner

Reported by mistic100 on 21 Jun 2011 15:21

Version: 2.2.3

Some plugins may need to add actions after a group of pictures are uploaded.
'invalidate_user_cache' is not suitable because called after each picture.

Difficulty is specially with uploads through the API.

Piwigo Bugtracker #2357

**Reported by mistic100 on 21 Jun 2011 15:21** **Version:** 2.2.3 Some plugins may need to add actions after a group of pictures are uploaded. &#039;invalidate_user_cache&#039; is not suitable because called after each picture. Difficulty is specially with uploads through the API. [Piwigo Bugtracker #2357](http://piwigo.org/bugs/view.php?id=2357) <!-- github-sync-id:97226280 -->
adam closed this issue 2026-10-04 23:45:31 +02:00
Author
Owner

See #525

See #525 <!-- github-comment-id:771960965 -->
Author
Owner

If I remember correctly the initial need was to update SmartAlbums only once after uploading X files instead of after each file.

I don't think loc_end_add_uploaded_file solves this.

https://github.com/Piwigo/Piwigo-SmartAlbums/blob/master/main.inc.php#L68

If I remember correctly the initial need was to update SmartAlbums only once after uploading X files instead of after each file. I don't think `loc_end_add_uploaded_file` solves this. https://github.com/Piwigo/Piwigo-SmartAlbums/blob/master/main.inc.php#L68 <!-- github-comment-id:771975639 -->
Author
Owner

The upcoming "lounge" mecanism might be a solution.

The upcoming "lounge" mecanism might be a solution. <!-- github-comment-id:845732708 -->
Author
Owner

@mistic100 as described on https://piwigo.org/forum/viewtopic.php?pid=180845#p180845 I'm implementing a "lounge", which is a temporary place where photos wait before taking off :-)

For now, I plan to add a call to a new API method pwg.images.emptyLounge at the end of the web upload (using several pwg.images.upload calls). I can keep this emptyLounge method and also add a pwg.images.uploadCompleted (like we have a community.images.uploadCompleted). In this method I could add a trigger. What kind of data you would think useful for plugins like SmartAlbums? list of new image ids ? list of updated category ids ?

@mistic100 as described on https://piwigo.org/forum/viewtopic.php?pid=180845#p180845 I'm implementing a "lounge", which is a temporary place where photos wait before taking off :-) For now, I plan to add a call to a new API method `pwg.images.emptyLounge` at the end of the web upload (using several `pwg.images.upload` calls). I can keep this `emptyLounge` method and also add a `pwg.images.uploadCompleted` (like we have a `community.images.uploadCompleted`). In this method I could add a trigger. What kind of data you would think useful for plugins like SmartAlbums? list of new image ids ? list of updated category ids ? <!-- github-comment-id:847895322 -->
Author
Owner

I don't think we can make shortcuts in smart_make_all_associations there are too many possible rules, it cannot be optimized

I don't think we can make shortcuts in `smart_make_all_associations` there are too many possible rules, it cannot be optimized <!-- github-comment-id:847926875 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#164