Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
fix(YouTube - Hide keyword content): Filter Shorts found in horizonta…
Browse files Browse the repository at this point in the history
…l shelves
  • Loading branch information
LisoUseInAIKyrios committed Apr 29, 2024
1 parent 0d5c6e8 commit 75fa579
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ final class KeywordContentFilter extends Filter {
private final StringFilterGroup containsFilter = new StringFilterGroup(
null,
"modern_type_shelf_header_content.eml",
"shorts_lockup_cell.eml" // Part of 'shorts_shelf_carousel.eml'
"shorts_lockup_cell.eml", // Part of 'shorts_shelf_carousel.eml'
"video_card.eml" // Shorts that appear in a horizontal shelf.
);

/**
Expand Down Expand Up @@ -153,7 +154,7 @@ private static String titleCaseFirstWordOnly(String sentence) {
return sentence;
}
final int firstCodePoint = sentence.codePointAt(0);
// In some non English languages title case is different than upper case.
// In some non English languages title case is different than uppercase.
return new StringBuilder()
.appendCodePoint(Character.toTitleCase(firstCodePoint))
.append(sentence, Character.charCount(firstCodePoint), sentence.length())
Expand All @@ -167,6 +168,7 @@ private static String capitalizeAllFirstLetters(String sentence) {
if (sentence.isEmpty()) {
return sentence;
}

final int delimiter = ' ';
// Use code points and not characters to handle unicode surrogates.
int[] codePoints = sentence.codePoints().toArray();
Expand Down

0 comments on commit 75fa579

Please sign in to comment.