mirror of
https://github.com/ilri/cgspace-java-helpers.git
synced 2025-05-12 08:06:10 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
fd893d8c4e
|
|||
2263ac27e8
|
|||
cf7012d698
|
|||
7edc60e6ca
|
@ -1,4 +1,4 @@
|
||||
# CGSpace Java Helpers [](https://travis-ci.org/ilri/dspace-curation-tasks)
|
||||
# CGSpace Java Helpers [](https://travis-ci.org/ilri/dspace-curation-tasks)
|
||||
DSpace curation tasks and other Java-based helpers used on the [CGSpace](https://cgspace.cgiar.org) institutional repository:
|
||||
|
||||
- **CountryCodeTagger**: add ISO 3166-1 Alpha2 country codes to items based on their existing country metadata
|
||||
|
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>io.github.ilri.cgspace</groupId>
|
||||
<artifactId>cgspace-java-helpers</artifactId>
|
||||
<version>5.1</version>
|
||||
<version>5.2</version>
|
||||
|
||||
<name>cgspace-java-helpers</name>
|
||||
<url>https://github.com/ilri/cgspace-java-helpers</url>
|
||||
|
@ -79,7 +79,7 @@ public class FixJpgJpgThumbnails {
|
||||
for (Bitstream thumbnailBitstream : thumbnailBundleBitstreams) {
|
||||
String thumbnailName = thumbnailBitstream.getName();
|
||||
|
||||
if (thumbnailName.contains(".jpg.jpg")) {
|
||||
if (thumbnailName.toLowerCase().contains(".jpg.jpg")) {
|
||||
Bundle[] originalBundles = item.getBundles("ORIGINAL");
|
||||
for (Bundle originalBundle : originalBundles) {
|
||||
Bitstream[] originalBundleBitstreams = originalBundle.getBitstreams();
|
||||
@ -88,7 +88,7 @@ public class FixJpgJpgThumbnails {
|
||||
String originalName = originalBitstream.getName();
|
||||
|
||||
//check if the original file name is the same as the thumbnail name minus the extra ".jpg"
|
||||
if (originalName.equals(StringUtils.removeEndIgnoreCase(thumbnailName, ".jpg")) && "Generated Thumbnail".equals(thumbnailBitstream.getDescription())) {
|
||||
if (originalName.equalsIgnoreCase(StringUtils.removeEndIgnoreCase(thumbnailName, ".jpg")) && ("Generated Thumbnail".equals(thumbnailBitstream.getDescription()) || "IM Thumbnail".equals(thumbnailBitstream.getDescription()))) {
|
||||
System.out.println(item.getHandle() + ": replacing " + thumbnailName + " with " + originalName);
|
||||
|
||||
//add the original bitstream to the THUMBNAIL bundle
|
||||
|
Reference in New Issue
Block a user