From 40a882698055201c3dee08225c4700cf71a4d948 Mon Sep 17 00:00:00 2001 From: tomo Date: Sun, 20 Jan 2008 23:13:10 +0000 Subject: [PATCH] (iphoto-dir-to-album-dir): Don't make "Original/" subdirectory when an original file is a RAW file. --- iphoto-util.el | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) 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) -- 1.7.10.4