Calendar Import module

spags

Joined: 2010-03-26
Posts: 120
Posted: Fri, 2013-11-29 23:45

The Calendar Import module (attached) is a bit of a hybrid concept of a few others modules (calendarview, dupcheck and folder sync). It essentially allows you to configure an import folder on your server that users can use as a "dumping ground" for their items. Calendar Import then automatically imports these items and sorts them into a calendar-like structure based on the EXIF data from the items. It can also detect duplicate files and take appropriate action on those import files. The module depends the EXIF module to function and it also aware of the keeporiginal module (for duplicate detection).

While the module works, it is poorly coded and is in no way optimised (it was intended for use as a small family photo gallery). In short, this code is not great but it could be useful to others. I would hope that someone more skillful could pick it up as a starting point for a more fully featured, better designed and more robust module.

Some code has been heavily based on other gallery modules and the included readme notes contains hints and useful info that is scattered across various posts in the Gallery3 forums.

Features

  • Option to import into either the root gallery album or one of the top-level albums (allowing specific permissions to be inherited)
  • Items unable to be sorted are imported into a specified top-level album
  • the import path ("dumping ground") could be accessed by something like a samba share, ftp, or some other third-party web uploader
  • users don't necessarily need to use or log into gallery
  • import folder can contain individual folders for users (and will be imported as "owned" by that user)
  • two styles of calendar structure/sorting supported (Year/Month and Decade/Year)
  • log of operations and pending imports allows you to see what it is doing
  • Skip or Delete duplicate items (based on both MD5 and SHA1 checksums)
  • Resource limiting (of sorts) by setting the maximum number of operations cron can perform in one call

I think the included readme file contains all the necessry info on how to get it up and running. I have performed my own testing, importing about 3000 photos totalling 1.3G in a day and it seems to work okay but no guarantees.

Good luck.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2013-12-07 18:26

Thanks for your contribution!
I have not had the opportunity to try it out as I have recently moved and renovations are taking my spare time.
I'm surprised you have not got any feedback.
Perhaps the tar.gz file is confusing users? I will attach a .zip that users should be more familiar with.

I will create a codex page as well.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2013-12-13 23:14
Quote:
I will create a codex page as well.

feel free to update:
http://codex.galleryproject.org/Gallery3:Modules:calendar_import

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
spags

Joined: 2010-03-26
Posts: 120
Posted: Sat, 2014-01-18 05:07

Fixed a problem where the module would fail to activate (it was writing to a log that didn't exist yet). Also the Settings now check to see if the cron job has been scheduled. If a job is found, the cron entry is listed, otherwise a message is displayed to remind the user to set it up.