Skip to content

Commit 51a81f8

Browse files
feat(YouTube - Hide layout components): Add Hide ticket shelf
1 parent 46547d7 commit 51a81f8

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/components/LayoutComponentsFilter.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@ public LayoutComponentsFilter() {
233233
"mixed_content_shelf"
234234
);
235235

236+
final var ticketShelf = new StringFilterGroup(
237+
Settings.HIDE_TICKET_SHELF,
238+
"ticket.eml"
239+
);
240+
236241
searchResultVideo = new StringFilterGroup(
237242
Settings.HIDE_SEARCH_RESULT_RECOMMENDATIONS,
238243
"search_video_with_context.eml"
@@ -278,6 +283,7 @@ public LayoutComponentsFilter() {
278283
artistCard,
279284
timedReactions,
280285
imageShelf,
286+
ticketShelf,
281287
channelMemberShelf,
282288
forYouShelf,
283289
horizontalShelves

extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/Settings.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public class Settings extends BaseSettings {
105105
public static final BooleanSetting HIDE_PLAYABLES = new BooleanSetting("revanced_hide_playables", TRUE);
106106
public static final BooleanSetting HIDE_SEARCH_RESULT_RECOMMENDATIONS = new BooleanSetting("revanced_hide_search_result_recommendations", TRUE);
107107
public static final BooleanSetting HIDE_SHOW_MORE_BUTTON = new BooleanSetting("revanced_hide_show_more_button", TRUE, true);
108+
public static final BooleanSetting HIDE_TICKET_SHELF = new BooleanSetting("revanced_hide_ticket_shelf", TRUE, true);
108109
// Alternative thumbnails
109110
public static final EnumSetting<ThumbnailOption> ALT_THUMBNAIL_HOME = new EnumSetting<>("revanced_alt_thumbnail_home", ThumbnailOption.ORIGINAL);
110111
public static final EnumSetting<ThumbnailOption> ALT_THUMBNAIL_SUBSCRIPTIONS = new EnumSetting<>("revanced_alt_thumbnail_subscription", ThumbnailOption.ORIGINAL);

patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ val hideLayoutComponentsPatch = bytecodePatch(
224224
SwitchPreference("revanced_hide_playables"),
225225
SwitchPreference("revanced_hide_search_result_recommendations"),
226226
SwitchPreference("revanced_hide_show_more_button"),
227+
SwitchPreference("revanced_hide_ticket_shelf"),
227228
SwitchPreference("revanced_hide_doodles"),
228229
)
229230

patches/src/main/resources/addresources/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ You will not be notified of any unexpected events."</string>
219219
<string name="revanced_hide_show_more_button_title">Hide \'Show more\' button</string>
220220
<string name="revanced_hide_show_more_button_summary_on">Button is hidden</string>
221221
<string name="revanced_hide_show_more_button_summary_off">Button is shown</string>
222+
<string name="revanced_hide_ticket_shelf_title">Hide ticket shelf</string>
223+
<string name="revanced_hide_ticket_shelf_summary_on">Ticket shelf is hidden</string>
224+
<string name="revanced_hide_ticket_shelf_summary_off">Ticket shelf is shown</string>
222225
<string name="revanced_hide_timed_reactions_title">Hide timed reactions</string>
223226
<string name="revanced_hide_timed_reactions_summary_on">Timed reactions are hidden</string>
224227
<string name="revanced_hide_timed_reactions_summary_off">Timed reactions are shown</string>

0 commit comments

Comments
 (0)