Browse Source

Standardize path for list directory api call. #3487

pull/3341/head
Ruud 11 years ago
parent
commit
28ffad10ab
  1. 2
      couchpotato/core/plugins/browser.py

2
couchpotato/core/plugins/browser.py

@ -3,6 +3,7 @@ import os
import string import string
from couchpotato.api import addApiView from couchpotato.api import addApiView
from couchpotato.core.helpers.encoding import sp
from couchpotato.core.helpers.variable import getUserDir from couchpotato.core.helpers.variable import getUserDir
from couchpotato.core.plugins.base import Plugin from couchpotato.core.plugins.base import Plugin
import six import six
@ -50,6 +51,7 @@ class FileBrowser(Plugin):
path = '/' path = '/'
dirs = [] dirs = []
path = sp(path)
for f in os.listdir(path): for f in os.listdir(path):
p = os.path.join(path, f) p = os.path.join(path, f)
if os.path.isdir(p) and ((self.is_hidden(p) and bool(int(show_hidden))) or not self.is_hidden(p)): if os.path.isdir(p) and ((self.is_hidden(p) and bool(int(show_hidden))) or not self.is_hidden(p)):

Loading…
Cancel
Save