Skip to content

Commit fc21f8c

Browse files
committed
Fix repeat logic for Ayah playback in toolbar
Corrects the repeat logic to increment current_repeat up to repeat_count instead of repeat_count - 1, and adds a check to skip repeat logic when the current Ayah is 0. This ensures accurate repeat behavior and prevents unnecessary repeats at the start.
1 parent af7b505 commit fc21f8c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ui/widgets/toolbar.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,10 @@ def OnActionAfterListening(self):
275275
self.set_buttons_status()
276276
repeat_count = Config.listening.repeat_count
277277
action_after_listening = Config.listening.action_after_listening
278-
if repeat_count > 0:
279-
if self.current_repeat < repeat_count - 1:
278+
if self.navigation.current_ayah == 0:
279+
logger.debug("Current Ayah is 0, skipping repeat logic.")
280+
elif repeat_count > 0:
281+
if self.current_repeat < repeat_count:
280282
self.current_repeat += 1
281283
logger.debug(f"Repeating Ayah: repeat {self.current_repeat}/{repeat_count}")
282284
self.play_current_ayah()

0 commit comments

Comments
 (0)