Add option to only extract specific labels

Add UI element for a comma-separated list of labels to extract by.
Should work with both Label and LabelPlus plugins.
If no filter is specified, it will extract anything.
This commit is contained in:
d8ahazard
2019-10-25 11:52:23 -05:00
parent 739a93351a
commit ad8049b89a
5 changed files with 189 additions and 60 deletions

View File

@@ -66,6 +66,23 @@ Deluge.ux.preferences.SimpleExtractorPage = Ext.extend(Ext.Panel, {
boxLabel: _('Extract torrent in-place')
});
fieldset2 = this.form.add({
xtype: 'fieldset',
border: false,
title: '',
autoHeight: true,
labelAlign: 'top',
labelWidth: 80,
defaultType: 'textfield'
});
this.extract_labels = fieldset.add({
fieldLabel: _('Label Filter:'),
labelSeparator : '',
name: 'extract_labels',
width: '97%'
});
this.on('show', this.updateConfig, this);
},
@@ -76,6 +93,7 @@ Deluge.ux.preferences.SimpleExtractorPage = Ext.extend(Ext.Panel, {
config['extract_path'] = this.extract_path.getValue();
config['use_name_folder'] = this.use_name_folder.getValue();
config['in_place_extraction'] = this.in_place_extraction.getValue();
config['extract_labels'] = this.extract_labels.getValue();
deluge.client.simpleextractor.set_config(config);
},
@@ -90,6 +108,7 @@ Deluge.ux.preferences.SimpleExtractorPage = Ext.extend(Ext.Panel, {
this.extract_path.setValue(config['extract_path']);
this.use_name_folder.setValue(config['use_name_folder']);
this.in_place_extraction.setValue(config['in_place_extraction']);
this.extract_labels.setValue(config['extract_labels']);
},
scope: this
});