Remove redundant code

This commit is contained in:
Keith Edmunds 2022-12-28 09:33:40 +00:00
parent ece6723211
commit 8f8c6a1034

View File

@ -206,16 +206,6 @@ class Playdates(Base):
.all()
)
# @staticmethod
# def remove_track(session: Session, track_id: int) -> None:
# """
# Remove all records of track_id
# """
#
# session.query(Playdates).filter(
# Playdates.track_id == track_id).delete()
# session.flush()
class Playlists(Base):
"""
@ -250,27 +240,14 @@ class Playlists(Base):
session.add(self)
session.commit()
# def add_track(
# self, session: Session, track_id: int,
# row: Optional[int] = None) -> None:
# """
# Add track to playlist at given row.
# If row=None, add to end of playlist
# """
#
# if row is None:
# row = self.next_free_row(session, self.id)
#
# xPlaylistTracks(session, self.id, track_id, row)
def close(self, session: Session) -> None:
"""Mark playlist as unloaded"""
# Closing this tab will mean all higher-number tabs have moved
# down by one
closed_idx = self.tab
self.tab = None
# Closing this tab will mean all higher-number tabs have moved
# down by one
session.execute(
update(Playlists)
.where(Playlists.tab > closed_idx)