You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Radarr/UI/AddSeries/Collection.js

32 lines
811 B

'use strict';
12 years ago
define(
[
'backbone',
'Series/SeriesModel'
], function (Backbone, SeriesModel) {
12 years ago
return Backbone.Collection.extend({
url : window.NzbDrone.ApiRoot + '/series/lookup',
12 years ago
model: SeriesModel,
initialize: function (options) {
this.unmappedFolderModel = options.unmappedFolderModel;
},
12 years ago
parse: function (response) {
var self = this;
12 years ago
_.each(response, function (model) {
model.id = undefined;
if (self.unmappedFolderModel) {
model.path = self.unmappedFolderModel.get('folder').path;
}
12 years ago
});
12 years ago
return response;
}
});
});