Skip to content

Commit

Permalink
Change mediaType for IIIF to interactiveResource
Browse files Browse the repository at this point in the history
  • Loading branch information
samleeflang committed Nov 19, 2024
1 parent 13c41c9 commit 8d961f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ public class MediaType extends Term {
private static final String STILL_IMAGE = "Still_Image";
private static final String SOUND = "Sound";
private static final String MOVING_IMAGE = "Moving_Image";
private static final String DATASET = "Dataset";
private static final String INTERACTIVE_RESOURCE = "Interactive_Resource";
private final List<String> dwcaTerms = List.of(TERM, "dc:type");
private final List<String> imageFormats = List.of("IMAGE/JPG", "JPG", "IMAGE/JPEG",
"JPEG", "IMAGE/PNG", "PNG", "IMAGE/TIF", "TIF");
private final List<String> datasetFormats = List.of("APPLICATION/JSON");
private final List<String> interactiveResourceFormats = List.of("APPLICATION/JSON");

@Override
public String retrieveFromDWCA(JsonNode unit) {
Expand Down Expand Up @@ -53,8 +53,8 @@ public String retrieveFromABCD(JsonNode unit) {
format = format.toUpperCase();
if (imageFormats.contains(format)) {
return STILL_IMAGE;
} else if (datasetFormats.contains(format)) {
return DATASET;
} else if (interactiveResourceFormats.contains(format)) {
return INTERACTIVE_RESOURCE;
} else {
log.warn("Unable to determine media type of digital media object");
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private static Stream<Arguments> provideFormatTypes() {
private static Stream<Arguments> provideABCDFormats() {
return Stream.of(
Arguments.of("image/jpeg", "Still_Image"),
Arguments.of("APPLICATION/JSON", "Dataset"),
Arguments.of("APPLICATION/JSON", "Interactive_Resource"),
Arguments.of("unknown/format", null),
Arguments.of(null, null)
);
Expand Down

0 comments on commit 8d961f5

Please sign in to comment.