From bfcd548d806ad243484c7def1c7a9945e3bc5493 Mon Sep 17 00:00:00 2001 From: caneleex Date: Wed, 28 Jul 2021 13:29:26 +0200 Subject: [PATCH] another shot at fixing corrupted length string --- app/src/main/java/pl/jakubweg/SponsorBlockUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/pl/jakubweg/SponsorBlockUtils.java b/app/src/main/java/pl/jakubweg/SponsorBlockUtils.java index 190faf4a..0f0c8c31 100644 --- a/app/src/main/java/pl/jakubweg/SponsorBlockUtils.java +++ b/app/src/main/java/pl/jakubweg/SponsorBlockUtils.java @@ -36,6 +36,7 @@ import static android.view.View.GONE; import static android.view.View.VISIBLE; import static fi.razerman.youtube.XGlobals.debug; import static pl.jakubweg.PlayerController.getCurrentVideoId; +import static pl.jakubweg.PlayerController.getCurrentVideoLength; import static pl.jakubweg.PlayerController.getLastKnownVideoTime; import static pl.jakubweg.PlayerController.sponsorSegmentsOfCurrentVideo; import static pl.jakubweg.SponsorBlockPreferenceFragment.FORMATTER; @@ -397,7 +398,7 @@ public abstract class SponsorBlockUtils { } public static String appendTimeWithoutSegments(String totalTime) { - if (videoHasSegments && isSettingEnabled(showTimeWithoutSegments) && !TextUtils.isEmpty(totalTime)) { + if (videoHasSegments && isSettingEnabled(showTimeWithoutSegments) && !TextUtils.isEmpty(totalTime) && getCurrentVideoLength() != 1) { if (timeWithoutSegments.isEmpty()) { timeWithoutSegments = getTimeWithoutSegments(sponsorSegmentsOfCurrentVideo); }