diff --git a/app/models/purl.rb b/app/models/purl.rb index 88c6cd62..f3caa802 100644 --- a/app/models/purl.rb +++ b/app/models/purl.rb @@ -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 diff --git a/spec/models/purl_spec.rb b/spec/models/purl_spec.rb index 991445a9..46ee19c2 100644 --- a/spec/models/purl_spec.rb +++ b/spec/models/purl_spec.rb @@ -34,7 +34,7 @@ - + @@ -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