parent
d87ff80bef
commit
0507f495ad
@ -1609,8 +1609,13 @@ class DbDialog(QDialog):
|
||||
self.accept()
|
||||
return
|
||||
|
||||
self.parent().visible_playlist_tab().insert_track(
|
||||
self.session, track, note=self.ui.txtNote.text())
|
||||
if track:
|
||||
self.parent().visible_playlist_tab().insert_track(
|
||||
self.session, track, note=self.ui.txtNote.text())
|
||||
else:
|
||||
self.parent().visible_playlist_tab().insert_header(
|
||||
self.session, note=self.ui.txtNote.text())
|
||||
|
||||
# Save to database (which will also commit changes)
|
||||
self.parent().visible_playlist_tab().save_playlist(self.session)
|
||||
# Clear note field and select search text to make it easier for
|
||||
|
||||
@ -669,7 +669,7 @@ class PlaylistTab(QTableWidget):
|
||||
self.update_display(session)
|
||||
|
||||
def insert_track(self, session: scoped_session, track: Tracks,
|
||||
note: str = None, repaint: bool = True) -> None:
|
||||
note: Optional[str] = None, repaint: bool = True) -> None:
|
||||
"""
|
||||
Insert track into playlist tab.
|
||||
|
||||
@ -680,10 +680,10 @@ class PlaylistTab(QTableWidget):
|
||||
to do the heavy lifing.
|
||||
"""
|
||||
|
||||
if not track and track.id:
|
||||
if not track:
|
||||
log.debug(
|
||||
f"insert_track({session=}, {track=}, {note=}, {repaint=}"
|
||||
" called with either no track or no track.id"
|
||||
f"insert_track({session=}, {note=}, {repaint=}"
|
||||
" called with no track"
|
||||
)
|
||||
return
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user