From 8f8c6a1034706acfbca0a1f518397463c002919e Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Wed, 28 Dec 2022 09:33:40 +0000 Subject: [PATCH] Remove redundant code --- app/models.py | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/app/models.py b/app/models.py index 6f3a7ae..8ccd0c8 100644 --- a/app/models.py +++ b/app/models.py @@ -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)