Skip to content

Commit

Permalink
Merge pull request #5317 from avalonmediasystem/bump_iiif
Browse files Browse the repository at this point in the history
Bump iiif_manifest
  • Loading branch information
masaball authored Aug 18, 2023
2 parents e587669 + b1d0ab3 commit 0fc4c7e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ GIT

GIT
remote: https://github.com/samvera-labs/iiif_manifest.git
revision: b4b0eb4c003e84bbad92510a3391bb5dba357e42
revision: c8ca0c6e54517446419c20221260eaf3dcf46d4e
branch: main
specs:
iiif_manifest (1.3.1)
Expand Down
2 changes: 1 addition & 1 deletion app/models/iiif_canvas_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def supplementing_content_data(file)
else
Rails.application.routes.url_helpers.master_file_supplemental_file_url(master_file.id, file.id)
end
IIIFManifest::V3::AnnotationContent.new(url, **supplemental_attributes(file))
IIIFManifest::V3::AnnotationContent.new(body_id: url, **supplemental_attributes(file))
end

def stream_urls
Expand Down
2 changes: 1 addition & 1 deletion app/models/iiif_playlist_canvas_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def audio_display_content(quality)
def marker_content(marker)
url = Rails.application.routes.url_helpers.avalon_marker_url(marker.id)

IIIFManifest::V3::AnnotationContent.new(url, **marker_attributes(marker))
IIIFManifest::V3::AnnotationContent.new(annotation_id: url, **marker_attributes(marker))
end

def stream_urls
Expand Down
14 changes: 7 additions & 7 deletions spec/models/iiif_canvas_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@
end

it 'includes transcript and caption files' do
expect(subject.any? { |content| content.url =~ /supplemental_files\/#{transcript_file.id}/ }).to eq true
expect(subject.any? { |content| content.url =~ /supplemental_files\/#{caption_file.id}/ }).to eq true
expect(subject.any? { |content| content.body_id =~ /supplemental_files\/#{transcript_file.id}/ }).to eq true
expect(subject.any? { |content| content.body_id =~ /supplemental_files\/#{caption_file.id}/ }).to eq true
end

it 'differentiates between transcript and caption files' do
expect(subject.any? { |content| content.url =~ /supplemental_files\/#{transcript_file.id}\/transcripts/ }).to eq true
expect(subject.any? { |content| content.url =~ /supplemental_files\/#{caption_file.id}\/captions/ }).to eq true
expect(subject.any? { |content| content.body_id =~ /supplemental_files\/#{transcript_file.id}\/transcripts/ }).to eq true
expect(subject.any? { |content| content.body_id =~ /supplemental_files\/#{caption_file.id}\/captions/ }).to eq true
end

it 'does not add " (machine generated)" to label of non-generated files' do
Expand All @@ -163,19 +163,19 @@
end

it 'does not include generic supplemental files or waveform' do
expect(subject.any? { |content| content.url =~ /supplemental_files\/#{supplemental_file.id}/ }).to eq false
expect(subject.any? { |content| content.body_id =~ /supplemental_files\/#{supplemental_file.id}/ }).to eq false
expect(subject.any? { |content| content.label == { "en" => ["waveform.json"] } }).to eq false
end

it 'does not include master file captions url when legacy captions are not present' do
expect(subject.any? { |content| content.url =~ /master_files\/#{master_file.id}\/captions/ }).to eq false
expect(subject.any? { |content| content.body_id =~ /master_files\/#{master_file.id}\/captions/ }).to eq false
end

context 'legacy master file captions' do
let(:master_file) { FactoryBot.create(:master_file, :with_waveform, :with_captions, supplemental_files_json: supplemental_files_json, media_object: media_object, derivatives: [derivative]) }

it 'includes the master file captions' do
expect(subject.any? { |content| content.url =~ /master_files\/#{master_file.id}\/captions/ }).to eq true
expect(subject.any? { |content| content.body_id =~ /master_files\/#{master_file.id}\/captions/ }).to eq true
end
end

Expand Down

0 comments on commit 0fc4c7e

Please sign in to comment.