Improve metadata extraction from epubs, and clean up the display of popups in the...
[quanlib.git] / walkdir.rb
index b54d0a2b4134b970e7999752e33df546e9a4da5a..035752f05d48785d10db87d3b6e6bf91abe855a2 100644 (file)
@@ -18,7 +18,7 @@
 # and Mrs. Pollifax volume 6, On the China Station, is
 # .../DorothyGilman/P06_On_the_China_Station.epub.
 
-require './book.rb'
+require 'book'
 
 class WalkDir
   def initialize(root)
@@ -28,7 +28,7 @@ class WalkDir
 
   def books
     result = []
-    for file in @files
+    for file in @files.sort
       if Book.canHandle?(file)
         book = Book.new(file)
         result.push(book)
@@ -42,7 +42,7 @@ class WalkDir
     children = Dir.entries(path)
     for child in children
       fullName = (path.chomp("/")) + "/" + child
-      if (File.directory?(fullName)) and (child != ".") and (child != "..")
+      if (File.directory?(fullName)) and (child != ".") and (child != "..") and (!File.symlink?(fullName))
         sub = walk(fullName)
         if (sub != nil) and (sub.length > 0)
           result.concat(sub)