mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-10-01 07:55:22 +02:00
removed mutators from series.
This commit is contained in:
21
UI/Handlebars/Helpers/Quality.js
Normal file
21
UI/Handlebars/Helpers/Quality.js
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'handlebars',
|
||||
'Quality/QualityProfileCollection',
|
||||
'underscore'
|
||||
], function (Handlebars, QualityProfileCollection, _) {
|
||||
|
||||
Handlebars.registerHelper('qualityProfile', function (profileId) {
|
||||
|
||||
var profile = QualityProfileCollection.get(profileId);
|
||||
|
||||
if (profile) {
|
||||
return new Handlebars.SafeString('<span class="label quality-profile-lable">' + profile.get("name") + '</span>');
|
||||
}
|
||||
|
||||
return undefined;
|
||||
|
||||
});
|
||||
|
||||
});
|
44
UI/Handlebars/Helpers/Series.js
Normal file
44
UI/Handlebars/Helpers/Series.js
Normal file
@@ -0,0 +1,44 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'handlebars',
|
||||
'underscore'
|
||||
], function (Handlebars, _) {
|
||||
Handlebars.registerHelper('poster', function () {
|
||||
|
||||
var poster = _.where(this.images, {coverType: 'poster'});
|
||||
|
||||
if (poster[0]) {
|
||||
return poster[0].url;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('traktUrl', function () {
|
||||
return 'http://trakt.tv/show/' + this.titleSlug;
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('imdbUrl', function () {
|
||||
return 'http://imdb.com/title/' + this.imdbId;
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('route', function () {
|
||||
return '/series/' + this.titleSlug;
|
||||
});
|
||||
|
||||
|
||||
Handlebars.registerHelper('percentOfEpisodes', function () {
|
||||
var episodeCount = this.episodeCount;
|
||||
var episodeFileCount = this.episodeFileCount;
|
||||
|
||||
var percent = 100;
|
||||
|
||||
if (episodeCount > 0) {
|
||||
percent = episodeFileCount / episodeCount * 100;
|
||||
}
|
||||
|
||||
return percent;
|
||||
});
|
||||
|
||||
});
|
@@ -6,7 +6,9 @@ define(
|
||||
'Handlebars/Helpers/DateTime',
|
||||
'Handlebars/Helpers/Html',
|
||||
'Handlebars/Helpers/Numbers',
|
||||
'Handlebars/Helpers/EpisodeNumber',
|
||||
'Handlebars/Helpers/Episode',
|
||||
'Handlebars/Helpers/Series',
|
||||
'Handlebars/Helpers/Quality',
|
||||
'Handlebars/Debug'
|
||||
], function (Templates) {
|
||||
return function () {
|
||||
|
Reference in New Issue
Block a user