Series search added

This commit is contained in:
Mark McDowall
2013-07-21 19:52:53 -07:00
parent 125f3d87a4
commit d19e33f0a8
7 changed files with 83 additions and 9 deletions
+5 -4
View File
@@ -95,13 +95,14 @@ define(
_seasonSearch: function () {
Actioneer.ExecuteCommand({
command : 'seasonSearch',
properties : {
command : 'seasonSearch',
properties : {
seriesId : this.model.get('seriesId'),
seasonNumber: this.model.get('seasonNumber')
},
element : this.ui.seasonSearch,
failMessage: 'Season search failed'
element : this.ui.seasonSearch,
failMessage : 'Search for season {0} failed'.format(this.model.get('seasonNumber')),
startMessage: 'Search for season {0} started'.format(this.model.get('seasonNumber'))
});
},
+16 -2
View File
@@ -25,14 +25,16 @@ define(
monitored: '.x-monitored',
edit : '.x-edit',
refresh : '.x-refresh',
rename : '.x-rename'
rename : '.x-rename',
search : '.x-search'
},
events: {
'click .x-monitored': '_toggleMonitored',
'click .x-edit' : '_editSeries',
'click .x-refresh' : '_refreshSeries',
'click .x-rename' : '_renameSeries'
'click .x-rename' : '_renameSeries',
'click .x-search' : '_seriesSearch'
},
initialize: function () {
@@ -146,6 +148,18 @@ define(
element : this.ui.rename,
failMessage: 'Series search failed'
});
},
_seriesSearch: function () {
Actioneer.ExecuteCommand({
command : 'seriesSearch',
properties : {
seriesId : this.model.get('id')
},
element : this.ui.search,
failMessage : 'Series search failed',
startMessage: 'Search for {0} started'.format(this.model.get('title'))
});
}
});
});
+3 -2
View File
@@ -5,8 +5,9 @@
<i class="icon-bookmark x-monitored clickable" title="Toggle monitored state for entire series"/>
{{title}}
<span class="series-actions pull-right">
<i class="icon-nd-rename x-rename" title="Rename Series"/>
<i class="icon-refresh x-refresh" title="Update Series"/>
<i class="icon-refresh x-refresh" title="Update series info and scan disk"/>
<i class="icon-nd-rename x-rename" title="Rename all episodes in this series"/>
<i class="icon-search x-search" title="Search for all episodes in this series"/>
<i class="icon-nd-edit x-edit" title="Edit series"/>
</span>
</h1>
+11 -1
View File
@@ -5,6 +5,7 @@ define(['Commands/CommandController', 'Shared/Messenger'],
ExecuteCommand: function (options) {
options.iconClass = this._getIconClass(options.element);
this._showStartMessage(options);
this._setSpinnerOnElement(options);
var promise = CommandController.Execute(options.command, options.properties);
@@ -14,9 +15,10 @@ define(['Commands/CommandController', 'Shared/Messenger'],
SaveModel: function (options) {
options.iconClass = this._getIconClass(options.element);
this._showStartMessage(options);
this._setSpinnerOnElement(options);
var promise = options.context.model.save();
var promise = options.context.model.save();
this._handlePromise(promise, options);
},
@@ -80,6 +82,14 @@ define(['Commands/CommandController', 'Shared/Messenger'],
options.element.removeClass(options.iconClass);
options.element.addClass('icon-nd-spinner');
}
},
_showStartMessage: function (options) {
if (options.startMessage) {
Messenger.show({
message: options.startMessage
});
}
}
}
});