Exemplo n.º 1
0
    def rename(self, playlist_id, name):
        self.tick_version()
        db = Database()
        db.commit_statement('''select * from playlists where id = ?''', [int(playlist_id)])
        row = db.fetchone()
        if row == None:
            raise ValueError('Could not get playlist with id=' + playlist_id)

        db.add_statement('''update playlists set name = ? where id = ?''', [name, int(playlist_id)])
        db.commit()
Exemplo n.º 2
0
    def remove(self, id):
        self.tick_version()
        db = Database()
        db.commit_statement('''select * from playlists where id = ?''', [int(id)])
        row = db.fetchone()
        if row == None:
            raise ValueError('Could not get playlist with id=' + id)

        db.add_statement('''delete from playlist_tracks where playlist_id = ?''', [int(id)])
        db.add_statement('''delete from playlists where id = ?''', [int(id)])
        db.commit()
Exemplo n.º 3
0
 def remove(self, id):
     db = Database()
     db.add_statement('''delete from playlist_tracks where playlist_id = ?''', [int(id)])
     db.add_statement('''delete from playlists where id = ?''', [int(id)])
     db.commit()
Exemplo n.º 4
0
 def remove(self, id):
     db = Database()
     db.add_statement('''delete from sources where id = ?''', [int(id)])
     db.commit()