Skip to content

Commit

Permalink
Merge pull request Aspen-Discovery#1817 from K-Alette/24.06.00
Browse files Browse the repository at this point in the history
Target Audience & Manga vs Manga Graphic Novels
  • Loading branch information
mdnoble73 authored May 23, 2024
2 parents d607ace + e8e131f commit 3f33929
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,17 @@ private void loadSystemTranslationMaps(String serverName, BaseIndexingLogEntry l
for (File curFile : defaultTranslationMapFiles) {
String mapName = curFile.getName().replace(".properties", "");
mapName = mapName.replace("_map", "");
if (mapName.startsWith("format")) {
/*if (mapName.startsWith("format")) {*/
translationMaps.put(mapName, loadSystemTranslationMap(curFile, logEntry));
}
/*}*/
}
if (serverTranslationMapFiles != null) {
for (File curFile : serverTranslationMapFiles) {
String mapName = curFile.getName().replace(".properties", "");
mapName = mapName.replace("_map", "");
if (mapName.startsWith("format")) {
/*if (mapName.startsWith("format")) {*/
translationMaps.put(mapName, loadSystemTranslationMap(curFile, logEntry));
}
/*}*/
}
}
}
Expand Down Expand Up @@ -263,7 +263,7 @@ String translateValue(String mapName, String value, String identifier, BaseIndex
return translatedValue;
}

LinkedHashSet<String> translateCollection(String mapName, Set<String> values, String identifier, BaseIndexingLogEntry logEntry, Logger logger, boolean logUnableToTranslateWarnings) {
public LinkedHashSet<String> translateCollection(String mapName, Set<String> values, String identifier, BaseIndexingLogEntry logEntry, Logger logger, boolean logUnableToTranslateWarnings) {
LinkedHashSet<String> translatedCollection = new LinkedHashSet<>();
for (String value : values){
String translatedValue = translateValue(mapName, value, identifier, logEntry, logger, logUnableToTranslateWarnings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public void getFormatFromSubjects(org.marc4j.marc.Record record, Set<String> res
result.add("BoardBook");
}else if (subfieldData.contains("pop-up")) {
result.add("Pop-UpBook");
}else if (subfieldData.startsWith("manga graphic novel")) {
}else if (subfieldData.startsWith("manga graphic novel") || subfieldData.equals("manga")) {
result.add("Manga");
}else if (subfieldData.contains("graphic novel")) {
boolean okToAdd = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -653,13 +653,13 @@ protected void loadTargetAudiences(AbstractGroupedWorkSolr groupedWork, org.marc
targetAudiences.add(unknownAudienceLabel);
}

LinkedHashSet<String> translatedAudiences = indexer.translateSystemCollection("target_audience", targetAudiences, identifier);
LinkedHashSet<String> translatedAudiences = settings.translateCollection("target_audience", targetAudiences, identifier, indexer.getLogEntry(), logger, true);
if (!unknownAudienceLabel.equals("Unknown") && translatedAudiences.contains("Unknown")){
translatedAudiences.remove("Unknown");
translatedAudiences.add(unknownAudienceLabel);
}
groupedWork.addTargetAudiences(translatedAudiences);
LinkedHashSet<String> translatedAudiencesFull = indexer.translateSystemCollection("target_audience_full", targetAudiences, identifier);
LinkedHashSet<String> translatedAudiencesFull = settings.translateCollection("target_audience_full", targetAudiences, identifier, indexer.getLogEntry(), logger, true);
if (!unknownAudienceLabel.equals("Unknown") && translatedAudiencesFull.contains("Unknown")){
translatedAudiencesFull.remove("Unknown");
translatedAudiencesFull.add(unknownAudienceLabel);
Expand Down
3 changes: 3 additions & 0 deletions code/web/release_notes/24.06.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
### Searching Updates
- Fixed issue where multiselect facets were not allowing multiple values to be selected when searching (Tickets 131841, 131923) (*KL, MDN*)

### Indexing Updates
- Add format match on 655a where if it equals "manga" the format "Manga" will be added (*KL*)
- Fixed issue where target audiences were not being mapped with the correct translation map values (Ticket 131935) (*KL*)

//other

Expand Down

0 comments on commit 3f33929

Please sign in to comment.