mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 09:03:49 -07:00
Using reqres to map episode to episode file
This commit is contained in:
parent
8737cb0145
commit
b1899b5f6f
8 changed files with 73 additions and 16 deletions
31
UI/Series/EpisodeFileCollection.js
Normal file
31
UI/Series/EpisodeFileCollection.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone',
|
||||
'Series/EpisodeFileModel'
|
||||
], function (Backbone, EpisodeFileModel) {
|
||||
return Backbone.Collection.extend({
|
||||
url : window.ApiRoot + '/episodefile',
|
||||
model: EpisodeFileModel,
|
||||
|
||||
originalFetch: Backbone.Collection.prototype.fetch,
|
||||
|
||||
initialize: function (options) {
|
||||
this.seriesId = options.seriesId;
|
||||
},
|
||||
|
||||
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