Skip to content

Commit

Permalink
Add auto-advance to media object manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
masaball committed Oct 10, 2023
1 parent 3cf72b5 commit 7ce686d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/iiif_manifest_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ def homepage
]
end

def viewing_hint
["auto-advance"]
end

def sequence_rendering
supplemental_files_rendering(media_object)
end
Expand Down Expand Up @@ -162,7 +166,7 @@ def display_summary(media_object)
def series_url(series)
Rails.application.routes.url_helpers.blacklight_url({ "f[collection_ssim][]" => media_object.collection.name, "f[series_ssim][]" => series })
end

def display_lending_period(media_object)
return nil unless lending_enabled
ActiveSupport::Duration.build(media_object.lending_period).to_day_hour_s
Expand Down
8 changes: 8 additions & 0 deletions spec/models/iiif_manifest_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@
end
end

context 'viewing_hint' do
subject { presenter.viewing_hint }

it 'includes auto-advance' do
expect(subject).to include 'auto-advance'
end
end

describe '#sequence_rendering' do
let(:media_object) { FactoryBot.build(:fully_searchable_media_object, supplemental_files_json: supplemental_files_json) }
let(:supplemental_file) { FactoryBot.create(:supplemental_file) }
Expand Down

0 comments on commit 7ce686d

Please sign in to comment.