예제 #1
0
파일: playlist.py 프로젝트: estock/dogvibes
    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()
예제 #2
0
파일: playlist.py 프로젝트: estock/dogvibes
    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()
예제 #3
0
파일: playlist.py 프로젝트: estock/dogvibes
 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()
예제 #4
0
 def remove(self, id):
     db = Database()
     db.add_statement('''delete from sources where id = ?''', [int(id)])
     db.commit()