From: tomo Date: Sun, 20 Jan 2008 23:13:10 +0000 (+0000) Subject: (iphoto-dir-to-album-dir): Don't make "Original/" subdirectory when an X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=40a882698055201c3dee08225c4700cf71a4d948;p=elisp%2Falbum.git (iphoto-dir-to-album-dir): Don't make "Original/" subdirectory when an original file is a RAW file. --- diff --git a/iphoto-util.el b/iphoto-util.el index 11e84bc..74027f3 100644 --- a/iphoto-util.el +++ b/iphoto-util.el @@ -149,18 +149,28 @@ (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)