2013-01-31 22:40:51 +00:00
|
|
|
|
'use strict';
|
|
|
|
|
/// <reference path="../../app.js" />
|
|
|
|
|
NzbDrone.AddSeries.Existing.UnmappedFolderModel = Backbone.Model.extend({
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
NzbDrone.AddSeries.Existing.UnmappedFolderCollection = Backbone.Collection.extend({
|
|
|
|
|
model: NzbDrone.AddSeries.Existing.UnmappedFolderModel,
|
|
|
|
|
|
|
|
|
|
|
2013-02-02 03:33:23 +00:00
|
|
|
|
importItems: function (rootFolderModel, quality) {
|
2013-01-31 22:40:51 +00:00
|
|
|
|
|
2013-02-02 03:33:23 +00:00
|
|
|
|
if (!rootFolderModel) {
|
2013-01-31 22:40:51 +00:00
|
|
|
|
throw "folder array is required";
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-02 03:33:23 +00:00
|
|
|
|
if (!quality) {
|
|
|
|
|
throw "quality is required";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.reset();
|
|
|
|
|
|
|
|
|
|
var qualityCollection = quality;
|
|
|
|
|
var rootFolder = rootFolderModel.get('path');
|
|
|
|
|
|
|
|
|
|
_.each(rootFolderModel.get('unmappedFolders'), function (folder) {
|
|
|
|
|
this.push(new NzbDrone.AddSeries.Existing.UnmappedFolderModel({rootFolder:rootFolder, folder: folder, quality: qualityCollection }));
|
2013-01-31 22:40:51 +00:00
|
|
|
|
}, this);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|