I'm looking for a way to tweak existing code in the Add Items from Local Server so that the checkbox that is created on the result page from clicking the Find Files button is "smart". By smart I mean that the checkbox would be checked UNLESS the filename already existed in the database, or the type of file was not a recognized type...
This would allow me and my users to continually update an ftp location and relatively painlessly add anything that was new because when I clicked on Find Files it would not check the files that are in the ftp location that are already being displayed on the server.
How difficult of a task is this? Has anyone already made this enhancement?
Posts: 32509
see 1241344 [G2] Albums auto indexing feature
on http://gallery.menalto.com/sfvote/all
i guess you're on the right track. i think it should do even more:
1. select all selects only new folders / files. an additional select really all button would select also those files / dirs that are already part of the current album
2. for folders it recurses into subdirs and adds subitems. as is. but by default, it should only add new images / subfolders in the folder.
3. an additional checkbox for folders which defaults to false could overrule the default and add everything else too (since some users may always use the same filenames for new pics and g2 just adds them with another name (as is)).
you'd have to extend the functionality of modules/core/ItemAddFromServer.inc and modules/core/templates/ItemAddFromServer.tpl
in .inc, the most important part is loading the child items of the current album and fetchpath, else you can't compare the existing list of files/dirs with the add item candidates.
when adding (in handleRequest), you'll have to check before addAlbum and additem if the item / album already exists.