My goal with using this module was to maintain the folders of photos via FTP (or Windows Explorer if I was remotely logged into the machine), and then run the Resync feature to resynchronize the DB to what is on the hard drive. Some of my challenges were:
- Memory leak when resyncing with the "resize images" checkbox unchecked.
- Deleting of an album from the file system, and then resyncing, did not delete the child albums from the DB.
- Repeated resyncing was causing subalbums to be readded to its parent album; hence, the album kept getting duplicated in the DB.
- When resyncing a huge album with many subalbums and photos, the postback to the server would timeout, causing the sync to stop without finishing.
I have made some modifications to the EditAlbum.ascx.vb file to overcome these challenges, and redeployed my DLL's. In the interest of community, I have attached my new version of EditAlbum.ascx.vb which inherits from version 2.3.18 (current version as of this writing). You will notice lines that have the following that help delineate where my modifications are located:
- Mjj.so -- start omission.
- Mjj.eo -- end ommssion
- Mjj.sn -- start new
- Mjj.en -- end new
Here's a summary of what I've modified:
- Bug fixes
- Disposal of System.Drawing.Image now performed when synchronizing album and "resize images" checkbox not checked. Was causing a memory leak before the fix.
- Deletion of an album will now successfully delete children subalbums from the DB.
- When synchronizing, subalbums now not getting added to the parent album more than once.
- When a folder (ie. album or subalbum) is deleted on the file system, and then a synchronization is run, the album/subalbum and child subalbums and photos will be removed from the DB.
- Enhancements
- Synchronization of album and subalbums now done in background process. When the "Synchronize Folder" link is clicked, a message is immediately displayed to the user as "Background synchronization process submitted." When the background synchronization is completed, an email is sent to the user that submitted the process, and an entry is logged into the DotNetNuke Admin Event Viewer. Submission of another synchronization process while another is still running will queue until prior ones are completed. While the process is running in the background, the user can still perform other functions on the site.
- Stil wanting to do:
- Enhance synchronization so that any photo and album descriptions are not lost. Maybe add a checkbox that will either do a full resync from scratch if checked (ie. all descriptions and other meta data lost), or an incremental/relative sync (where db record for album or photo is only recreated if necessary). This would be better for adding a subalbum via FTP and resyncing the full parent album.
Scott... feel free to include in future releases of SimpleGallery. :) |