From 7ce686dbdf3abd943a44a5af9b462c64660a87d5 Mon Sep 17 00:00:00 2001 From: Mason Ballengee Date: Tue, 10 Oct 2023 09:14:13 -0400 Subject: [PATCH] Add auto-advance to media object manifests --- app/models/iiif_manifest_presenter.rb | 6 +++++- spec/models/iiif_manifest_presenter_spec.rb | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/models/iiif_manifest_presenter.rb b/app/models/iiif_manifest_presenter.rb index 85ed0fc47f..0504d6052a 100644 --- a/app/models/iiif_manifest_presenter.rb +++ b/app/models/iiif_manifest_presenter.rb @@ -77,6 +77,10 @@ def homepage ] end + def viewing_hint + ["auto-advance"] + end + def sequence_rendering supplemental_files_rendering(media_object) end @@ -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 diff --git a/spec/models/iiif_manifest_presenter_spec.rb b/spec/models/iiif_manifest_presenter_spec.rb index 08e641feb0..fbc1942d9a 100644 --- a/spec/models/iiif_manifest_presenter_spec.rb +++ b/spec/models/iiif_manifest_presenter_spec.rb @@ -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) }