mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 09:03:49 -07:00
When a new episode is grabbed the client will update its status
This commit is contained in:
parent
bcb13f93ff
commit
c1b68e0dee
7 changed files with 101 additions and 18 deletions
|
@ -8,6 +8,17 @@ define(
|
|||
url : window.ApiRoot + '/episodes',
|
||||
model: EpisodeModel,
|
||||
|
||||
state: {
|
||||
sortKey: 'episodeNumber',
|
||||
order : -1
|
||||
},
|
||||
|
||||
originalFetch: Backbone.Collection.prototype.fetch,
|
||||
|
||||
initialize: function (options) {
|
||||
this.seriesId = options.seriesId;
|
||||
},
|
||||
|
||||
bySeason: function (season) {
|
||||
var filtered = this.filter(function (episode) {
|
||||
return episode.get('seasonNumber') === season;
|
||||
|
@ -34,9 +45,18 @@ define(
|
|||
return 0;
|
||||
},
|
||||
|
||||
state: {
|
||||
sortKey: 'episodeNumber',
|
||||
order : -1
|
||||
fetch: function (options) {
|
||||
if (!this.seriesId) {
|
||||
throw 'seriesId is required';
|
||||
}
|
||||
|
||||
if (!options) {
|
||||
options = {};
|
||||
}
|
||||
|
||||
options['data'] = { seriesId: this.seriesId };
|
||||
|
||||
return this.originalFetch.call(this, options);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue