add hide-carousel-shelf patch

This commit is contained in:
inotia00 2023-04-28 11:30:10 +09:00
parent 420cd86070
commit 3a2d35baae

View File

@ -0,0 +1,35 @@
package app.revanced.patches.music.layout.carouselshelf.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.misc.litho.patch.MusicLithoFilterPatch
import app.revanced.patches.music.misc.settings.resource.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.util.enum.CategoryType
@Patch
@Name("hide-carousel-shelf")
@Description("Hides the carousel shelf from homepage and explorer.")
@DependsOn(
[
MusicLithoFilterPatch::class,
MusicSettingsPatch::class
]
)
@YouTubeMusicCompatibility
@Version("0.0.1")
class HideCarouselShelfPatch : BytecodePatch() {
override fun execute(context: BytecodeContext): PatchResult {
MusicSettingsPatch.addMusicPreference(CategoryType.LAYOUT, "revanced_hide_carousel_shelf", "false")
return PatchResultSuccess()
}
}