actually fixed negative time without segments

This commit is contained in:
caneleex 2021-07-31 20:03:09 +02:00
parent 69f44095f6
commit 1c1bf5cfec

View File

@ -436,7 +436,7 @@ public abstract class SponsorBlockUtils {
} }
public static String appendTimeWithoutSegments(String totalTime) { public static String appendTimeWithoutSegments(String totalTime) {
if (videoHasSegments && isSettingEnabled(showTimeWithoutSegments) && !TextUtils.isEmpty(totalTime) && getCurrentVideoLength() != 1) { if (videoHasSegments && isSettingEnabled(showTimeWithoutSegments) && !TextUtils.isEmpty(totalTime) && getCurrentVideoLength() > 1) {
if (timeWithoutSegments.isEmpty()) { if (timeWithoutSegments.isEmpty()) {
timeWithoutSegments = getTimeWithoutSegments(sponsorSegmentsOfCurrentVideo); timeWithoutSegments = getTimeWithoutSegments(sponsorSegmentsOfCurrentVideo);
} }
@ -448,7 +448,7 @@ public abstract class SponsorBlockUtils {
public static String getTimeWithoutSegments(SponsorSegment[] sponsorSegmentsOfCurrentVideo) { public static String getTimeWithoutSegments(SponsorSegment[] sponsorSegmentsOfCurrentVideo) {
long currentVideoLength = getCurrentVideoLength(); long currentVideoLength = getCurrentVideoLength();
if (!isSettingEnabled(showTimeWithoutSegments) || sponsorSegmentsOfCurrentVideo == null || currentVideoLength == 1) { if (!isSettingEnabled(showTimeWithoutSegments) || sponsorSegmentsOfCurrentVideo == null || currentVideoLength <= 1) {
return ""; return "";
} }
long timeWithoutSegments = currentVideoLength + 500; // YouTube:tm: long timeWithoutSegments = currentVideoLength + 500; // YouTube:tm: