diff --git a/app/playlists.py b/app/playlists.py index cc9da55..7e541c6 100644 --- a/app/playlists.py +++ b/app/playlists.py @@ -797,7 +797,7 @@ class PlaylistTab(QTableWidget): return selected_row = self._get_selected_row() - if selected_row and selected_row < self.rowCount() - 1: + if selected_row is not None and selected_row < self.rowCount() - 1: starting_row = selected_row + 1 else: starting_row = 0 @@ -812,7 +812,7 @@ class PlaylistTab(QTableWidget): if title and needle in title.lower(): match_row = row break - artist = self._get_row_title(row) + artist = self._get_row_artist(row) if artist and needle in artist.lower(): match_row = row break @@ -827,7 +827,7 @@ class PlaylistTab(QTableWidget): row = 0 wrapped = True - if match_row: + if match_row is not None: self.selectRow(row) def search_previous(self) -> None: @@ -842,7 +842,7 @@ class PlaylistTab(QTableWidget): return selected_row = self._get_selected_row() - if selected_row and selected_row > 0: + if selected_row is not None and selected_row > 0: starting_row = selected_row - 1 else: starting_row = self.rowCount() - 1 @@ -872,7 +872,7 @@ class PlaylistTab(QTableWidget): row = self.rowCount() - 1 wrapped = True - if match_row: + if match_row is not None: self.selectRow(row) def select_next_row(self) -> None: