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