summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/database/FileDatabase.py8
-rw-r--r--module/web/templates/default/queue.html6
2 files changed, 9 insertions, 5 deletions
diff --git a/module/database/FileDatabase.py b/module/database/FileDatabase.py
index 23e657ee4..eb76f468b 100644
--- a/module/database/FileDatabase.py
+++ b/module/database/FileDatabase.py
@@ -636,7 +636,7 @@ class FileMethods():
}
"""
self.c.execute('SELECT p.id, p.name, p.folder, p.site, p.password, p.queue, p.packageorder, s.sizetotal, s.sizedone, s.linksdone, s.linkstotal \
- FROM packages p JOIN pstats s ON p.id = s.id \
+ FROM packages p LEFT OUTER JOIN pstats s ON p.id = s.id \
WHERE p.queue=? ORDER BY p.packageorder', str(q))
data = {}
@@ -649,10 +649,10 @@ class FileMethods():
'password': r[4],
'queue': r[5],
'order': r[6],
- 'sizetotal': int(r[7]),
- 'sizedone': r[8] if r[8] else 0, #these can be None
+ 'sizetotal': int(r[7]) if r[7] else 0,
+ 'sizedone': int(r[8]) if r[8] else 0, #these can be None
'linksdone': r[9] if r[9] else 0,
- 'linkstotal': r[10],
+ 'linkstotal': r[10] if r[10] else 0,
'links': {}
}
diff --git a/module/web/templates/default/queue.html b/module/web/templates/default/queue.html
index c88fa3568..9403a8019 100644
--- a/module/web/templates/default/queue.html
+++ b/module/web/templates/default/queue.html
@@ -50,7 +50,11 @@ document.addEvent("domready", function(){
<img title="{{_("Move Package")}}" style="margin-left: -10px; cursor: pointer" height="12px" src="/media/default/img/package_go.png" />
</span>
</div>
- {% set progress = (package.linksdone * 100) / package.linkstotal %}
+ {% if package.linkstotal %}
+ {% set progress = (package.linksdone * 100) / package.linkstotal %}
+ {% else %}
+ {% set progress = 0 %}
+ {% endif %}
<div id="progress" style="border-radius: 4px; border: 1px solid #AAAAAA; width: 50%; height: 1em">
<div style="width: {{ progress }}%; height: 100%; background-color: #add8e6;"></div>