correctly update mediastate during transfer

This commit is contained in:
rlx 2016-01-16 14:12:47 +05:30
parent 9fde49bdce
commit 4cf2c13e7e
2 changed files with 15 additions and 10 deletions

View file

@ -53,6 +53,21 @@ oml.ui.appPanel = function() {
}); });
} }
oml.bindEvent({
transfer: Ox.throttle(function(data) {
oml.$ui.list.value(data.id, {
mediastate: data.progress < 1 ? 'transferring' : 'available'
});
oml.$ui.browser.value(data.id, {
mediastate: data.progress < 1 ? 'transferring' : 'available'
});
if (data.progress == 1 && data.id == ui.item) {
Ox.Request.clearCache();
oml.$ui.infoView.updateElement(ui.item);
}
})
});
that.reload = function() { that.reload = function() {
Ox.Request.cancel(); Ox.Request.cancel();
Ox.Request.clearCache(); Ox.Request.clearCache();

View file

@ -774,16 +774,6 @@ oml.ui.infoView = function(externalData, isMixed) {
that.updateElement(externalData, [$info]); that.updateElement(externalData, [$info]);
} }
oml.bindEvent({
transfer: function(data) {
if (data.id == ui.item && data.progress == 1) {
Ox.Request.clearCache(); // FIXME: too much
oml.$ui.list.value(ui.item, {mediastate: 'available'});
oml.$ui.browser.value(ui.item, {mediastate: 'available'});
that.updateElement(ui.item, [$icon, $info, $data]);
}
}
});
that.bindEvent({ that.bindEvent({
mousedown: function() { mousedown: function() {
setTimeout(function() { setTimeout(function() {