Skip to content

Commit

Permalink
Remediate duplicate pages in universal viewer (#827)
Browse files Browse the repository at this point in the history
# Story

Refs
- #817

# Expected Behavior Before Changes

Universal viewer on parent work showed each page twice.

# Expected Behavior After Changes

Pages are no longer duplicated.

# Screenshots / Video

<details>
<summary></summary>

![Screenshot 2024-09-26 at 11 59
51 AM](https://github.com/user-attachments/assets/8aae255b-e308-45fb-b59b-72baa40ec62e)

</details>

# Notes
  • Loading branch information
laritakr authored Sep 26, 2024
2 parents 4f99397 + 1c8a802 commit 6cb2a26
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 49 deletions.
31 changes: 0 additions & 31 deletions app/presenters/adl/iiif_manifest_presenter_factory_decorator.rb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# frozen_string_literal: true

# Override IiifPrint 3.0 to:
# - add rendering section to allow download of multiple files
# - sanitize labels
# NOTE: remove of TN suffix files is done in a different module.
module HykuKnapsack
module ManifestBuilderServiceDecorator
def build_manifest(presenter:)
Expand All @@ -8,23 +12,6 @@ def build_manifest(presenter:)
returning_hash
end

def sanitize_v2(hash:, presenter:, solr_doc_hits:)
hash['label'] = sanitize_label(hash['label']) if hash.key?('label')
hash.delete('description') # removes default description since it's in the metadata fields
hash['sequences']&.each do |sequence|
# removes canvases if there are thumbnail files
sequence['canvases'].reject! do |canvas|
sanitize_label(canvas['label']).end_with?('.TN.jpg')
end

sequence['canvases']&.each do |canvas|
canvas['label'] = sanitize_label(canvas['label'])
apply_metadata_to_canvas(canvas:, presenter:, solr_doc_hits:)
end
end
hash
end

private

def rendering(presenter:)
Expand Down

0 comments on commit 6cb2a26

Please sign in to comment.