Skip to content

Commit

Permalink
Merge pull request #1038 from sul-dlss/remove-objectId
Browse files Browse the repository at this point in the history
  • Loading branch information
mjgiarlo authored Nov 10, 2023
2 parents 079c10b + 21b472b commit 2d43489
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/purl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def files_from_xml(druid)

doc.xpath('//contentMetadata/resource').each do |resource|
resource.xpath('file|externalFile').each do |attr|
file = StacksFile.new(id: attr['objectId'] || druid, file_name: attr['fileId'] || attr['id'])
file = StacksFile.new(id: druid, file_name: attr['id'])
yield file
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/models/purl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</resource>
<resource id="kn112rm5773_2" sequence="2" type="image">
<label>Virtual image</label>
<file objectId="def" fileId="123.jp2" mimetype="image/jp2" size="3832255">
<file id="123.jp2" mimetype="image/jp2" size="3832255">
<imageData width="4850" height="4180"/>
</file>
</resource>
Expand All @@ -46,7 +46,7 @@

actual = described_class.files('abc').map { |file| "#{file.id}/#{file.file_name}" }

expect(actual).to match_array ['abc/26855.jp2', 'def/123.jp2']
expect(actual).to match_array ['abc/26855.jp2', 'abc/123.jp2']
end
end

Expand Down

0 comments on commit 2d43489

Please sign in to comment.