From d7728e764512cb99764d044a751015cf189a360b Mon Sep 17 00:00:00 2001 From: spl0k Date: Sun, 23 Mar 2014 15:53:33 +0100 Subject: [PATCH] Converting frontend:folders --- frontend/folder.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/folder.py b/frontend/folder.py index bc53c0a..2b990ad 100644 --- a/frontend/folder.py +++ b/frontend/folder.py @@ -38,7 +38,7 @@ def check_admin(): @app.route('/folder') 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' ]) def add_folder(): @@ -56,7 +56,7 @@ def add_folder(): if error: return render_template('addfolder.html') - ret = FolderManager.add(name, path) + ret = FolderManager.add(store, name, path) if ret != FolderManager.SUCCESS: flash(FolderManager.error_str(ret)) return render_template('addfolder.html') @@ -73,7 +73,7 @@ def del_folder(id): flash('Invalid folder id') return redirect(url_for('folder_index')) - ret = FolderManager.delete(idid) + ret = FolderManager.delete(store, idid) if ret != FolderManager.SUCCESS: flash(FolderManager.error_str(ret)) else: @@ -84,12 +84,12 @@ def del_folder(id): @app.route('/folder/scan') @app.route('/folder/scan/') def scan_folder(id = None): - s = Scanner(session) + s = Scanner(store) if id is None: - for folder in Folder.query.filter(Folder.root == True): - FolderManager.scan(folder.id, s) + for folder in store.find(Folder, Folder.root == True): + FolderManager.scan(store, folder.id, s) else: - status = FolderManager.scan(id, s) + status = FolderManager.scan(store, id, s) if status != FolderManager.SUCCESS: flash(FolderManager.error_str(status)) return redirect(url_for('folder_index'))