From e77c05b908d6ca9ba8b7694331c73e92f6c8ae1a Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Fri, 20 Jan 2023 22:01:05 +0000 Subject: [PATCH] Remove unused functions --- app/playlists.py | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/app/playlists.py b/app/playlists.py index b70847a..63f3edc 100644 --- a/app/playlists.py +++ b/app/playlists.py @@ -1490,48 +1490,6 @@ class PlaylistTab(QTableWidget): and pos.y() >= rect.center().y() # noqa W503 ) - def _meta_clear_attribute(self, row: int, attribute: int) -> None: - """Clear given metadata for row""" - - if row is None: - raise ValueError(f"_meta_clear_attribute({row=}, {attribute=})") - - new_metadata: int = self._meta_get(row) & ~(1 << attribute) - self.item(row, USERDATA).setData(self.ROW_FLAGS, new_metadata) - - def _meta_get(self, row: int) -> int: - """Return row metadata""" - - return (self.item(row, USERDATA).data(self.ROW_FLAGS)) - - def _meta_search(self, metadata: int, one: bool = True) -> List[int]: - """ - Search rows for metadata. - - If one is True, check that only one row matches and return - the row number. - - If one is False, return a list of matching row numbers. - """ - - matches = [] - for row in range(self.rowCount()): - if self._meta_get(row): - if self._meta_get(row) & (1 << metadata): - matches.append(row) - - if not one: - return matches - - if len(matches) <= 1: - return matches - else: - log.error( - f"Multiple matches for metadata '{metadata}' found " - f"in rows: {', '.join([str(x) for x in matches])}" - ) - raise AttributeError(f"Multiple '{metadata}' metadata {matches}") - def _move_row(self, session: scoped_session, plr: PlaylistRows, new_row_number: int) -> None: """Move playlist row to new_row_number using parent copy/paste"""