diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 4f32199..1694393 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -38,7 +38,6 @@ class PhotosController < ApplicationController previous_rs = Photo.previous( @photo.id, @photo.album ) @previous = previous_rs.first if !previous_rs.empty? next_rs = Photo.next( @photo.id, @photo.album ) - puts next_rs.inspect @next = next_rs.first if !next_rs.empty? respond_to do |format| format.html diff --git a/app/models/album.rb b/app/models/album.rb index 5bc5fd7..62fd583 100644 --- a/app/models/album.rb +++ b/app/models/album.rb @@ -77,13 +77,13 @@ class Album < ActiveRecord::Base private def create_folders - Dir.mkdir( APP_CONFIG[:photos_path] + self.path ) if !Dir.exists?( APP_CONFIG[:photos_path] + self.path ) - Dir.mkdir( APP_CONFIG[:thumbs_path] + self.path ) if !Dir.exists?( APP_CONFIG[:photos_path] + self.path ) + Dir.mkdir( APP_CONFIG[:photos_path] + self.path ) if !File.exists?( APP_CONFIG[:photos_path] + self.path ) + Dir.mkdir( APP_CONFIG[:thumbs_path] + self.path ) if !File.exists?( APP_CONFIG[:photos_path] + self.path ) end def destroy_folders #puts "DELETE DIRECTORY " + APP_CONFIG[:photos_path] + self.path - Dir.delete( APP_CONFIG[:thumbs_path] + self.path ) if Dir.exists?( APP_CONFIG[:thumbs_path] + self.path ) - Dir.delete( APP_CONFIG[:photos_path] + self.path ) if Dir.exists?( APP_CONFIG[:photos_path] + self.path ) + Dir.delete( APP_CONFIG[:thumbs_path] + self.path ) if File.exists?( APP_CONFIG[:thumbs_path] + self.path ) + Dir.delete( APP_CONFIG[:photos_path] + self.path ) if File.exists?( APP_CONFIG[:photos_path] + self.path ) end end diff --git a/app/models/photo.rb b/app/models/photo.rb index cad7d3b..a439e0a 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -115,9 +115,6 @@ class Photo < ActiveRecord::Base end def exif_read - puts "exif read" - puts self.path - puts self.path_original photo = MiniExiftool.new(self.path_original) self.longitude = photo.GPSLongitude if self.longitude.nil? self.latitude = photo.GPSLatitude if self.latitude.nil? diff --git a/app/views/albums/_album.html.erb b/app/views/albums/_album.html.erb index 4e1e5ad..f12a684 100644 --- a/app/views/albums/_album.html.erb +++ b/app/views/albums/_album.html.erb @@ -1 +1 @@ -

<%= render :partial => "photos/thumb", :locals => {:photo => album.photos.find(:first) } %>

\ No newline at end of file +

<%= render :partial => "photos/thumb", :locals => { :photo => album.photos.find(:first) } unless album.photos.empty? %>

\ No newline at end of file