finished add series,
still has a few rough edges but should be functional.
This commit is contained in:
parent
ea929974f3
commit
465dc725c8
|
@ -0,0 +1,16 @@
|
||||||
|
using FluentMigrator;
|
||||||
|
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.Datastore.Migration
|
||||||
|
{
|
||||||
|
[Tags("")]
|
||||||
|
[Migration(2)]
|
||||||
|
public class Remove_tvrage_imdb_unique_constraint : NzbDroneMigrationBase
|
||||||
|
{
|
||||||
|
protected override void MainDbUpgrade()
|
||||||
|
{
|
||||||
|
Execute.Sql("DROP INDEX IX_Series_TvRageId;");
|
||||||
|
Execute.Sql("DROP INDEX IX_Series_ImdbId;");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -202,6 +202,7 @@
|
||||||
<Compile Include="Datastore\IWriteModels.cs" />
|
<Compile Include="Datastore\IWriteModels.cs" />
|
||||||
<Compile Include="Datastore\LazyList.cs" />
|
<Compile Include="Datastore\LazyList.cs" />
|
||||||
<Compile Include="Datastore\MappingExtensions.cs" />
|
<Compile Include="Datastore\MappingExtensions.cs" />
|
||||||
|
<Compile Include="Datastore\Migration\002_Remove_tvrage_imdb_unique_constraint.cs" />
|
||||||
<Compile Include="Datastore\Migration\Framework\MigrationController.cs" />
|
<Compile Include="Datastore\Migration\Framework\MigrationController.cs" />
|
||||||
<Compile Include="Datastore\Migration\Framework\MigrationExtension.cs" />
|
<Compile Include="Datastore\Migration\Framework\MigrationExtension.cs" />
|
||||||
<Compile Include="Datastore\Migration\Framework\MigrationOptions.cs" />
|
<Compile Include="Datastore\Migration\Framework\MigrationOptions.cs" />
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<dictionary name="Keivan.Beigi">
|
<dictionary name="Keivan.Beigi">
|
||||||
<words>
|
<words>
|
||||||
<w>bnzbd</w>
|
<w>bnzbd</w>
|
||||||
|
<w>clickable</w>
|
||||||
<w>mouseenter</w>
|
<w>mouseenter</w>
|
||||||
<w>mouseleave</w>
|
<w>mouseleave</w>
|
||||||
</words>
|
</words>
|
||||||
|
|
|
@ -19,20 +19,26 @@ define([
|
||||||
'click .x-import': '_importSeries'
|
'click .x-import': '_importSeries'
|
||||||
},
|
},
|
||||||
|
|
||||||
onRender: function () {
|
initialize: function () {
|
||||||
|
this.rootFolderLayout = new NzbDrone.AddSeries.RootFolders.Layout();
|
||||||
|
this.rootFolderLayout.on('folderSelected', this._folderSelected, this);
|
||||||
|
|
||||||
/* rootFolderCollection.fetch({success: function () {
|
},
|
||||||
self.importExisting.show(new NzbDrone.AddSeries.Existing.RootDirListView({model: rootFolderCollection.at(0)}));
|
|
||||||
}});*/
|
_folderSelected: function (options) {
|
||||||
|
NzbDrone.modalRegion.closeModal();
|
||||||
|
this.workspace.show(new NzbDrone.AddSeries.Existing.ListView({model: options.model}));
|
||||||
|
},
|
||||||
|
|
||||||
|
onRender: function () {
|
||||||
qualityProfileCollection.fetch();
|
qualityProfileCollection.fetch();
|
||||||
rootFolderCollection.fetch();
|
rootFolderCollection.fetch();
|
||||||
|
|
||||||
this.workspace.show(new NzbDrone.AddSeries.AddSeriesView());
|
this.workspace.show(new NzbDrone.AddSeries.AddSeriesView());
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
_importSeries: function () {
|
_importSeries: function () {
|
||||||
NzbDrone.modalRegion.show(new NzbDrone.AddSeries.RootFolders.Layout());
|
NzbDrone.modalRegion.show(this.rootFolderLayout);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,18 +16,7 @@ define(['app',
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize: function () {
|
initialize: function () {
|
||||||
|
|
||||||
this.collection = new NzbDrone.AddSeries.Collection();
|
this.collection = new NzbDrone.AddSeries.Collection();
|
||||||
NzbDrone.AddSeries.New.AddNewSeriesContext = this;
|
|
||||||
|
|
||||||
NzbDrone.vent.on(NzbDrone.Events.SeriesAdded, function (options) {
|
|
||||||
if (!options.existing) {
|
|
||||||
NzbDrone.AddSeries.New.AddNewSeriesContext.ui.seriesSearch.val('');
|
|
||||||
|
|
||||||
//Todo: Figure out why this is inconsistent
|
|
||||||
options.series.collection.reset();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onRender: function () {
|
onRender: function () {
|
||||||
|
|
|
@ -5,7 +5,7 @@ define([
|
||||||
'AddSeries/Existing/UnmappedFolderModel',
|
'AddSeries/Existing/UnmappedFolderModel',
|
||||||
'AddSeries/Collection',
|
'AddSeries/Collection',
|
||||||
'AddSeries/SearchResultView',
|
'AddSeries/SearchResultView',
|
||||||
'Series/SeriesModel'], function (app, rootFolders, qualityProfileCollection) {
|
'Series/SeriesModel'], function () {
|
||||||
|
|
||||||
NzbDrone.AddSeries.Existing.UnmappedFolderCompositeView = Backbone.Marionette.CompositeView.extend({
|
NzbDrone.AddSeries.Existing.UnmappedFolderCompositeView = Backbone.Marionette.CompositeView.extend({
|
||||||
|
|
||||||
|
@ -31,9 +31,9 @@ define([
|
||||||
this.collection = new NzbDrone.AddSeries.Collection();
|
this.collection = new NzbDrone.AddSeries.Collection();
|
||||||
this.collection.bind('reset', this.collectionReset, this);
|
this.collection.bind('reset', this.collectionReset, this);
|
||||||
|
|
||||||
this.on("itemview:seriesAdded", function () {
|
this.on("item:removed", function () {
|
||||||
this.close();
|
this.close();
|
||||||
});
|
}, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
onRender: function () {
|
onRender: function () {
|
||||||
|
@ -53,7 +53,7 @@ define([
|
||||||
|
|
||||||
this.searchCollection.fetch({
|
this.searchCollection.fetch({
|
||||||
data : { term: this.ui.searchText.val() },
|
data : { term: this.ui.searchText.val() },
|
||||||
success: function (collection) {
|
success: function () {
|
||||||
icon.removeClass('icon-spin icon-spinner disabled').addClass('icon-search');
|
icon.removeClass('icon-spin icon-spinner disabled').addClass('icon-search');
|
||||||
deferred.resolve();
|
deferred.resolve();
|
||||||
self.collection.add(self.searchCollection.shift());
|
self.collection.add(self.searchCollection.shift());
|
||||||
|
@ -101,7 +101,7 @@ define([
|
||||||
return {
|
return {
|
||||||
qualityProfile: this.ui.profileList,
|
qualityProfile: this.ui.profileList,
|
||||||
rootFolder : this.model.get('rootFolder'),
|
rootFolder : this.model.get('rootFolder'),
|
||||||
folder : this.model.get('folder'),
|
folder : this.model.get('folder').path,
|
||||||
isExisting : true
|
isExisting : true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<td name="path" class="span10"/>
|
<td name="path" class="span10 x-folder clickable"/>
|
||||||
<td class="span3">
|
<td class="span3 x-folder clickable">
|
||||||
<span name="freeSpaceString"></span>
|
<span name="freeSpaceString"></span>
|
||||||
</td>
|
</td>
|
||||||
<td class="span1 nz-row-action">
|
<td class="span1 nz-row-action">
|
||||||
|
|
|
@ -8,14 +8,18 @@ define(['app', 'AddSeries/RootFolders/RootFolderCollection', 'Mixins/AutoComplet
|
||||||
tagName : 'tr',
|
tagName : 'tr',
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
'click .x-remove': 'removeFolder'
|
'click .x-remove': 'removeFolder',
|
||||||
|
'click .x-folder': 'folderSelected'
|
||||||
},
|
},
|
||||||
|
|
||||||
removeFolder: function () {
|
removeFolder: function () {
|
||||||
this.model.destroy({ wait: true });
|
this.model.destroy({ wait: true });
|
||||||
this.model.collection.remove(this.model);
|
this.model.collection.remove(this.model);
|
||||||
}
|
},
|
||||||
|
|
||||||
|
folderSelected: function () {
|
||||||
|
this.trigger('folderSelected', this.model);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
NzbDrone.AddSeries.RootDirListView = Backbone.Marionette.CollectionView.extend({
|
NzbDrone.AddSeries.RootDirListView = Backbone.Marionette.CollectionView.extend({
|
||||||
|
@ -40,14 +44,22 @@ define(['app', 'AddSeries/RootFolders/RootFolderCollection', 'Mixins/AutoComplet
|
||||||
'click .x-add': 'addFolder'
|
'click .x-add': 'addFolder'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
initialize: function () {
|
||||||
|
this.collection = rootFolders;
|
||||||
|
this.rootfolderListView = new NzbDrone.AddSeries.RootDirListView({ collection: rootFolders });
|
||||||
|
this.rootfolderListView.on('itemview:folderSelected', this._onFolderSelected, this);
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
onRender: function () {
|
onRender: function () {
|
||||||
|
|
||||||
this.collection = rootFolders;
|
this.currentDirs.show(this.rootfolderListView);
|
||||||
this.currentDirs.show(new NzbDrone.AddSeries.RootDirListView({ collection: this.collection }));
|
|
||||||
this.ui.pathInput.autoComplete('/directories');
|
this.ui.pathInput.autoComplete('/directories');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_onFolderSelected: function (options) {
|
||||||
|
this.trigger('folderSelected', options);
|
||||||
|
},
|
||||||
|
|
||||||
addFolder: function () {
|
addFolder: function () {
|
||||||
var newDir = new NzbDrone.AddSeries.RootFolders.RootFolderModel(
|
var newDir = new NzbDrone.AddSeries.RootFolders.RootFolderModel(
|
||||||
|
@ -55,25 +67,12 @@ define(['app', 'AddSeries/RootFolders/RootFolderCollection', 'Mixins/AutoComplet
|
||||||
Path: this.ui.pathInput.val()
|
Path: this.ui.pathInput.val()
|
||||||
});
|
});
|
||||||
|
|
||||||
var self = this;
|
|
||||||
|
|
||||||
this.collection.create(newDir, {
|
rootFolders.create(newDir, {
|
||||||
wait: true, success: function () {
|
wait: true, success: function () {
|
||||||
self.collection.fetch();
|
rootFolders.fetch();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
|
||||||
|
|
||||||
search: function (context) {
|
|
||||||
|
|
||||||
var term = context.ui.seriesSearch.val();
|
|
||||||
|
|
||||||
if (term === "") {
|
|
||||||
context.collection.reset();
|
|
||||||
} else {
|
|
||||||
console.log(term);
|
|
||||||
context.collection.fetch({ data: { term: term } });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -17,9 +17,13 @@ define(['app', 'Series/SeriesCollection', 'AddSeries/RootFolders/RootFolderTempl
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize: function () {
|
initialize: function () {
|
||||||
if (this.isExisting) {
|
|
||||||
this.modal.set('isExisting', true);
|
if (!this.model) {
|
||||||
|
throw 'model is required';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.model.set('isExisting', this.options.isExisting);
|
||||||
|
this.model.set('path', this.options.folder);
|
||||||
},
|
},
|
||||||
|
|
||||||
onRender: function () {
|
onRender: function () {
|
||||||
|
@ -41,12 +45,14 @@ define(['app', 'Series/SeriesCollection', 'AddSeries/RootFolders/RootFolderTempl
|
||||||
this.model.save(undefined, {
|
this.model.save(undefined, {
|
||||||
url : NzbDrone.Series.SeriesCollection.prototype.url,
|
url : NzbDrone.Series.SeriesCollection.prototype.url,
|
||||||
success: function () {
|
success: function () {
|
||||||
|
self.close();
|
||||||
icon.removeClass('icon-spin icon-spinner disabled').addClass('icon-search');
|
icon.removeClass('icon-spin icon-spinner disabled').addClass('icon-search');
|
||||||
NzbDrone.Shared.Messenger.show({
|
NzbDrone.Shared.Messenger.show({
|
||||||
message: 'Added: ' + self.model.get('title')
|
message: 'Added: ' + self.model.get('title')
|
||||||
});
|
});
|
||||||
|
|
||||||
NzbDrone.vent.trigger(NzbDrone.Events.SeriesAdded, { existing: false, series: self.model });
|
NzbDrone.vent.trigger(NzbDrone.Events.SeriesAdded, { series: self.model });
|
||||||
|
self.model.collection.remove(self.model);
|
||||||
},
|
},
|
||||||
fail : function () {
|
fail : function () {
|
||||||
icon.removeClass('icon-spin icon-spinner disabled').addClass('icon-search');
|
icon.removeClass('icon-spin icon-spinner disabled').addClass('icon-search');
|
||||||
|
|
|
@ -47,12 +47,3 @@ Marionette.ItemView.prototype.render = function () {
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
Marionette.CollectionView.prototype.render = function () {
|
|
||||||
|
|
||||||
if (this.model) {
|
|
||||||
NzbDrone.ModelBinder.bind(this.model, this.el);
|
|
||||||
}
|
|
||||||
|
|
||||||
return oldItemCollectionViewRender.apply(this, arguments);
|
|
||||||
};
|
|
|
@ -22,6 +22,12 @@ define(function () {
|
||||||
//https://github.com/twitter/bootstrap/issues/4663
|
//https://github.com/twitter/bootstrap/issues/4663
|
||||||
this.$el.attr('tabindex', '-1');
|
this.$el.attr('tabindex', '-1');
|
||||||
this.$el.modal({'show': true, 'keyboard': true});
|
this.$el.modal({'show': true, 'keyboard': true});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
closeModal: function () {
|
||||||
|
this.$el.modal('hide');
|
||||||
|
this.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue