Comparing version 1.0.2 to 1.0.3
@@ -240,2 +240,21 @@ var Utils; | ||
Cache.initCache = initCache; | ||
function clean(downloads) { | ||
var data = readCache(); | ||
for (var i = data.downloads.length - 1; i >= 0; i--) { | ||
var item = data.downloads[i]; | ||
var found = false; | ||
for (var _i = 0, downloads_2 = downloads; _i < downloads_2.length; _i++) { | ||
var downloadItem = downloads_2[_i]; | ||
if (downloadItem.url == item.url) { | ||
found = true; | ||
break; | ||
} | ||
} | ||
if (!found) { | ||
data.downloads.splice(i, 1); | ||
} | ||
} | ||
saveCache(data); | ||
} | ||
Cache.clean = clean; | ||
function isDownloaded(targetItem) { | ||
@@ -434,2 +453,12 @@ var data = readCache(); | ||
function downloadFiles(list, callback) { | ||
if (!list) { | ||
list = []; | ||
} | ||
else { | ||
list = list.concat(); | ||
} | ||
doDownloadFiles(list, callback); | ||
} | ||
Loader.downloadFiles = downloadFiles; | ||
function doDownloadFiles(list, callback) { | ||
if (list.length == 0) { | ||
@@ -441,3 +470,3 @@ callback && callback(); | ||
if (Cache.isDownloaded(item)) { | ||
downloadFiles(list, callback); | ||
doDownloadFiles(list, callback); | ||
return; | ||
@@ -481,6 +510,6 @@ } | ||
Cache.finishDownload(item); | ||
downloadFiles(list, callback); | ||
doDownloadFiles(list, callback); | ||
} | ||
} | ||
Loader.downloadFiles = downloadFiles; | ||
Loader.doDownloadFiles = doDownloadFiles; | ||
function getEntryName(entry) { | ||
@@ -622,3 +651,3 @@ var entryName = entry.entryName.toString(); | ||
var path = require("path"); | ||
var VERSION = "1.0.2"; | ||
var VERSION = "1.0.3"; | ||
function run(args) { | ||
@@ -664,2 +693,3 @@ var commandOptions = CommandLine.parse(args); | ||
Loader.downloadFiles(config.downloads, function () { | ||
Cache.clean(config.downloads); | ||
}); | ||
@@ -666,0 +696,0 @@ } |
{ | ||
"name": "depsync", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"author": "Dom Chen", | ||
@@ -5,0 +5,0 @@ "homepage": "http://www.idom.me/", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30201
718