mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-01-17 10:45:49 +02:00
New: Manual search shows error when download fails
This commit is contained in:
parent
6b9c4af591
commit
b34879b4f6
@ -14,15 +14,23 @@ module.exports = Backgrid.Cell.extend({
|
||||
|
||||
var self = this;
|
||||
|
||||
this.$el.html('<i class="icon-sonarr-spinner fa-spin" />');
|
||||
this.$el.html('<i class="icon-sonarr-spinner fa-spin" title="Adding to download queue" />');
|
||||
|
||||
//Using success callback instead of promise so it
|
||||
//gets called before the sync event is triggered
|
||||
this.model.save(null, {
|
||||
var promise = this.model.save(null, {
|
||||
success : function() {
|
||||
self.model.set('queued', true);
|
||||
}
|
||||
});
|
||||
|
||||
promise.fail(function (xhr) {
|
||||
if (xhr.responseJSON && xhr.responseJSON.message) {
|
||||
self.$el.html('<i class="icon-sonarr-download-failed" title="{0}" />'.format(xhr.responseJSON.message));
|
||||
} else {
|
||||
self.$el.html('<i class="icon-sonarr-download-failed" title="Failed to add to download queue" />');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
render : function() {
|
||||
|
Loading…
Reference in New Issue
Block a user