Lidarr/UI/AddSeries/Existing/UnmappedFolderModel.js

27 lines
796 B
JavaScript
Raw Normal View History

2013-01-31 22:40:51 +00:00
'use strict';
2013-03-29 19:17:03 +00:00
define(['app', 'Quality/QualityProfileCollection'], function (app, qualityProfiles) {
2013-01-31 22:40:51 +00:00
NzbDrone.AddSeries.Existing.UnmappedFolderModel = Backbone.Model.extend({
2013-01-31 22:40:51 +00:00
2013-03-29 19:17:03 +00:00
defaults: {
quality: qualityProfiles
}
2013-01-31 22:40:51 +00:00
});
2013-01-31 22:40:51 +00:00
NzbDrone.AddSeries.Existing.UnmappedFolderCollection = Backbone.Collection.extend({
model: NzbDrone.AddSeries.Existing.UnmappedFolderModel,
2013-01-31 22:40:51 +00:00
importItems: function (rootFolderModel) {
2013-01-31 22:40:51 +00:00
this.reset();
var rootFolder = rootFolderModel.get('path');
2013-01-31 22:40:51 +00:00
_.each(rootFolderModel.get('unmappedFolders'), function (folder) {
this.push(new NzbDrone.AddSeries.Existing.UnmappedFolderModel({ rootFolder: rootFolder, folder: folder}));
}, this);
}
});
});