mirror of
https://github.com/codex-storage/deluge.git
synced 2025-03-02 20:10:47 +00:00
add .x-mixed-download to the priorities css
fix the way the directory stats are updated (parent directories weren't being updated)
This commit is contained in:
parent
2afd0a4e97
commit
447cb52bf1
@ -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);*/
|
||||
}
|
||||
|
@ -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":
|
||||
|
Loading…
x
Reference in New Issue
Block a user