ソースを参照

Cleanup wordpress since handling a little more.

Brit Butler 10 年 前
コミット
81fcf3a47a
共有1 個のファイルを変更した3 個の追加4 個の削除を含む
  1. 3 4
      plugins/import.lisp

+ 3 - 4
plugins/import.lisp

@@ -28,10 +28,10 @@
28 28
     (format nil "~a-~2,'0d-~2,'0d ~a" year (position month +short-month-names+
29 29
                                                      :test #'string=) date time)))
30 30
 
31
-(defun import-post (post output &optional (since nil since-supplied-p))
31
+(defun import-post (post output &optional since)
32 32
   (when (and (string= "publish" (node-val "wp:status" post)) ; is it public?
33 33
              (string= "post" (node-val "wp:post_type" post)) ; is it a post?
34
-             (or (not since-supplied-p) (string>= (get-timestamp post) since)))
34
+             (or (null since) (string>= (get-timestamp post) since)))
35 35
     (let ((slug (slugify (node-val "title" post))))
36 36
       (when (string= "" slug)
37 37
         (error "No valid slug-title for post ~a." (get-timestamp post)))
@@ -58,8 +58,7 @@
58 58
     (ensure-directories-exist (or output (repo *config*)))
59 59
     (let* ((xml (cxml:parse-file filepath (cxml-dom:make-dom-builder)))
60 60
            (posts (dom:get-elements-by-tag-name xml "item")))
61
-      (loop for post across posts do (if since (import-post post output since)
62
-                                         (import-post post output)))
61
+      (loop for post across posts do (import-post post output since))
63 62
       (delete-file filepath))))
64 63
 
65 64
 (defun enable (&key filepath output)