bulkrax 3.3.1 → 3.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2525e4aed8b31a897668d556c311b29189ec1b7a951b4303604acd3ccb11fcc8
4
- data.tar.gz: d642de2af38c8c82108b113641ab1e191ae05b96b2ce3528dde7d7c908639291
3
+ metadata.gz: b136a8742a7f9b953b4c3ef86d700540b931b6fbf22798d719e9aa693ea61fa9
4
+ data.tar.gz: e1cc32eda55a606285cf6e080340db608a8867f0bd4de8ab1361ca4a3d21adf9
5
5
  SHA512:
6
- metadata.gz: 6547c0283f75626cda95a8cc09cceff84ac576b7ca4034b72d729ab16d50c71657dac0e78739b5ef6f2d83aa85e1ddc8c45646f6c44408a0a989b4b33b93c487
7
- data.tar.gz: 9ae11d35d0b3caf9d45237590e42541c0004268e6c86e8d44e6754900b253894813c7e817b471ed9379b7eefad1ec3a27d2cfebbe94865727ecb69b6b8652480
6
+ metadata.gz: 87e35f340faa583a9ae6ac156f95fa4958fcaf9d3ed09a9963a8dda39649a66307a8c494375a989e2103c2d1edef62343f5b69878eae2249d63cc4b8f65240a8
7
+ data.tar.gz: 21ddafc671eda822144b6b73abfb89892ffac954f0692952985299f40f7d0e1aba472077aac72a1f681da315ba35de795f43d95df323c2178576716d02eafc75
@@ -12,6 +12,8 @@ module Bulkrax
12
12
  import(importer, only_updates_since_last_import)
13
13
  update_current_run_counters(importer)
14
14
  schedule(importer) if importer.schedulable?
15
+ rescue CSV::MalformedCSVError => e
16
+ importer.status_info(e)
15
17
  end
16
18
 
17
19
  def import(importer, only_updates_since_last_import)
@@ -114,9 +114,10 @@ module Bulkrax
114
114
  def build_files_metadata
115
115
  file_mapping = key_for_export('file')
116
116
  file_sets = hyrax_record.file_set? ? Array.wrap(hyrax_record) : hyrax_record.file_sets
117
- filenames = file_sets.map { |fs| filename(fs).to_s if filename(fs).present? }.compact
117
+ filenames = map_file_sets(file_sets)
118
118
 
119
119
  handle_join_on_export(file_mapping, filenames, mapping['file']&.[]('join')&.present?)
120
+ build_thumbnail_files if hyrax_record.work?
120
121
  end
121
122
 
122
123
  def build_relationship_metadata
@@ -219,15 +220,6 @@ module Bulkrax
219
220
  end
220
221
  end
221
222
 
222
- def build_files
223
- file_mapping = mapping['file']&.[]('from')&.first || 'file'
224
- file_sets = hyrax_record.file_set? ? Array.wrap(hyrax_record) : hyrax_record.file_sets
225
-
226
- filenames = map_file_sets(file_sets)
227
- handle_join_on_export(file_mapping, filenames, mapping['file']&.[]('join')&.present?)
228
- build_thumbnail_files if hyrax_record.work?
229
- end
230
-
231
223
  def build_thumbnail_files
232
224
  return unless importerexporter.include_thumbnails
233
225
 
@@ -96,16 +96,19 @@ module Bulkrax
96
96
  end
97
97
 
98
98
  def current_run
99
- @current_run ||= if file? && zip?
100
- self.importer_runs.create!
101
- else
102
- entry_counts = {
103
- total_work_entries: self.limit || parser.works_total,
104
- total_collection_entries: parser.collections_total,
105
- total_file_set_entries: parser.file_sets_total
106
- }
107
- self.importer_runs.create!(entry_counts)
108
- end
99
+ return @current_run if @current_run.present?
100
+
101
+ @current_run = self.importer_runs.create!
102
+ return @current_run if file? && zip?
103
+
104
+ entry_counts = {
105
+ total_work_entries: self.limit || parser.works_total,
106
+ total_collection_entries: parser.collections_total,
107
+ total_file_set_entries: parser.file_sets_total
108
+ }
109
+ @current_run.update!(entry_counts)
110
+
111
+ @current_run
109
112
  end
110
113
 
111
114
  def last_run
@@ -18,7 +18,7 @@ module Bulkrax
18
18
  end
19
19
 
20
20
  def failed?
21
- current_status&.status_message&.match(/fail/i)
21
+ current_status&.status_message&.eql?('Failed')
22
22
  end
23
23
 
24
24
  def succeeded?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bulkrax
4
- VERSION = '3.3.1'
4
+ VERSION = '3.3.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bulkrax
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Kaufman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-09 00:00:00.000000000 Z
11
+ date: 2022-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails