1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Web/_backboneApp/AddSeries/Existing/UnmappedFolderModel.js

35 lines
875 B
JavaScript
Raw Normal View History

2013-02-01 01:40:51 +03: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,
importItems: function (rootFolderModel, quality) {
2013-02-01 01:40:51 +03:00
if (!rootFolderModel) {
2013-02-01 01:40:51 +03:00
throw "folder array is required";
}
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-02-01 01:40:51 +03:00
}, this);
}
});