mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-23 01:16:18 +00:00
Converting frontend:folders
This commit is contained in:
parent
f26cfbbb76
commit
d7728e7645
@ -38,7 +38,7 @@ def check_admin():
|
|||||||
|
|
||||||
@app.route('/folder')
|
@app.route('/folder')
|
||||||
def folder_index():
|
def folder_index():
|
||||||
return render_template('folders.html', folders = Folder.query.filter(Folder.root == True).all())
|
return render_template('folders.html', folders = store.find(Folder, Folder.root == True))
|
||||||
|
|
||||||
@app.route('/folder/add', methods = [ 'GET', 'POST' ])
|
@app.route('/folder/add', methods = [ 'GET', 'POST' ])
|
||||||
def add_folder():
|
def add_folder():
|
||||||
@ -56,7 +56,7 @@ def add_folder():
|
|||||||
if error:
|
if error:
|
||||||
return render_template('addfolder.html')
|
return render_template('addfolder.html')
|
||||||
|
|
||||||
ret = FolderManager.add(name, path)
|
ret = FolderManager.add(store, name, path)
|
||||||
if ret != FolderManager.SUCCESS:
|
if ret != FolderManager.SUCCESS:
|
||||||
flash(FolderManager.error_str(ret))
|
flash(FolderManager.error_str(ret))
|
||||||
return render_template('addfolder.html')
|
return render_template('addfolder.html')
|
||||||
@ -73,7 +73,7 @@ def del_folder(id):
|
|||||||
flash('Invalid folder id')
|
flash('Invalid folder id')
|
||||||
return redirect(url_for('folder_index'))
|
return redirect(url_for('folder_index'))
|
||||||
|
|
||||||
ret = FolderManager.delete(idid)
|
ret = FolderManager.delete(store, idid)
|
||||||
if ret != FolderManager.SUCCESS:
|
if ret != FolderManager.SUCCESS:
|
||||||
flash(FolderManager.error_str(ret))
|
flash(FolderManager.error_str(ret))
|
||||||
else:
|
else:
|
||||||
@ -84,12 +84,12 @@ def del_folder(id):
|
|||||||
@app.route('/folder/scan')
|
@app.route('/folder/scan')
|
||||||
@app.route('/folder/scan/<id>')
|
@app.route('/folder/scan/<id>')
|
||||||
def scan_folder(id = None):
|
def scan_folder(id = None):
|
||||||
s = Scanner(session)
|
s = Scanner(store)
|
||||||
if id is None:
|
if id is None:
|
||||||
for folder in Folder.query.filter(Folder.root == True):
|
for folder in store.find(Folder, Folder.root == True):
|
||||||
FolderManager.scan(folder.id, s)
|
FolderManager.scan(store, folder.id, s)
|
||||||
else:
|
else:
|
||||||
status = FolderManager.scan(id, s)
|
status = FolderManager.scan(store, id, s)
|
||||||
if status != FolderManager.SUCCESS:
|
if status != FolderManager.SUCCESS:
|
||||||
flash(FolderManager.error_str(status))
|
flash(FolderManager.error_str(status))
|
||||||
return redirect(url_for('folder_index'))
|
return redirect(url_for('folder_index'))
|
||||||
|
Loading…
Reference in New Issue
Block a user