Feature proposal #6993
closed
Review improving gallery action to auto-batch uploads
Added by krileon almost 7 years ago.
Updated almost 7 years ago.
Start date:
19 January 2018
Description
If you upload 100 photos it generates 100 activity entries that it needs to try and merge together on display. It'd be a lot faster if the duplicates could be deleted and merged in at time of creation to avoid this. Maybe need improvements to CB Gallery to include this information somehow so we don't need to generate so many entries on upload. Removing entries from the stream shouldn't be the normal behavior as it hurts performance.
This could just be a feature that's a part of the CB Activity action it self. Maybe a "Group Similar" where you can specify a strtotime offset for date range and an asset. The grouping behavior would need to be normalized in this case though since CB Gallery uses its own parameter for this at this time. Note sure this would work since some grouping would have to have different, custom even, behavior; e.g. CB Gallery groups by owner, asset, and folder.
Alternative is maybe a trigger added to CB Gallery that's executed when the done button is clicked (via ajax) to trigger signal multiple media files have been uploaded. Doing this could be unreliable. If a user uploads then leaves instead of clicking done this would never trigger.
A query action acting on the same trigger can be used to accomplish this. Also change the trigger usage to use the gallery object included trigger instead of the direct database ones to prevent backend saves triggering activity.
The query action would be responsible for checking for activity entries within 15 minutes of the one being saved and unpublishing them. It then needs to store the grouped ids within its activity entry somehow (this could be a problem).
- % Done changed from 0 to 90
Implementing of grouping functionality for the activity action was the best approach. Basically you specify an asset to group by (e.g. gallery.%). You then specify the group range (e.g. 15 MINUTES). Next you specify what to group by (e.g. Group and Owner). This translates to something like the below.
Find the newest entry that matches Group from Owner that has a date less than or greater than 15 minutes of this new entry.
If it does find an entry then it will attempt to add the asset of the new entry to the existing entry "assets" param thereby grouping the two together. It then skips trying to generate another entry. This helps prevent bloating of the activity table when multi-uploads are done. A scenario where this helps on an extremely level is uploading 100 photos currently means 100 activity entries. With this usage it means 1 activity entry.
Also worth noting this is backwards compatible. If a entry already exists matching the Load By criteria then grouping is skipped and will group dynamically on display of possible as usual.
Still need to update the gallery system action to utilize this.
- Status changed from Assigned to Resolved
- % Done changed from 90 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF