2013-01-23 02:23:27 +01:00
|
|
|
|
/// <reference path="../app.js" />
|
2013-01-31 23:40:51 +01:00
|
|
|
|
/// <reference path="RootFolders/RootDirCollection.js" />
|
2013-01-27 04:04:15 +01:00
|
|
|
|
/// <reference path="../Quality/qualityProfileCollection.js" />
|
2013-01-23 02:23:27 +01:00
|
|
|
|
NzbDrone.AddSeries.SearchResultModel = Backbone.Model.extend({
|
2013-01-25 20:04:37 +01:00
|
|
|
|
mutators: {
|
|
|
|
|
seriesYear: function () {
|
2013-01-26 22:20:17 +01:00
|
|
|
|
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;
|
|
|
|
|
}
|
2013-01-25 20:04:37 +01:00
|
|
|
|
}
|
2013-01-27 04:04:15 +01:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
defaults: {
|
|
|
|
|
qualityProfiles: new NzbDrone.Quality.QualityProfileCollection(),
|
|
|
|
|
rootFolders: new NzbDrone.AddSeries.RootDirCollection()
|
2013-01-25 20:04:37 +01:00
|
|
|
|
}
|
2013-01-27 04:04:15 +01:00
|
|
|
|
|
2013-01-23 02:23:27 +01:00
|
|
|
|
});
|