(iphoto-dir-to-album-dir): Don't make "Original/" subdirectory when an
authortomo <tomo>
Sun, 20 Jan 2008 23:13:10 +0000 (23:13 +0000)
committertomo <tomo>
Sun, 20 Jan 2008 23:13:10 +0000 (23:13 +0000)
original file is a RAW file.

iphoto-util.el

index 11e84bc..74027f3 100644 (file)
                     (cons 'exit (concat album-url-prefix album-name)))))
        (write-region (point-min)(point-max)
                      (expand-file-name "dir.desc" album-dir)))
-      (unless (file-exists-p album-dir-original)
-       (make-directory album-dir-original 'parents))
       (dolist (file (directory-files
                     (expand-file-name
                      (file-name-nondirectory dir)
                      (format "~/Pictures/iPhoto Library/Originals/%d/"
                              year))
                     'full nil 'no-sort t))
-       (call-process "cp" nil nil nil
-                     "-al" 
-                     file
-                     album-dir-original))
+       (cond
+        ((string= (downcase (file-name-extension file)) "jpg")
+         (unless (file-exists-p album-dir-original)
+           (make-directory album-dir-original 'parents))
+         (call-process "cp" nil nil nil
+                       "-al" 
+                       file
+                       album-dir-original)
+         )
+        (t
+         (call-process "cp" nil nil nil
+                       "-al" 
+                       file
+                       album-dir)
+         ))
+       )
       (call-process "chgrp" nil nil nil
                    "-R" "www-data"
                    album-dir)