seems to be bug in ruby dir function
This commit is contained in:
parent
fa8d6f8bae
commit
0afb53fd20
|
@ -18,14 +18,12 @@ module ScanFiles
|
|||
end
|
||||
if album.nil?
|
||||
puts "New album : " + File.basename( relpath )
|
||||
album = Album.new( :path => relpath )
|
||||
album.save
|
||||
album = Album.create( :path => relpath )
|
||||
end
|
||||
photo = Photo.find_by_path( relfile )
|
||||
if photo.nil?
|
||||
puts " New photo added " + relfile
|
||||
photo = Photo.new( :album => album, :path => relfile )
|
||||
photo.save
|
||||
photo = Photo.create( :album => album, :path => relfile )
|
||||
else
|
||||
puts " Found photo " + relfile
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue