Compare commits

..

2 Commits

Author SHA1 Message Date
Keith Edmunds
0507f495ad Fix adding only a note from track dialog
Fixes #160
2023-01-16 17:20:18 +00:00
Keith Edmunds
d87ff80bef Fix next track not selected when playing top row 2023-01-07 12:26:38 +00:00
2 changed files with 12 additions and 7 deletions

View File

@ -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

View File

@ -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
@ -719,7 +719,7 @@ class PlaylistTab(QTableWidget):
""" """
current_row = self._get_current_track_row_number() current_row = self._get_current_track_row_number()
if not current_row: if current_row is None:
send_mail(Config.ERRORS_TO, send_mail(Config.ERRORS_TO,
Config.ERRORS_FROM, Config.ERRORS_FROM,
"MusicMuster unexpected failure", "MusicMuster unexpected failure",