mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
added quality profile support to add series.
This commit is contained in:
@@ -15,12 +15,17 @@ NzbDrone.AddSeries.AddNewSeriesView = Backbone.Marionette.Layout.extend({
|
||||
|
||||
collection: new NzbDrone.AddSeries.SearchResultCollection(),
|
||||
|
||||
initialize: function (rootFolders) {
|
||||
if (rootFolders === undefined) {
|
||||
initialize: function (options) {
|
||||
if (options.rootFolders === undefined) {
|
||||
throw "rootFolder arg is required.";
|
||||
}
|
||||
|
||||
this.rootFoldersCollection = rootFolders;
|
||||
if (options.qualityProfiles === undefined) {
|
||||
throw "qualityProfiles arg is required.";
|
||||
}
|
||||
|
||||
this.rootFoldersCollection = options.rootFolders;
|
||||
this.qualityProfilesCollection = options.qualityProfiles;
|
||||
},
|
||||
|
||||
onRender: function () {
|
||||
@@ -61,7 +66,8 @@ NzbDrone.AddSeries.AddNewSeriesView = Backbone.Marionette.Layout.extend({
|
||||
|
||||
resultUpdated: function (options, context) {
|
||||
_.each(options.models, function (model) {
|
||||
model.set('rootFolders', context.rootFoldersCollection.rootFolders.models);
|
||||
model.set('rootFolders', context.rootFoldersCollection.models);
|
||||
model.set('qualityProfiles', context.qualityProfilesCollection.models);
|
||||
});
|
||||
|
||||
context.searchResult.show(context.resultView);
|
||||
|
||||
@@ -4,16 +4,15 @@
|
||||
</div>
|
||||
<div id="{{id}}" class="accordion-body collapse">
|
||||
<div class="accordion-inner">
|
||||
<select class="root-dir-input span7" name="rootFolders">
|
||||
<select class="root-dir-input span7">
|
||||
{{#each rootFolders}}
|
||||
<option value="{{id}}">{{attributes.path}}</option>
|
||||
{{/each}}
|
||||
</select>
|
||||
<select class="quality-profile-input span2">
|
||||
<option value="volvo">Volvo</option>
|
||||
<option value="saab">Saab</option>
|
||||
<option value="mercedes">Mercedes</option>
|
||||
<option value="audi">Audi</option>
|
||||
{{#each qualityProfiles}}
|
||||
<option value="{{id}}">{{attributes.name}}</option>
|
||||
{{/each}}
|
||||
</select>
|
||||
<div class="btn btn-success pull-right icon-plus">
|
||||
</div>
|
||||
|
||||
@@ -8,6 +8,8 @@ NzbDrone.AddSeries.SearchItemView = Backbone.Marionette.ItemView.extend({
|
||||
className: 'search-item accordion-group',
|
||||
onRender: function () {
|
||||
this.listenTo(this.model, 'change', this.render);
|
||||
//this.listenTo(this.model.get('rootFolders'), 'reset', this.render);
|
||||
//this.listenTo(this.model.get('qualityProfiles'), 'reset', this.render);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user