Remove unused functions
This commit is contained in:
parent
ffa3015ac3
commit
e77c05b908
@ -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"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user