fix error

This commit is contained in:
chiu 2019-11-05 21:21:00 +08:00
parent 8577c7e8ad
commit bf0f561c2e
1 changed files with 9 additions and 0 deletions

View File

@ -41,6 +41,9 @@ class Admin::GalleriesController < OrbitAdminController
end
end
variable = AlbumVariable.first
if variable.nil?
variable = AlbumVariable.new
end
variable.finish = false
variable.save!
Thread.new do
@ -84,6 +87,9 @@ class Admin::GalleriesController < OrbitAdminController
if notalive
if !params['album_id'].to_s.empty?
variable = AlbumVariable.first
if variable.nil?
variable = AlbumVariable.new
end
variable.finish = false
variable.save!
choice_ids = params['album_id'].split(',')
@ -392,6 +398,9 @@ class Admin::GalleriesController < OrbitAdminController
end
def init_upload
variable = AlbumVariable.first
if variable.nil?
variable = AlbumVariable.new
end
variable.count = params['all_length'].to_i
variable.finish = false
variable.progress_percent = '0%'