From 7fa06eade472fdc36d3882a0a214287b4c2f871c Mon Sep 17 00:00:00 2001 From: Ruud Date: Fri, 25 May 2012 23:40:54 +0200 Subject: [PATCH] Select folder, show root --- couchpotato/core/plugins/browser/main.py | 6 ++++-- couchpotato/static/scripts/page/settings.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/couchpotato/core/plugins/browser/main.py b/couchpotato/core/plugins/browser/main.py index 887edc3..90f2673 100644 --- a/couchpotato/core/plugins/browser/main.py +++ b/couchpotato/core/plugins/browser/main.py @@ -62,13 +62,15 @@ class FileBrowser(Plugin): def view(self): + path = getParam('path', '/') + try: - dirs = self.getDirectories(path = getParam('path', '/'), show_hidden = getParam('show_hidden', True)) + dirs = self.getDirectories(path = path, show_hidden = getParam('show_hidden', True)) except: dirs = [] return jsonified({ - 'is_root': getParam('path', '/') == '/', + 'is_root': path == '/' or not path, 'empty': len(dirs) == 0, 'dirs': dirs, }) diff --git a/couchpotato/static/scripts/page/settings.js b/couchpotato/static/scripts/page/settings.js index 20ca457..39ef946 100644 --- a/couchpotato/static/scripts/page/settings.js +++ b/couchpotato/static/scripts/page/settings.js @@ -702,7 +702,7 @@ Option.Directory = new Class({ var v = self.input.get('text'); var previous_dir = self.getParentDir(); - if(previous_dir != v && previous_dir.length > 1){ + if(previous_dir != v && previous_dir.length >= 1 && !json.is_root){ self.back_button.set('data-value', previous_dir) self.back_button.set('html', '« '+self.getCurrentDirname(previous_dir)) self.back_button.show()