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