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.
Merge pull request #683 from scientist-softserv/i679-remove-thumbnail…
…s-and-non-image-file-sets 🎁 Filter certain file sets from manifests
- 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.