mirror of https://github.com/lidarr/Lidarr
Season Search added to series details
This commit is contained in:
parent
56cf3555a6
commit
a34e6f3c70
|
@ -4,7 +4,7 @@ define(['app'], function () {
|
||||||
NzbDrone.Commands.Execute = function (name, properties) {
|
NzbDrone.Commands.Execute = function (name, properties) {
|
||||||
var data = { command: name };
|
var data = { command: name };
|
||||||
|
|
||||||
if (!properties) {
|
if (properties) {
|
||||||
$.extend(data, properties);
|
$.extend(data, properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,20 @@ define([
|
||||||
'Cells/EpisodeStatusCell',
|
'Cells/EpisodeStatusCell',
|
||||||
'Cells/EpisodeTitleCell',
|
'Cells/EpisodeTitleCell',
|
||||||
'Cells/AirDateCell',
|
'Cells/AirDateCell',
|
||||||
'Cells/ToggleCell'],
|
'Cells/ToggleCell',
|
||||||
function (App, EpisodeStatusCell, EpisodeTitleCell, AirDateCell, ToggleCell) {
|
'Shared/Messenger'],
|
||||||
|
function (App, EpisodeStatusCell, EpisodeTitleCell, AirDateCell, ToggleCell, Messenger) {
|
||||||
return Backbone.Marionette.Layout.extend({
|
return Backbone.Marionette.Layout.extend({
|
||||||
template: 'Series/Details/SeasonLayoutTemplate',
|
template: 'Series/Details/SeasonLayoutTemplate',
|
||||||
|
|
||||||
|
ui: {
|
||||||
|
seasonSearch: '.x-season-search'
|
||||||
|
},
|
||||||
|
|
||||||
|
events: {
|
||||||
|
'click .x-season-search': '_seasonSearch'
|
||||||
|
},
|
||||||
|
|
||||||
regions: {
|
regions: {
|
||||||
episodeGrid: '#x-episode-grid'
|
episodeGrid: '#x-episode-grid'
|
||||||
},
|
},
|
||||||
|
@ -63,6 +72,40 @@ define([
|
||||||
collection: this.episodeCollection,
|
collection: this.episodeCollection,
|
||||||
className : 'table table-hover season-grid'
|
className : 'table table-hover season-grid'
|
||||||
}));
|
}));
|
||||||
|
},
|
||||||
|
|
||||||
|
_seasonSearch: function () {
|
||||||
|
var command = 'seasonSearch';
|
||||||
|
|
||||||
|
this.idle = false;
|
||||||
|
|
||||||
|
this.ui.seasonSearch.addClass('icon-spinner icon-spin');
|
||||||
|
|
||||||
|
var properties = {
|
||||||
|
seriesId: this.model.get('seriesId'),
|
||||||
|
seasonNumber: this.model.get('seasonNumber')
|
||||||
|
};
|
||||||
|
|
||||||
|
var self = this;
|
||||||
|
var commandPromise = App.Commands.Execute(command, properties);
|
||||||
|
|
||||||
|
commandPromise.fail(function (options) {
|
||||||
|
if (options.readyState === 0 || options.status === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Messenger.show({
|
||||||
|
message: 'Season search failed',
|
||||||
|
type : 'error'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
commandPromise.always(function () {
|
||||||
|
if (!self.isClosed) {
|
||||||
|
self.ui.seasonSearch.removeClass('icon-spinner icon-spin');
|
||||||
|
self.idle = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<div class="series-season">
|
<div class="series-season">
|
||||||
<h2>{{seasonTitle}}</h2>
|
<h2>{{seasonTitle}} <i class="icon-search pull-right season-search x-season-search" /></h2>
|
||||||
<div id="x-episode-grid"/>
|
<div id="x-episode-grid"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
@import "../shared/Styles/clickable.less";
|
||||||
|
|
||||||
.series-season {
|
.series-season {
|
||||||
.episode-number-cell {
|
.episode-number-cell {
|
||||||
width: 22px;
|
width: 22px;
|
||||||
|
@ -34,3 +36,8 @@
|
||||||
width: 10px;
|
width: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.season-search {
|
||||||
|
.clickable;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
Loading…
Reference in New Issue