2013-02-14 18:40:29 -08:00
|
|
|
|
define(['app', 'AddSeries/RootFolders/RootFolderCollection', 'Quality/QualityProfileCollection'],
|
|
|
|
|
function (app, rootFolderCollection, qualityProfileCollection) {
|
2013-02-13 18:28:56 -08: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 13:20:17 -08:00
|
|
|
|
}
|
2013-02-13 18:28:56 -08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
defaults: {
|
2013-02-14 18:40:29 -08:00
|
|
|
|
qualityProfiles: qualityProfileCollection,
|
|
|
|
|
rootFolders: rootFolderCollection
|
2013-01-25 11:04:37 -08:00
|
|
|
|
}
|
2013-01-26 19:04:15 -08:00
|
|
|
|
|
2013-02-13 18:28:56 -08:00
|
|
|
|
});
|
2013-01-26 19:04:15 -08:00
|
|
|
|
|
2013-01-22 17:23:27 -08:00
|
|
|
|
});
|