From 78024290e21032d20f6677279437857a1d63ba2f Mon Sep 17 00:00:00 2001 From: inotia00 <108592928+inotia00@users.noreply.github.com> Date: Sat, 11 Nov 2023 14:13:46 +0900 Subject: [PATCH] fix(YouTube Music/Replace cast button): sometimes a new API fetch occurs even though the music has not ended --- .../patches/music/player/replace/ReplaceCastButtonPatch.kt | 2 +- .../patches/music/utils/playerresponse/PlayerResponsePatch.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/music/player/replace/ReplaceCastButtonPatch.kt b/src/main/kotlin/app/revanced/patches/music/player/replace/ReplaceCastButtonPatch.kt index 13afd34a5..54572bd6f 100644 --- a/src/main/kotlin/app/revanced/patches/music/player/replace/ReplaceCastButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/player/replace/ReplaceCastButtonPatch.kt @@ -97,7 +97,7 @@ object ReplaceCastButtonPatch : BytecodePatch( PlayerResponsePatch.injectPlaylistCall( "$MUSIC_UTILS_PATH/CheckMusicVideoPatch;" + "->" + - "playbackStart(Ljava/lang/String;Ljava/lang/String;I)V" + "playbackStart(Ljava/lang/String;Ljava/lang/String;IZ)V" ) arrayOf( diff --git a/src/main/kotlin/app/revanced/patches/music/utils/playerresponse/PlayerResponsePatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/playerresponse/PlayerResponsePatch.kt index 2257c52a8..1afe02506 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/playerresponse/PlayerResponsePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/playerresponse/PlayerResponsePatch.kt @@ -31,7 +31,7 @@ object PlayerResponsePatch : BytecodePatch( ) { insertMethod.addInstructions( 0, // move-result-object offset - "invoke-static {p$VIDEO_ID_PARAMETER, p$PLAYLIST_ID_PARAMETER, p$PLAYLIST_INDEX_PARAMETER}, $methodDescriptor" + "invoke-static {p$VIDEO_ID_PARAMETER, p$PLAYLIST_ID_PARAMETER, p$PLAYLIST_INDEX_PARAMETER, p$VIDEO_IS_OPENING_OR_PLAYING_PARAMETER}, $methodDescriptor" ) }