1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-25 09:18:34 +00:00

fixed where year could show up twice in series search.

This commit is contained in:
kay.one 2013-01-26 13:20:17 -08:00
parent b393c11b27
commit bf50c5989a
2 changed files with 9 additions and 3 deletions

View file

@ -1,5 +1,5 @@
<div class="result-item row"> <div class="result-item row">
<div> <div>
<a href="http://thetvdb.com/?tab=series&id={{id}}" target="_blank" class="icon-info-sign"></a>{{seriesName}} ({{seriesYear}}) <a href="http://thetvdb.com/?tab=series&id={{id}}" target="_blank" class="icon-info-sign"></a>{{seriesName}} {{seriesYear}}
</div> </div>
</div> </div>

View file

@ -2,8 +2,14 @@
NzbDrone.AddSeries.SearchResultModel = Backbone.Model.extend({ NzbDrone.AddSeries.SearchResultModel = Backbone.Model.extend({
mutators: { mutators: {
seriesYear: function () { seriesYear: function () {
var date = Date.utc.create(this.get('firstAired')); var date = Date.utc.create(this.get('firstAired')).format('({yyyy})');
return date.format('{yyyy}');
//don't append year, if the series name already has the name appended.
if (this.get('seriesName').endsWith(date)) {
return "";
} else {
return date;
}
} }
} }
}); });