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
at = attachments.where("name LIKE '%.mp4'").first
return at unless at.nil?
end
at = attachments.find_by(bundle_name: 'ORIGINAL')
at = attachments.first if at.nil?
update(attachment: at)
return attachment
at = attachments.where("name NOT LIKE '%.torrent' AND bundle_name = 'ORIGINAL'")
# at = attachments.first if at.nil?
unless at.blank?
update(attachment: at.first)
return attachment
end
end
nil
end
......
......@@ -70,6 +70,7 @@ class PackageWorker
Zip::File.open(PackageService.file_root(filename), Zip::File::CREATE) do |zipfile|
files.each { |file| zipfile.add(File.basename(file.path), file.path) }
end
FileUtils.chown_R 'portalmec', 'portalmec', PackageService.file_root.to_s, verbose: true
rescue => e
file = PackageService.file_root(filename)
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