booh-classifier sort by exif date: fallback on filename content if exif date failed...
authorGuillaume Cottenceau <gcottenc@gmail.com>
Thu, 7 Nov 2013 21:54:03 +0000 (22:54 +0100)
committerGuillaume Cottenceau <gcottenc@gmail.com>
Thu, 7 Nov 2013 21:54:03 +0000 (22:54 +0100)
bin/booh-classifier

index c85ed74..f1f3adb 100644 (file)
@@ -1375,6 +1375,8 @@ def open_dir(*paths)
                 date_time = Exif.datetimeoriginal(file)
                 if ! date_time.nil?
                     dates[file] = date_time
+                elsif file =~ /(20\d{2}).?(\d{2}).?(\d{2}).(\d{2}).?(\d{2}).?(\d{2})/
+                    dates[file] = "#$1:#$2:#$3 #$4:#$5:#$6"
                 end
             }
             entries = smartsort(entries, dates)