mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
only take screenshot for index change
This commit is contained in:
parent
87c733c932
commit
f54332e5f4
1 changed files with 7 additions and 7 deletions
4
app.rb
4
app.rb
|
@ -143,7 +143,7 @@ post '/site_files/upload' do
|
||||||
FileUtils.mv params[:newfile][:tempfile].path, dest_path
|
FileUtils.mv params[:newfile][:tempfile].path, dest_path
|
||||||
File.chmod(0640, dest_path) if self.class.production?
|
File.chmod(0640, dest_path) if self.class.production?
|
||||||
|
|
||||||
Backburner.enqueue ScreenshotJob, current_site.username
|
Backburner.enqueue(ScreenshotJob, current_site.username) if sanitized_filename =~ /index\.html/
|
||||||
|
|
||||||
flash[:success] = "Successfully uploaded file #{sanitized_filename}."
|
flash[:success] = "Successfully uploaded file #{sanitized_filename}."
|
||||||
redirect '/dashboard'
|
redirect '/dashboard'
|
||||||
|
@ -203,7 +203,7 @@ post '/site_files/save/:filename' do |filename|
|
||||||
FileUtils.mv tmpfile.path, dest_path
|
FileUtils.mv tmpfile.path, dest_path
|
||||||
File.chmod(0640, dest_path) if self.class.production?
|
File.chmod(0640, dest_path) if self.class.production?
|
||||||
|
|
||||||
Backburner.enqueue ScreenshotJob, current_site.username
|
Backburner.enqueue(ScreenshotJob, current_site.username) if sanitized_filename =~ /index\.html/
|
||||||
|
|
||||||
'ok'
|
'ok'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue