added catch so zip files are not treated as directories and also imported urllib to parse zip file names correctly

This commit is contained in:
robweber 2012-05-23 16:03:04 -05:00
parent ce7a2acb90
commit 842f56afd1

View File

@ -23,7 +23,7 @@ import json
import os import os
import xbmc import xbmc
import xbmcvfs import xbmcvfs
import urllib
def walk(path): def walk(path):
@ -48,14 +48,14 @@ def walk(path):
current_dirs, current_files = [], [] current_dirs, current_files = [], []
for x in listdir(current_path, extra_metadata=True): for x in listdir(current_path, extra_metadata=True):
if not x['file'].startswith("zip://"):
if x['filetype'] == 'directory':
current_dirs.append(x['file']) if x['filetype'] == 'directory' and not x['file'].startswith("zip://"):
current_dirs.append(urllib.unquote(x['file']))
else: else:
current_files.append(x['file']) current_files.append(urllib.unquote(x['file']))
except IndexError: except IndexError: