Skip to content

Commit

Permalink
clean title for UT,AD
Browse files Browse the repository at this point in the history
  • Loading branch information
codingPF committed May 17, 2024
1 parent 1ba399b commit 94be6d1
Showing 1 changed file with 11 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ public List<ArdFilmDto> deserialize(
return films;
}


// add film to ARD
final ArdFilmDto filmDto =
new ArdFilmDto(
Expand Down Expand Up @@ -223,31 +222,19 @@ private Optional<Map<Resolution, String>> fallbackToM3U(Optional<ArdVideoInfoDto
}

private Optional<String> parseTitle(final JsonObject playerPageObject) {
final Optional<String> title =
JsonUtils.getAttributeAsString(playerPageObject, ATTRIBUTE_TITLE);
return title.map(nonNullTitle -> nonNullTitle.replace("Hörfassung", "Audiodeskription"));
}

/*
private Sender determinePartner(JsonObject playerPageObject) {
final Optional<String> partner = parsePartner(playerPageObject);
// If partner is present and an existing sender set it. Like for RBB
Sender partnerSender = null;
if (partner.isPresent()) {
partnerSender = ArdConstants.PARTNER_TO_SENDER.get(partner.get());
if (partnerSender != null) {
return partnerSender;
} else {
partnerSender = Sender.ARD;
LOG.info("unkown partner {}", partner.get() );
Optional<String> title = JsonUtils.getAttributeAsString(playerPageObject, ATTRIBUTE_TITLE);
if (title.isPresent()) {
String[] replaceWords = {" - Hörfassung", " (mit Gebärdensprache)", " mit Gebärdensprache"," (mit Audiodeskription)", "Audiodeskription"};
String cleanTitle = title.get().trim();
for (String replaceWord : replaceWords) {
cleanTitle = cleanTitle.replace(replaceWord, "");
}
} else {
partnerSender = Sender.ARD;
LOG.info("missing partner {}", playerPageObject);
cleanTitle = cleanTitle.trim();
return Optional.of(cleanTitle);
}
return partnerSender;
} */
return title;
}


private Optional<String> parsePartner(final JsonObject playerPageObject) {
if (playerPageObject.has(ELEMENT_PUBLICATION_SERVICE)) {
Expand Down

0 comments on commit 94be6d1

Please sign in to comment.