Let say there are 700 or so photos in a gallery 2.3 folder. I have a list of about 100 files that I would like to keep and remove the rest. I would like to keep the view count on the 100 or so photos that I would like to keep.
Is there a batch routine of some sort that would process the unwanted photos, removing them from the gallery completely, just leaving the 100 or so desired photos untouched?
I know I haven't posted all the gallery specifics, but if someone could say if it is even possible that would be a start.
Thanks
Wes
Posts: 4342
Well, anything's possible, depending on your level of technical expertise.
Somebody posted a script that adds images from a drop-folder, I imagine you could write one that scanned your list of photos to delete, or not delete as appropriate. But that script doesn't exist at present.
Posts: 16504
In the time it would take to come up with something you could have already used the tools inside Gallery to do this.
If you go to delete an item 30 per page show up, that's only 24 pages to go through
To make the job quicker and make Gallery work a bit harder, you could make more than 30 items per page show up.
NOT TESTED:
Edit /modules/core/ItemDelete.inc and find $form['numPerPage'] = 30; Change that number.
Other than that I haven't seen anything that I can recall to batch delete stuff from Gallery.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 8
Thanks, I am not well versed in perl so I guess I will delete tehm manually.
700 photos were in one gallery, there are about 60 or so similar gallery folders to go through.....
Posts: 4342
It would be php you would need to know, not perl!
Given the number of galleries and images I have to say I'd disagree with Nivekiam (just this once) about whether it's worth writing a script or not...
Posts: 16504
You can disagree all you want I was basing that on thinking all the photos were in one album and not knowing of an existing script to easily modify for this. If they are spread across several (or a bunch) of albums, deleting them manually will be a total PITA
Probably well worth it to come up with a script for it then. I personally wouldn't know where to start except maybe looking a few I've seen to add items and working from there.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 4342
I would start with this:
http://codex.gallery2.org/Gallery2:How_To_Write_Scripts
Add in the logic to load the list of files then loop through searching for each one with a sensible db search with this:
http://gallery.menalto.com/apidoc/GalleryCore/Classes/Gallery.html#methodsearch
obviously parameters depend on whether your list contains the filename, image title, etc
then when you found the itemId for the image, call this:
http://gallery.menalto.com/apidoc/GalleryCore/Classes/GalleryCoreApi.html#methoddeleteEntityById
Rinse and repeat.
I think it would be much easier to script to delete items than to add them.
Posts: 8
Great, thanks. Still a little over my head but I will give it a try over the next bit.
If anybody wanted to take on a project to do this, I would have no problem with that.....
Wes