Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
Sublime Music
Sublime Music
Commits
ccf8e940
Verified
Commit
ccf8e940
authored
Feb 13, 2020
by
Sumner Evans
💬
Browse files
Fixes
#89
: prevent errors when you remove all songs from the play queue
parent
120f7696
Pipeline
#117820200
passed with stages
in 11 minutes and 8 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
sublime/app.py
sublime/app.py
+9
-0
No files found.
sublime/app.py
View file @
ccf8e940
...
...
@@ -615,12 +615,21 @@ class SublimeMusicApp(Gtk.Application):
song_id
for
i
,
song_id
in
enumerate
(
self
.
state
.
play_queue
)
if
i
not
in
song_indexes_to_remove
]
# Determine how many songs before the currently playing one were also
# deleted.
before_current
=
[
i
for
i
in
song_indexes_to_remove
if
i
<
self
.
state
.
current_song_index
]
if
self
.
state
.
current_song_index
in
song_indexes_to_remove
:
if
len
(
self
.
state
.
play_queue
)
==
0
:
self
.
on_play_pause
()
self
.
state
.
current_song_index
=
-
1
self
.
update_window
()
return
self
.
state
.
current_song_index
-=
len
(
before_current
)
self
.
play_song
(
self
.
state
.
current_song_index
,
reset
=
True
)
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment