1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-12-22 08:56:17 +00:00

Implementing folder deletion

This commit is contained in:
Alban 2012-10-13 12:31:49 +02:00
parent 03a6dfd106
commit b82e7d68ae

11
web.py
View File

@ -112,6 +112,17 @@ def add_folder():
@app.route('/delfolder/<id>')
def del_folder(id):
try:
idid = uuid.UUID(id)
folder = db.MusicFolder.query.filter(db.MusicFolder.id == uuid.UUID(id)).one()
db.session.delete(folder)
db.session.commit()
flash("Deleted folder '%s'" % folder.name)
except ValueError:
flash('Invalid folder id')
except NoResultFound:
flash('No such folder')
return redirect(url_for('index'))
import api.system