Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Commit

Permalink
fix(YouTube Music/SponsorBlock): SponsorBlock skips entire song when …
Browse files Browse the repository at this point in the history
  • Loading branch information
inotia00 committed Sep 14, 2024
1 parent 1be7d72 commit c294e5d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public final class VideoInformation {
public static void initialize() {
videoTime = -1;
videoLength = 0;
playbackSpeed = DEFAULT_YOUTUBE_MUSIC_PLAYBACK_SPEED;
Logger.printDebug(() -> "Initialized Player");
}

Expand Down Expand Up @@ -103,6 +102,11 @@ public static boolean seekTo(final long seekTime) {
final long videoTime = getVideoTime();
final long adjustedSeekTime = getAdjustedSeekTime(seekTime, videoLength);

if (videoTime <= 0 || videoLength <= 0) {
Logger.printDebug(() -> "Skipping seekTo as the video is not initialized");
return false;
}

Logger.printDebug(() -> "Seeking to: " + getFormattedTimeStamp(adjustedSeekTime));

// Try regular playback controller first, and it will not succeed if casting.
Expand Down

0 comments on commit c294e5d

Please sign in to comment.