Skip to content

Commit

Permalink
Cloud Library indexing updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mdnoble73 committed Apr 29, 2024
1 parent e66dd74 commit 4bdfe24
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
Binary file modified code/cloud_library_export/cloud_library_export.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -223,30 +223,28 @@ private void processMarcRecord() {
checksumCalculator.reset();
String rawAvailabilityTypeResponse = null;
long availabilityTypeChecksum = 0;
if (availabilityType != null) {
rawAvailabilityTypeResponse = availabilityType.getRawResponse();
if (rawAvailabilityTypeResponse == null) {
rawAvailabilityTypeResponse = "";
}
checksumCalculator.update(rawAvailabilityTypeResponse.getBytes());
availabilityTypeChecksum = checksumCalculator.getValue();
try {
getExistingCloudLibraryAvailabilityStmt.setString(1, cloudLibraryId);
ResultSet getExistingAvailabilityRS = getExistingCloudLibraryAvailabilityStmt.executeQuery();
if (getExistingAvailabilityRS.next()) {
long existingTypeChecksum = getExistingAvailabilityRS.getLong("typeRawChecksum");
logger.debug("Availability type already exists");
if (existingTypeChecksum != availabilityTypeChecksum) {
logger.debug("Updating availability type details");
availabilityChanged = true;
}
} else {
logger.debug("Adding availability type for " + cloudLibraryId);
rawAvailabilityTypeResponse = availabilityType.getRawResponse();
if (rawAvailabilityTypeResponse == null) {
rawAvailabilityTypeResponse = "";
}
checksumCalculator.update(rawAvailabilityTypeResponse.getBytes());
availabilityTypeChecksum = checksumCalculator.getValue();
try {
getExistingCloudLibraryAvailabilityStmt.setString(1, cloudLibraryId);
ResultSet getExistingAvailabilityRS = getExistingCloudLibraryAvailabilityStmt.executeQuery();
if (getExistingAvailabilityRS.next()) {
long existingTypeChecksum = getExistingAvailabilityRS.getLong("typeRawChecksum");
logger.debug("Availability type already exists");
if (existingTypeChecksum != availabilityTypeChecksum) {
logger.debug("Updating availability type details");
availabilityChanged = true;
}
} catch (SQLException e) {
logEntry.incErrors("Error loading availability type", e);
} else {
logger.debug("Adding availability type for " + cloudLibraryId);
availabilityChanged = true;
}
} catch (SQLException e) {
logEntry.incErrors("Error loading availability type", e);
}


Expand Down Expand Up @@ -328,6 +326,9 @@ private void processMarcRecord() {
}
}
}
if (format.equals("eComic")) {
break;
}
}
}
}
Expand Down
Binary file modified code/reindexer/reindexer.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void processRecord(AbstractGroupedWorkSolr groupedWork, String identifier
//get target audience from Marc
targetAudience = productRS.getString("targetAudience");
if (targetAudience.equals("ADULT")) {
targetAudience.equals("Adult");
targetAudience = "Adult";
}
groupedWork.addTargetAudience(targetAudience);

Expand Down

0 comments on commit 4bdfe24

Please sign in to comment.