mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-22 17:06:17 +00:00
Implementing folder deletion
This commit is contained in:
parent
03a6dfd106
commit
b82e7d68ae
11
web.py
11
web.py
@ -112,6 +112,17 @@ def add_folder():
|
|||||||
|
|
||||||
@app.route('/delfolder/<id>')
|
@app.route('/delfolder/<id>')
|
||||||
def del_folder(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'))
|
return redirect(url_for('index'))
|
||||||
|
|
||||||
import api.system
|
import api.system
|
||||||
|
Loading…
Reference in New Issue
Block a user