diff --git a/app/playlists.py b/app/playlists.py index 70293f1..b8421df 100644 --- a/app/playlists.py +++ b/app/playlists.py @@ -594,8 +594,8 @@ class PlaylistTab(QTableWidget): return [self._get_playlistrow_id(a) for a in self._get_selected_rows()] - def get_selected_playlistrows(self, - session: scoped_session) -> Optional[List]: + def get_selected_playlistrows( + self, session: scoped_session) -> Optional[List[PlaylistRows]]: """ Return a list of PlaylistRows of the selected rows """ @@ -603,7 +603,9 @@ class PlaylistTab(QTableWidget): plr_ids = self.get_selected_playlistrow_ids() if not plr_ids: return None - return [session.get(PlaylistRows, a) for a in plr_ids] + plrs = [session.get(PlaylistRows, a) for a in plr_ids] + + return [plr for plr in plrs if plr is not None] def insert_header(self, session: scoped_session, note: str, repaint: bool = True) -> None: