add the full path to the info returned by the file tree

This commit is contained in:
Damien Churchill 2010-01-26 18:20:43 +00:00
parent 518a73079a
commit 25b282fdb8
1 changed files with 2 additions and 0 deletions

View File

@ -538,6 +538,7 @@ class WebApi(JSONComponent):
torrent_file["progress"] = file_progress[index] torrent_file["progress"] = file_progress[index]
torrent_file["priority"] = file_priorities[index] torrent_file["priority"] = file_priorities[index]
torrent_file["index"] = index torrent_file["index"] = index
torrent_file["path"] = path
info[path] = torrent_file info[path] = torrent_file
# update the directory info # update the directory info
@ -554,6 +555,7 @@ class WebApi(JSONComponent):
progresses = dirinfo.setdefault("progresses", []) progresses = dirinfo.setdefault("progresses", [])
progresses.append(torrent_file["progress"]) progresses.append(torrent_file["progress"])
dirinfo["progress"] = float(sum(progresses)) / len(progresses) dirinfo["progress"] = float(sum(progresses)) / len(progresses)
dirinfo["path"] = dirname
dirname = os.path.dirname(dirname) dirname = os.path.dirname(dirname)
def walk(path, item): def walk(path, item):