forked from 0x2620/pandora
dont re-download cached parts for multipart items
This commit is contained in:
parent
c743ad7a71
commit
a8a4191f1a
2 changed files with 32 additions and 24 deletions
|
@ -13,6 +13,7 @@ pandora.ui.cacheDialog = function() {
|
|||
},
|
||||
{
|
||||
id: 'item',
|
||||
operator: '+',
|
||||
title: Ox._('Item'),
|
||||
visible: true,
|
||||
width: 48
|
||||
|
|
|
@ -33,6 +33,9 @@ pandora.fs = (function() {
|
|||
downloadPart(0);
|
||||
|
||||
function downloadPart(part) {
|
||||
if (that.getVideoURL(id, pandora.user.ui.videoResolution, part + 1)) {
|
||||
done();
|
||||
else {
|
||||
that.downloadVideoURL(id, pandora.user.ui.videoResolution, part + 1, false, function(result) {
|
||||
result.progress = 1/parts * (part + result.progress);
|
||||
that.downloads[id].progress = result.progress;
|
||||
|
@ -44,6 +47,12 @@ pandora.fs = (function() {
|
|||
that.downloads[id].size = Ox.sum(sizes);
|
||||
}
|
||||
if (result.url) {
|
||||
done();
|
||||
}
|
||||
callback && callback(result);
|
||||
});
|
||||
}
|
||||
function done() {
|
||||
if (part + 1 == parts) {
|
||||
delete that.downloads[id];
|
||||
active = false;
|
||||
|
@ -59,8 +68,6 @@ pandora.fs = (function() {
|
|||
});
|
||||
}
|
||||
}
|
||||
callback && callback(result);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue