fix th...
Content-type: text/plain

Author: damoxc

Revision: 6144

Log:
        add .x-mixed-download to the priorities css
fix the way the directory stats are updated (parent directories weren't being 
updated)

Diff:
Modified: trunk/deluge/ui/web/css/deluge.css
===================================================================
--- trunk/deluge/ui/web/css/deluge.css  2010-01-26 13:18:16 UTC (rev 6143)
+++ trunk/deluge/ui/web/css/deluge.css  2010-01-26 13:25:44 UTC (rev 6144)
@@ -257,7 +257,7 @@
 }
 
 /* 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 @@
 .x-highest-download {
        background-image: url(/icons/highest.png);
 }
+
+.x-mixed-download {
+       /*background-image: url(/icons/mixed.png);*/
+}

Modified: trunk/deluge/ui/web/json_api.py
===================================================================
--- trunk/deluge/ui/web/json_api.py     2010-01-26 13:18:16 UTC (rev 6143)
+++ trunk/deluge/ui/web/json_api.py     2010-01-26 13:25:44 UTC (rev 6144)
@@ -532,7 +532,6 @@
 
         paths = []
         info = {}
-        dir_info = {}
         for index, torrent_file in enumerate(files):
             path = torrent_file["path"]
             paths.append(path)
@@ -542,17 +541,20 @@
             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":


-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to