From ab5cd8943f3f120a1e99ec8db5cc64cb112fc9fb Mon Sep 17 00:00:00 2001 From: teamblue-e2 Date: Wed, 15 May 2024 13:27:12 +0200 Subject: [PATCH] [InfoBarGenerics] fix jumpPreviousMark --- lib/python/Screens/InfoBarGenerics.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index 64d10b767a..657130b415 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -3588,11 +3588,11 @@ def cueGetEndCutPosition(self): isin = True return ret - def jumpPreviousNextMark(self, _cmp, start=False): + def jumpPreviousNextMark(self, cmp, start=False): current_pos = self.cueGetCurrentPosition() if current_pos is None: return False - mark = self.getNearestCutPoint(current_pos, _cmp=_cmp, start=start) + mark = self.getNearestCutPoint(current_pos, cmp=cmp, start=start) if mark is not None: pts = mark[0] else: @@ -3610,21 +3610,21 @@ def jumpNextMark(self): if not self.jumpPreviousNextMark(lambda x: x - 90000): self.doSeek(-1) - def getNearestCutPoint(self, pts, _cmp=abs, start=False): + def getNearestCutPoint(self, pts, cmp=abs, start=False): # can be optimized beforecut = True nearest = None bestdiff = -1 instate = True if start: - bestdiff = (0 > pts) - (0 < pts) + bestdiff = cmp(0 - pts) if bestdiff >= 0: nearest = [0, False] for cp in self.cut_list: if beforecut and cp[1] in (self.CUT_TYPE_IN, self.CUT_TYPE_OUT): beforecut = False if cp[1] == self.CUT_TYPE_IN: # Start is here, disregard previous marks - diff = (cp[0] > pts) - (cp[0] < pts) + diff = cmp(cp[0] - pts) if start and diff >= 0: nearest = cp bestdiff = diff @@ -3636,7 +3636,7 @@ def getNearestCutPoint(self, pts, _cmp=abs, start=False): elif cp[1] == self.CUT_TYPE_OUT: instate = False elif cp[1] in (self.CUT_TYPE_MARK, self.CUT_TYPE_LAST): - diff = (cp[0] > pts) - (cp[0] < pts) + diff = cmp(cp[0] - pts) if instate and diff >= 0 and (nearest is None or bestdiff > diff): nearest = cp bestdiff = diff