summaryrefslogtreecommitdiffstats
path: root/pyload/web/app/scripts/models
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-09-07 21:32:03 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-09-07 21:32:15 +0200
commit0537c47cb430afa1770bc5bf8c757de867a276c0 (patch)
tree0c8f0e21d9c258d888ee83723d8c881627a15b63 /pyload/web/app/scripts/models
parentMoving plugin to pyload (diff)
downloadpyload-0537c47cb430afa1770bc5bf8c757de867a276c0.tar.xz
improved link grabber
Diffstat (limited to 'pyload/web/app/scripts/models')
-rw-r--r--pyload/web/app/scripts/models/CollectorPackage.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/pyload/web/app/scripts/models/CollectorPackage.js b/pyload/web/app/scripts/models/CollectorPackage.js
index e5625d7bd..b608b8e18 100644
--- a/pyload/web/app/scripts/models/CollectorPackage.js
+++ b/pyload/web/app/scripts/models/CollectorPackage.js
@@ -54,6 +54,14 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes', 'collection
this.trigger('change');
},
+ // Returns true if pack is empty now
+ removeLinks: function(links) {
+ this.get('links').remove(_.map(links, function(link) {
+ return link.url;
+ }));
+ return this.get('links').length === 0;
+ },
+
toJSON: function() {
var data = {
name: this.getName(),