 
 (defn stable?
   "Returns true if the file has has content and has not been modified
-  for at least thirty seconds."
+  for a reasonable duration."
   [file]
-  (and (pos? (.length file))
+  (and (.isFile file)
+       (pos? (.length file))
        (< (.lastModified file) (- (System/currentTimeMillis) stable-time))))
 
 (defn add-subtitles
   "Performs the initial scan for subtitles."
   [folder video]
   (doseq [file (.listFiles (:file folder) (subtitle-filter (:title video)))]
-    (log/info "adding subtitles" (str file))
+    (log/info "adding subtitle" (str file))
     (add-subtitle folder file video)))
 
 (defn add-images

      (add-images folder video))))

(defn add-file
  "Adds a newly discovered file to the library."
  [folder file]
  (log/info "adding file" (str file))
  (when-let [video (video-for-file folder file)]

  (cond
    (video? file) (add-video folder file)
    (subtitle? file) (add-subtitle folder file)
    (image? file) (add-image folder file))
  (process-file folder file))

(defn check-pending-files
  "Checks the pending files and adds the stable ones to the library."
