diff --git a/app/playlists.py b/app/playlists.py index 69fb186..961719f 100644 --- a/app/playlists.py +++ b/app/playlists.py @@ -492,7 +492,16 @@ class Playlist(QTableWidget): def meta_set(self, row, metadata): "Set row metadata" - DEBUG(f"meta_set(row={row}, metadata={metadata})") + if self.item(row, self.COL_TITLE): + title = self.item(row, self.COL_TITLE).text() + else: + title = "" + DEBUG(f"meta_set(row={row}, title={title}, metadata={metadata})") + if metadata is None and self.current_track and title == self.current_track.title: + import ipdb; ipdb.set_trace() + if row is None: + raise ValueError(f"meta_set() with row=None") + self.item(row, self.COL_INDEX).setData(Qt.UserRole, metadata) def play_next(self): @@ -514,6 +523,13 @@ class Playlist(QTableWidget): if not self.next_track: return + DEBUG( + "playlist.play_next(), " + f"next_track={self.next_track.title if self.next_track else None} " + "current_track=" + f"{self.current_track.title if self.current_track else None}" + ) + # If there's currently a track playing, fade it. if self.music.playing(): self.previous_track_position = self.music.fade()