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