mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-12-03 17:22:54 +01:00
fix(youtube/return-youtube-dislike): fix dislikes not showing for video opened from feed autoplay (#408)
This commit is contained in:
parent
985c0d0c48
commit
307315c43c
@ -239,12 +239,6 @@ public class ReturnYouTubeDislike {
|
|||||||
public static void newVideoLoaded(@NonNull String videoId) {
|
public static void newVideoLoaded(@NonNull String videoId) {
|
||||||
Objects.requireNonNull(videoId);
|
Objects.requireNonNull(videoId);
|
||||||
|
|
||||||
PlayerType currentPlayerType = PlayerType.getCurrent();
|
|
||||||
if (currentPlayerType == PlayerType.INLINE_MINIMAL) {
|
|
||||||
LogHelper.printDebug(() -> "Ignoring inline playback of video: " + videoId);
|
|
||||||
setCurrentVideoId(null);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
synchronized (videoIdLockObject) {
|
synchronized (videoIdLockObject) {
|
||||||
if (videoId.equals(currentVideoId)) {
|
if (videoId.equals(currentVideoId)) {
|
||||||
return; // already loaded
|
return; // already loaded
|
||||||
@ -254,13 +248,14 @@ public class ReturnYouTubeDislike {
|
|||||||
setCurrentVideoId(null);
|
setCurrentVideoId(null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
PlayerType currentPlayerType = PlayerType.getCurrent();
|
||||||
LogHelper.printDebug(() -> "New video loaded: " + videoId + " playerType: " + currentPlayerType);
|
LogHelper.printDebug(() -> "New video loaded: " + videoId + " playerType: " + currentPlayerType);
|
||||||
setCurrentVideoId(videoId);
|
setCurrentVideoId(videoId);
|
||||||
|
|
||||||
// If a Short is opened while a regular video is on screen, this will incorrectly set this as false.
|
// If a Short is opened while a regular video is on screen, this will incorrectly set this as false.
|
||||||
// But this check is needed to fix unusual situations of opening/closing the app
|
// But this check is needed to fix unusual situations of opening/closing the app
|
||||||
// while both a regular video and a short are on screen.
|
// while both a regular video and a short are on screen.
|
||||||
dislikeDataIsShort = PlayerType.getCurrent().isNoneHiddenOrMinimized();
|
dislikeDataIsShort = currentPlayerType.isNoneHiddenOrMinimized();
|
||||||
|
|
||||||
RYDCachedFetch entry = futureCache.get(videoId);
|
RYDCachedFetch entry = futureCache.get(videoId);
|
||||||
if (entry != null && entry.futureInProgressOrFinishedSuccessfully()) {
|
if (entry != null && entry.futureInProgressOrFinishedSuccessfully()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user