From 10fb99a06392a9633f46f288a45a3d242f0f4576 Mon Sep 17 00:00:00 2001 From: Bart <35781016+Bonusbartus@users.noreply.github.com> Date: Sun, 4 Jan 2026 00:20:42 +0100 Subject: [PATCH] Enhanced Skip previous behavior (#2915) --- music_assistant/controllers/player_queues.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/music_assistant/controllers/player_queues.py b/music_assistant/controllers/player_queues.py index 5ecfd929..2bcdb5f1 100644 --- a/music_assistant/controllers/player_queues.py +++ b/music_assistant/controllers/player_queues.py @@ -783,7 +783,12 @@ class PlayerQueuesController(CoreController): current_index = self._queues[queue_id].current_index if current_index is None: return - await self.play_index(queue_id, max(current_index - 1, 0), debounce=True) + next_index = int(current_index) + # restart current track if current track has played longer than 4 + # otherwise skip to previous track + if self._queues[queue_id].elapsed_time < 5: + next_index = max(current_index - 1, 0) + await self.play_index(queue_id, next_index, debounce=True) @api_command("player_queues/skip") async def skip(self, queue_id: str, seconds: int = 10) -> None: -- 2.34.1