Skip to content
Snippets Groups Projects
Commit c3478d47 authored by Israel Barreto Sant'Anna's avatar Israel Barreto Sant'Anna
Browse files

Merge branch 'master' into dspace-sync

parents 6e325430 ab1b7adc
No related branches found
No related tags found
No related merge requests found
...@@ -124,10 +124,12 @@ class LearningObject < ApplicationRecord ...@@ -124,10 +124,12 @@ class LearningObject < ApplicationRecord
at = attachments.where("name LIKE '%.mp4'").first at = attachments.where("name LIKE '%.mp4'").first
return at unless at.nil? return at unless at.nil?
end end
at = attachments.find_by(bundle_name: 'ORIGINAL') at = attachments.where("name NOT LIKE '%.torrent' AND bundle_name = 'ORIGINAL'")
at = attachments.first if at.nil? # at = attachments.first if at.nil?
update(attachment: at) unless at.blank?
return attachment update(attachment: at.first)
return attachment
end
end end
nil nil
end end
......
...@@ -70,6 +70,7 @@ class PackageWorker ...@@ -70,6 +70,7 @@ class PackageWorker
Zip::File.open(PackageService.file_root(filename), Zip::File::CREATE) do |zipfile| Zip::File.open(PackageService.file_root(filename), Zip::File::CREATE) do |zipfile|
files.each { |file| zipfile.add(File.basename(file.path), file.path) } files.each { |file| zipfile.add(File.basename(file.path), file.path) }
end end
FileUtils.chown_R 'portalmec', 'portalmec', PackageService.file_root.to_s, verbose: true
rescue => e rescue => e
file = PackageService.file_root(filename) file = PackageService.file_root(filename)
FileUtils.rm(file) if File.exist?(file) FileUtils.rm(file) if File.exist?(file)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment