fire progress -1 after current download is canceled, fixes #186

This commit is contained in:
j 2016-01-20 13:05:44 +05:30
parent 2548e2cd77
commit 97ef26f7e7
2 changed files with 4 additions and 1 deletions

View file

@ -334,6 +334,9 @@ class Node(Thread):
t = Transfer.get(item.id)
if not t.added:
# transfer was canceled
trigger_event('transfer', {
'id': item.id, 'progress': -1
})
return False
else:
t.progress = size / item.info['size']

View file

@ -56,7 +56,7 @@ oml.ui.appPanel = function() {
oml.bindEvent({
transfer: Ox.throttle(function(data) {
var mediastate = data.progress < -1
var mediastate = data.progress == -1
? 'unavailable'
: data.progress < 1
? 'transferring'