Skip to content

Commit

Permalink
Merge pull request #25 from mspeake161/master
Browse files Browse the repository at this point in the history
Skip backward restarts track if not in first 2 seconds
  • Loading branch information
Nokse22 authored Feb 27, 2025
2 parents d0531d8 + 205f4e4 commit ed813e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/player_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@ def play_next(self):

def play_previous(self):
"""Play the previous track."""
# if not in the first 2 seconds of the track restart song
if self.query_position() > 2 * Gst.SECOND:
self.seek(0)
return

if not self.played_songs:
return

Expand Down

0 comments on commit ed813e1

Please sign in to comment.