2013-02-15 03:40:29 +01:00
|
|
|
|
define(['app', 'AddSeries/RootFolders/RootFolderCollection', 'Quality/QualityProfileCollection'],
|
|
|
|
|
function (app, rootFolderCollection, qualityProfileCollection) {
|
2013-02-14 03:28:56 +01: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.
|
2013-02-26 04:58:57 +01:00
|
|
|
|
if (this.get('title').endsWith(date)) {
|
2013-02-14 03:28:56 +01:00
|
|
|
|
return "";
|
|
|
|
|
} else {
|
|
|
|
|
return date;
|
|
|
|
|
}
|
2013-01-26 22:20:17 +01:00
|
|
|
|
}
|
2013-02-14 03:28:56 +01:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
defaults: {
|
2013-02-15 03:40:29 +01:00
|
|
|
|
qualityProfiles: qualityProfileCollection,
|
|
|
|
|
rootFolders: rootFolderCollection
|
2013-01-25 20:04:37 +01:00
|
|
|
|
}
|
2013-01-27 04:04:15 +01:00
|
|
|
|
|
2013-02-14 03:28:56 +01:00
|
|
|
|
});
|
2013-01-27 04:04:15 +01:00
|
|
|
|
|
2013-01-23 02:23:27 +01:00
|
|
|
|
});
|