sort
This commit is contained in:
parent
98f65e3469
commit
947cb93ff8
|
@ -1,14 +1,15 @@
|
||||||
module ScanFiles
|
module ScanFiles
|
||||||
# protected
|
|
||||||
require "find"
|
require "find"
|
||||||
#require 'RMagick'
|
|
||||||
|
|
||||||
supported_files = ["jpeg", "jpg", "gif", "png"]
|
supported_files = ["jpeg", "jpg", "gif", "png"]
|
||||||
|
|
||||||
def self.FullScan
|
def self.FullScan
|
||||||
prevalbum = ""
|
prevalbum = ""
|
||||||
dirs = Find.find( APP_CONFIG[:photos_path] ).collect
|
dirs = Array.new
|
||||||
dirs.sort.each { |path|
|
Find.find( APP_CONFIG[:photos_path] ) { |path|
|
||||||
|
dirs.push( path )
|
||||||
|
}
|
||||||
|
dirs.sort.each{|path|
|
||||||
if File.file?(path) && [".jpeg", ".jpg", ".gif", ".png"].include?( File.extname(path) )
|
if File.file?(path) && [".jpeg", ".jpg", ".gif", ".png"].include?( File.extname(path) )
|
||||||
relpath = File.dirname( path ).sub(APP_CONFIG[:photos_path], '')
|
relpath = File.dirname( path ).sub(APP_CONFIG[:photos_path], '')
|
||||||
relfile = path.sub(APP_CONFIG[:photos_path], '')
|
relfile = path.sub(APP_CONFIG[:photos_path], '')
|
||||||
|
|
Loading…
Reference in a new issue