mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
removed NzbDrone. namespace, everything is done using require.
This commit is contained in:
parent
ef62af75df
commit
b0bd3f34f1
121 changed files with 2570 additions and 2587 deletions
|
@ -1,87 +1,88 @@
|
|||
'use strict';
|
||||
define(['app', 'Quality/QualityProfileCollection'], function (app, qualityProfiles) {
|
||||
NzbDrone.Series.SeriesModel = Backbone.Model.extend({
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone',
|
||||
'Quality/QualityProfileCollection',
|
||||
], function (Backbone, QualityProfileCollection) {
|
||||
return Backbone.Model.extend({
|
||||
|
||||
urlRoot: NzbDrone.Constants.ApiRoot + '/series',
|
||||
urlRoot: Constants.ApiRoot + '/series',
|
||||
|
||||
mutators: {
|
||||
percentOfEpisodes: function () {
|
||||
var episodeCount = this.get('episodeCount');
|
||||
var episodeFileCount = this.get('episodeFileCount');
|
||||
mutators: {
|
||||
percentOfEpisodes: function () {
|
||||
var episodeCount = this.get('episodeCount');
|
||||
var episodeFileCount = this.get('episodeFileCount');
|
||||
|
||||
var percent = 100;
|
||||
var percent = 100;
|
||||
|
||||
if (episodeCount > 0) {
|
||||
percent = episodeFileCount / episodeCount * 100;
|
||||
if (episodeCount > 0) {
|
||||
percent = episodeFileCount / episodeCount * 100;
|
||||
}
|
||||
|
||||
return percent;
|
||||
},
|
||||
poster : function () {
|
||||
var poster = _.find(this.get('images'), function (image) {
|
||||
return image.coverType === 'poster';
|
||||
});
|
||||
|
||||
if (poster) {
|
||||
return poster.url;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
},
|
||||
fanArt : function () {
|
||||
var poster = _.find(this.get('images'), function (image) {
|
||||
return image.coverType === 'fanart';
|
||||
});
|
||||
|
||||
if (poster) {
|
||||
return poster.url;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
},
|
||||
traktUrl : function () {
|
||||
return 'http://trakt.tv/show/' + this.get('titleSlug');
|
||||
},
|
||||
imdbUrl : function () {
|
||||
return 'http://imdb.com/title/' + this.get('imdbId');
|
||||
},
|
||||
isContinuing : function () {
|
||||
return this.get('status') === 'continuing';
|
||||
},
|
||||
shortDate : function () {
|
||||
var date = this.get('nextAiring');
|
||||
|
||||
if (!date) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return Date.create(date).short();
|
||||
},
|
||||
route : function () {
|
||||
return '/series/details/' + this.get('titleSlug');
|
||||
//return '/series/details/' + this.get('id');
|
||||
},
|
||||
|
||||
qualityProfile: function () {
|
||||
|
||||
var profile = QualityProfileCollection.get(this.get('qualityProfileId'));
|
||||
|
||||
if (profile) {
|
||||
return profile.toJSON();
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return percent;
|
||||
},
|
||||
poster : function () {
|
||||
var poster = _.find(this.get('images'), function (image) {
|
||||
return image.coverType === 'poster';
|
||||
});
|
||||
|
||||
if (poster) {
|
||||
return poster.url;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
},
|
||||
fanArt : function () {
|
||||
var poster = _.find(this.get('images'), function (image) {
|
||||
return image.coverType === 'fanart';
|
||||
});
|
||||
|
||||
if (poster) {
|
||||
return poster.url;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
},
|
||||
traktUrl : function () {
|
||||
return 'http://trakt.tv/show/' + this.get('titleSlug');
|
||||
},
|
||||
imdbUrl : function () {
|
||||
return 'http://imdb.com/title/' + this.get('imdbId');
|
||||
},
|
||||
isContinuing : function () {
|
||||
return this.get('status') === 'continuing';
|
||||
},
|
||||
shortDate : function () {
|
||||
var date = this.get('nextAiring');
|
||||
|
||||
if (!date) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return Date.create(date).short();
|
||||
},
|
||||
route : function () {
|
||||
return '/series/details/' + this.get('titleSlug');
|
||||
//return '/series/details/' + this.get('id');
|
||||
},
|
||||
|
||||
qualityProfile: function () {
|
||||
|
||||
var profile = qualityProfiles.get(this.get('qualityProfileId'));
|
||||
|
||||
if (profile) {
|
||||
return profile.toJSON();
|
||||
}
|
||||
|
||||
return undefined;
|
||||
defaults: {
|
||||
episodeFileCount: 0,
|
||||
episodeCount : 0,
|
||||
isExisting : false,
|
||||
status : 0
|
||||
}
|
||||
},
|
||||
|
||||
defaults: {
|
||||
episodeFileCount: 0,
|
||||
episodeCount : 0,
|
||||
isExisting : false,
|
||||
status : 0
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return NzbDrone.Series.SeriesModel;
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue