diff --git a/deluge/ui/web/css/deluge.css b/deluge/ui/web/css/deluge.css index 1609c497b..397049af5 100644 --- a/deluge/ui/web/css/deluge.css +++ b/deluge/ui/web/css/deluge.css @@ -257,7 +257,7 @@ dl.singleline dd { } /* Filepriority styles */ -.x-no-download, .x-normal-download, .x-high-download, .x-highest-download { +.x-no-download, .x-normal-download, .x-high-download, .x-highest-download, .x-mixed-download { padding-left: 20px; background-repeat: no-repeat; line-height: 16px; @@ -278,3 +278,7 @@ dl.singleline dd { .x-highest-download { background-image: url(/icons/highest.png); } + +.x-mixed-download { + /*background-image: url(/icons/mixed.png);*/ +} diff --git a/deluge/ui/web/json_api.py b/deluge/ui/web/json_api.py index 3565b8898..aa48b240e 100644 --- a/deluge/ui/web/json_api.py +++ b/deluge/ui/web/json_api.py @@ -532,7 +532,6 @@ class WebApi(JSONComponent): paths = [] info = {} - dir_info = {} for index, torrent_file in enumerate(files): path = torrent_file["path"] paths.append(path) @@ -542,17 +541,20 @@ class WebApi(JSONComponent): info[path] = torrent_file # update the directory info - dirinfo = info.setdefault(os.path.dirname(path), {}) - dirinfo["size"] = dirinfo.get("size", 0) + torrent_file["size"] - if "priority" not in dirinfo: - dirinfo["priority"] = torrent_file["priority"] - else: - if dirinfo["priority"] != torrent_file["priority"]: - dirinfo["priority"] = 9 + dirname = os.path.dirname(path) + while dirname: + dirinfo = info.setdefault(dirname, {}) + dirinfo["size"] = dirinfo.get("size", 0) + torrent_file["size"] + if "priority" not in dirinfo: + dirinfo["priority"] = torrent_file["priority"] + else: + if dirinfo["priority"] != torrent_file["priority"]: + dirinfo["priority"] = 9 - progresses = dirinfo.setdefault("progresses", []) - progresses.append(torrent_file["progress"]) - dirinfo["progress"] = float(sum(progresses)) / len(progresses) + progresses = dirinfo.setdefault("progresses", []) + progresses.append(torrent_file["progress"]) + dirinfo["progress"] = float(sum(progresses)) / len(progresses) + dirname = os.path.dirname(dirname) def walk(path, item): if item["type"] == "dir":