From 75fa5797f70123f68d4676201503cf35dcef46dc Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 29 Apr 2024 23:29:36 +0400 Subject: [PATCH] fix(YouTube - Hide keyword content): Filter Shorts found in horizontal shelves --- .../youtube/patches/components/KeywordContentFilter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/app/revanced/integrations/youtube/patches/components/KeywordContentFilter.java b/app/src/main/java/app/revanced/integrations/youtube/patches/components/KeywordContentFilter.java index acb9c9b26c..98f1ceebc8 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/components/KeywordContentFilter.java +++ b/app/src/main/java/app/revanced/integrations/youtube/patches/components/KeywordContentFilter.java @@ -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. ); /** @@ -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()) @@ -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();