mirror of
https://github.com/MaintainTeam/LastPipeBender.git
synced 2025-03-01 05:48:22 +03:00
Fix unskip not working on certain segments
Separates hiding buttons and the destruction of unskip tracking variables. Unskip functionality may break when two segments are very close to each other. See 3:15:00 --> https://www.youtube.com/live/1ThO140eQY4?si=Vpb9A5eE7xeK2cuf&t=11700
This commit is contained in:
parent
c995fdb189
commit
054aed2821
1 changed files with 10 additions and 6 deletions
|
@ -2501,7 +2501,13 @@ public final class Player implements PlaybackListener, Listener {
|
|||
if (lastSegment != null
|
||||
&& progress > lastSegment.endTime + UNSKIP_WINDOW_MILLIS) {
|
||||
// un-skip window is over
|
||||
destroyUnskipVars();
|
||||
hideUnskipButtons();
|
||||
lastSegment = null;
|
||||
autoSkipGracePeriod = false;
|
||||
|
||||
if (DEBUG) {
|
||||
Log.d("SPONSOR_BLOCK", "Destroyed last segment variables (UNSKIP)");
|
||||
}
|
||||
} else if (lastSegment != null
|
||||
&& progress < lastSegment.endTime + UNSKIP_WINDOW_MILLIS
|
||||
&& progress >= lastSegment.startTime) {
|
||||
|
@ -2509,17 +2515,15 @@ public final class Player implements PlaybackListener, Listener {
|
|||
return lastSegment;
|
||||
}
|
||||
|
||||
destroyUnskipVars();
|
||||
hideUnskipButtons();
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
private void destroyUnskipVars() {
|
||||
private void hideUnskipButtons() {
|
||||
if (DEBUG) {
|
||||
Log.d("SPONSOR_BLOCK", "Destroying last segment variables, hiding manual skip buttons");
|
||||
Log.d("SPONSOR_BLOCK", "Hiding manual skip buttons (UNSKIP)");
|
||||
}
|
||||
lastSegment = null;
|
||||
autoSkipGracePeriod = false;
|
||||
UIs.call(PlayerUi::hideAutoSkip);
|
||||
UIs.call(PlayerUi::hideAutoUnskip);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue