This repository has been archived by the owner on Oct 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎁 Filter certain file sets from manifests
This commit will remove thumbnail file sets and non-image file sets at a much higher level than before. Previously, we were filtering out the thumbnails at the manifest builder level which is right before the manifest gets generated. This caused issues with serverless IIIF resources when the file sets (such as thumbnails or text files) were not properly ingested. This shouldn't break the manifest generation since these kinds of file sets are not able to be displayed in the Universal Viewer. Filtering these out at a higher level means it doesn't even make it to the serverless IIIF portion of the code in IIIF Print. Ref: - https://github.com/scientist-softserv/adventist-dl/issues/679
- Loading branch information
Showing
3 changed files
with
23 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
lib/iiif_manifest/manifest_builder/canvas_builder_factory_decorator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
# OVERRIDE IIIFManifest v0.5.0 to remove thumbnail and other non-image files from the manifest | ||
|
||
module IIIFManifest | ||
module ManifestBuilderDecorator | ||
module CanvasBuilderFactoryDecorator | ||
THUMBNAIL_FILE_SUFFIX = '.tn.jpg' | ||
|
||
def from(work) | ||
composite_builder.new( | ||
*file_set_presenters(work).map do |presenter| | ||
next if presenter.label.downcase.end_with?(THUMBNAIL_FILE_SUFFIX) || !presenter.image? | ||
canvas_builder_factory.new(presenter, work) | ||
end | ||
) | ||
end | ||
end | ||
end | ||
end | ||
|
||
IIIFManifest::ManifestBuilder::CanvasBuilderFactory | ||
.prepend(IIIFManifest::ManifestBuilderDecorator::CanvasBuilderFactoryDecorator) |
172 changes: 0 additions & 172 deletions
172
spec/services/iiif_print/manifest_builder_service_behavior_decorator_spec.rb
This file was deleted.
Oops, something went wrong.