Fixed play queue currently playing when reorder happens
This commit is contained in:
@@ -139,8 +139,6 @@ class SublimeMusicApp(Gtk.Application):
|
||||
'device-update', self.on_device_update)
|
||||
self.window.player_controls.connect(
|
||||
'volume-change', self.on_volume_change)
|
||||
self.window.player_controls.connect(
|
||||
'play-queue-reorder', self.on_play_queue_reorder)
|
||||
self.window.connect('key-press-event', self.on_window_key_press)
|
||||
|
||||
self.window.show_all()
|
||||
@@ -238,11 +236,6 @@ class SublimeMusicApp(Gtk.Application):
|
||||
# Send out to the bus that we exist.
|
||||
self.dbus_manager.property_diff()
|
||||
|
||||
def on_play_queue_reorder(self, _, new_queue):
|
||||
self.state.play_queue = new_queue
|
||||
self.save_play_queue()
|
||||
self.update_window()
|
||||
|
||||
# ########## DBUS MANAGMENT ########## #
|
||||
def do_dbus_register(self, connection, path):
|
||||
def get_state_and_player():
|
||||
|
@@ -50,11 +50,6 @@ class PlayerControls(Gtk.ActionBar):
|
||||
GObject.TYPE_NONE,
|
||||
(object, bool),
|
||||
),
|
||||
'play-queue-reorder': (
|
||||
GObject.SignalFlags.RUN_FIRST,
|
||||
GObject.TYPE_NONE,
|
||||
(object, ),
|
||||
),
|
||||
}
|
||||
editing: bool = False
|
||||
editing_play_queue_song_list: bool = False
|
||||
@@ -360,9 +355,16 @@ class PlayerControls(Gtk.ActionBar):
|
||||
# which one comes first, but just in case, we have this
|
||||
# reordering_play_queue_song_list flag.
|
||||
if self.reordering_play_queue_song_list:
|
||||
currently_playing_index = [
|
||||
i for i, s in enumerate(self.play_queue_store) if s[2]
|
||||
][0]
|
||||
self.emit(
|
||||
'play-queue-reorder',
|
||||
[s[-1] for s in self.play_queue_store],
|
||||
'refresh-window',
|
||||
{
|
||||
'current_song_index': currently_playing_index,
|
||||
'play_queue': [s[-1] for s in self.play_queue_store],
|
||||
},
|
||||
False,
|
||||
)
|
||||
self.reordering_play_queue_song_list = False
|
||||
else:
|
||||
|
Reference in New Issue
Block a user