mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-13 16:43:58 -07:00
finished add series,
still has a few rough edges but should be functional.
This commit is contained in:
parent
ea929974f3
commit
465dc725c8
11 changed files with 74 additions and 59 deletions
|
@ -17,9 +17,13 @@ define(['app', 'Series/SeriesCollection', 'AddSeries/RootFolders/RootFolderTempl
|
|||
},
|
||||
|
||||
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 () {
|
||||
|
@ -41,12 +45,14 @@ define(['app', 'Series/SeriesCollection', 'AddSeries/RootFolders/RootFolderTempl
|
|||
this.model.save(undefined, {
|
||||
url : NzbDrone.Series.SeriesCollection.prototype.url,
|
||||
success: function () {
|
||||
self.close();
|
||||
icon.removeClass('icon-spin icon-spinner disabled').addClass('icon-search');
|
||||
NzbDrone.Shared.Messenger.show({
|
||||
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 () {
|
||||
icon.removeClass('icon-spin icon-spinner disabled').addClass('icon-search');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue