added quality profile support to add series.

This commit is contained in:
kay.one
2013-01-26 19:04:15 -08:00
parent 1024e0f83d
commit f3e601d4ed
14 changed files with 132 additions and 15 deletions
@@ -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);