From bf50c5989addfc11b7c5d4835884fc54c7852ff4 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sat, 26 Jan 2013 13:20:17 -0800 Subject: [PATCH] fixed where year could show up twice in series search. --- .../AddSeries/AddNewSeries/SearchResultTemplate.html | 2 +- .../_backboneApp/AddSeries/SearchResultModel.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/NzbDrone.Web/_backboneApp/AddSeries/AddNewSeries/SearchResultTemplate.html b/NzbDrone.Web/_backboneApp/AddSeries/AddNewSeries/SearchResultTemplate.html index 5241a049c..fdaab6ae8 100644 --- a/NzbDrone.Web/_backboneApp/AddSeries/AddNewSeries/SearchResultTemplate.html +++ b/NzbDrone.Web/_backboneApp/AddSeries/AddNewSeries/SearchResultTemplate.html @@ -1,5 +1,5 @@ 
- {{seriesName}} ({{seriesYear}}) + {{seriesName}} {{seriesYear}}
diff --git a/NzbDrone.Web/_backboneApp/AddSeries/SearchResultModel.js b/NzbDrone.Web/_backboneApp/AddSeries/SearchResultModel.js index 9a8efcf39..88ddd1747 100644 --- a/NzbDrone.Web/_backboneApp/AddSeries/SearchResultModel.js +++ b/NzbDrone.Web/_backboneApp/AddSeries/SearchResultModel.js @@ -2,8 +2,14 @@ NzbDrone.AddSeries.SearchResultModel = Backbone.Model.extend({ mutators: { seriesYear: function () { - var date = Date.utc.create(this.get('firstAired')); - return date.format('{yyyy}'); + var date = Date.utc.create(this.get('firstAired')).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; + } } } });