sidebar: add_to_playlist() fixes

- Commit after adding tracks
- If tracks were added to the Queued Tracks playlist, then set it as the
  current playlist in the Player

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2021-12-09 17:49:40 -05:00
parent 6c81981570
commit 2e14b511a4
1 changed files with 4 additions and 0 deletions

View File

@ -1,4 +1,5 @@
# Copyright 2021 (c) Anna Schumaker.
import audio
import db
from gi.repository import Gtk
from . import stack
@ -25,3 +26,6 @@ class Sidebar(Gtk.Box):
if playlist.can_add_remove_tracks():
for track in self.panel.selected_tracks():
playlist.add_track(track)
if playlist == db.user.Table.find("Queued Tracks"):
audio.Player.set_playlist(playlist)
db.sql.commit()