summaryrefslogtreecommitdiffstats
path: root/pyload/web/app/scripts/models/CollectorPackage.js
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/web/app/scripts/models/CollectorPackage.js')
-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(),