forked from 0x2620/pandora
fix starting new download
This commit is contained in:
parent
065d35c2b2
commit
2ae32cc2f0
1 changed files with 5 additions and 1 deletions
|
@ -179,10 +179,14 @@ pandora.fs = (function() {
|
||||||
url = '/' + pandora.getVideoURLName(id, resolution, part, track),
|
url = '/' + pandora.getVideoURLName(id, resolution, part, track),
|
||||||
blobSize = 5*1024*1024, total;
|
blobSize = 5*1024*1024, total;
|
||||||
Ox.Log('FS', 'start downloading', url);
|
Ox.Log('FS', 'start downloading', url);
|
||||||
that.fs.root.getFile(partialName, {create: true}, function(fileEntry) {
|
that.fs.root.getFile(partialName, {create: false}, function(fileEntry) {
|
||||||
fileEntry.getMetadata(function(meta) {
|
fileEntry.getMetadata(function(meta) {
|
||||||
|
Ox.Log('FS', 'resume from', meta.size);
|
||||||
partialDownload(meta.size);
|
partialDownload(meta.size);
|
||||||
});
|
});
|
||||||
|
}, function() {
|
||||||
|
Ox.Log('FS', 'new download');
|
||||||
|
partialDownload(0);
|
||||||
});
|
});
|
||||||
function partialDownload(offset) {
|
function partialDownload(offset) {
|
||||||
var end = offset + blobSize;
|
var end = offset + blobSize;
|
||||||
|
|
Loading…
Reference in a new issue