Radarr/src/UI/Series/Details/EpisodeNumberCell.js
Mark McDowall 193672b652 Anime!
New: Anime support
New: pull alternate names from thexem.de
New: Search using all alternate names (if rage ID is unavailable)
New: Show scene mapping information when hovering over episode number
New: Full season searching for anime (searches for each episode)
New: animezb.com anime indexer
New: Treat BD as bluray

Fixed: Parsing of 2 digit absolute episode numbers
Fixed: Loading series details page for series that start with period
Fixed: Return 0 results when manual search fails, instead of an error
Fixed: animezb URL
2014-07-02 07:33:51 -07:00

62 lines
2.2 KiB
JavaScript

'use strict';
define(
[
'marionette',
'Cells/NzbDroneCell',
'reqres'
], function (Marionette, NzbDroneCell, reqres) {
return NzbDroneCell.extend({
className: 'episode-number-cell',
template : 'Series/Details/EpisodeNumberCellTemplate',
render: function () {
this.$el.empty();
this.$el.html(this.model.get('episodeNumber'));
var alternateTitles = [];
if (reqres.hasHandler(reqres.Requests.GetAlternateNameBySeasonNumber)) {
if (this.model.get('sceneSeasonNumber') > 0) {
alternateTitles = reqres.request(reqres.Requests.GetAlternateNameBySeasonNumber,
this.model.get('seriesId'),
this.model.get('sceneSeasonNumber'));
}
if (alternateTitles.length === 0) {
alternateTitles = reqres.request(reqres.Requests.GetAlternateNameBySeasonNumber,
this.model.get('seriesId'),
this.model.get('seasonNumber'));
}
}
if (this.model.get('sceneSeasonNumber') > 0 ||
this.model.get('sceneEpisodeNumber') > 0 ||
(this.model.has('sceneAbsoluteEpisodeNumber') && this.model.get('sceneAbsoluteEpisodeNumber') > 0) ||
alternateTitles.length > 0)
{
this.templateFunction = Marionette.TemplateCache.get(this.template);
var json = this.model.toJSON();
json.alternateTitles = alternateTitles;
var html = this.templateFunction(json);
this.$el.popover({
content : html,
html : true,
trigger : 'hover',
title : 'Scene Information',
placement: 'right',
container: this.$el
});
}
this.delegateEvents();
return this;
}
});
});