mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 09:03:49 -07:00
updating add existing series to use the common views.
This commit is contained in:
parent
1b55859eb2
commit
3c686808f2
9 changed files with 147 additions and 84 deletions
|
@ -2,13 +2,13 @@
|
|||
define(
|
||||
[
|
||||
'marionette',
|
||||
'AddSeries/Existing/CompositeView',
|
||||
'AddSeries/AddSeriesView',
|
||||
'AddSeries/Existing/UnmappedFolderCollection'
|
||||
], function (Marionette, UnmappedFolderCompositeView, UnmappedFolderCollection) {
|
||||
], function (Marionette, AddSeriesView, UnmappedFolderCollection) {
|
||||
|
||||
return Marionette.CollectionView.extend({
|
||||
|
||||
itemView: UnmappedFolderCompositeView,
|
||||
itemView: AddSeriesView,
|
||||
|
||||
initialize: function () {
|
||||
this.collection = new UnmappedFolderCollection();
|
||||
|
@ -26,14 +26,20 @@ define(
|
|||
_showAndSearch: function (index) {
|
||||
|
||||
var model = this.collection.at(index);
|
||||
|
||||
if (model) {
|
||||
var that = this;
|
||||
var currentIndex = index;
|
||||
var folderName = model.get('folder').name;
|
||||
this.addItemView(model, this.getItemView(), index);
|
||||
$.when(this.children.findByModel(model).search()).then(function () {
|
||||
$.when(this.children.findByModel(model).search({term: folderName})).then(function () {
|
||||
that._showAndSearch(currentIndex + 1);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
itemViewOptions: {
|
||||
isExisting: true
|
||||
}
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue