2013-02-14 17:18:29 +00:00
|
|
|
|
define(['app', 'AddSeries/RootFolders/RootFolderCollection', 'Quality/QualityProfileCollection'], function (RootFolderCollection) {
|
2013-01-26 21:20:17 +00:00
|
|
|
|
|
2013-02-14 02:28:56 +00:00
|
|
|
|
|
|
|
|
|
NzbDrone.AddSeries.SearchResultModel = Backbone.Model.extend({
|
|
|
|
|
mutators: {
|
|
|
|
|
seriesYear: function () {
|
|
|
|
|
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-26 21:20:17 +00:00
|
|
|
|
}
|
2013-02-14 02:28:56 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
defaults: {
|
|
|
|
|
qualityProfiles: new NzbDrone.Quality.QualityProfileCollection(),
|
2013-02-14 17:18:29 +00:00
|
|
|
|
rootFolders: RootFolderCollection
|
2013-01-25 19:04:37 +00:00
|
|
|
|
}
|
2013-01-27 03:04:15 +00:00
|
|
|
|
|
2013-02-14 02:28:56 +00:00
|
|
|
|
});
|
2013-01-27 03:04:15 +00:00
|
|
|
|
|
2013-01-23 01:23:27 +00:00
|
|
|
|
});
|